Comunidad de diseño web y desarrollo en internet online

Banner con catalys y/o flex

Citar            
MensajeEscrito el 22 May 2011 05:22 pm
Buenas Tardes, tengo una pregunta, alguien sabe como puedo hacer para q los estados dentro de catalys o flex, cambien automaticamente despues de cierto tiempo puede ser unos 35 segundos, entre stados y stado.

de ante mano Muchas gracias!!!

Por caliches52

6 de clabLevel



 

firefox
Citar            
MensajeEscrito el 23 May 2011 12:30 am
Prueba usando un Timer.
¿Por que un banner en Catalyst/Flex y no en Flash?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 May 2011 08:58 pm
Buenas tardes, seria tan amable de explicarme como seria la forma de implementar el time??
en cuanto a por q en catalys o flash, por agilidad y tiempo, tengo unas competencias en donde el factor tiempo en primordial.

gracias!!

Por caliches52

6 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 May 2011 09:12 pm
EN Flex sería algo así (pongo solo la parte de código pertinente)

Código ActionScript :

<fx:Script>
      <![CDATA[
                        import flash.utils.Timer;
                        import flash.events.TimerEvent;

                       private var tick:Timer
                       private var states = ["home", "seccion1", "seccion2"];

                       private function iniciaTimer():void{
                               tick = new Timer(35000)
                                tick.addEventListeners(TimerEvent.TIMER, cambiar)
                       }
                       private function cambiar(evt:TimerEvent):void{
                               this.currentState = states[int(tick.currentCount%states.length)]
                       }
                 ]]>
</sx:Script>


Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 28 May 2011 04:01 pm
Jorge muchas gracias por la respuesta, estuve manipulando el codigo y tengo una inquietud, luego de tener mi diseño realizado en catalys, lo pase a fBuldier, para poder agregar el codigo donde se realizen el cambio entre los estados, pero no me funciono no se que pueda estar mal, si me puedes ayudar con esto.

De ante mano mil gracias!!

Código :

<s:Application
   xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:ai="http://ns.adobe.com/ai/2009"
   xmlns:fc="http://ns.adobe.com/flashcatalyst/2009" xmlns:lib="assets.graphics.olive_tour.*"
   xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark" xmlns:flm="http://ns.adobe.com/flame/2008"
   height="400" width="700" backgroundColor="#FFFFFF" preloaderChromeColor="#FFFFFF">
   <fx:Style source="Main.css"/>
   <fx:Script>
      <![CDATA[
         import flash.events.TimerEvent;
         import flash.utils.Timer;
         
         [bindable]
         private var timer:Timer;
         private var estado = ["Page1", "Page2", "Page3", "Page4", "Page5", "Page6"];
         
         
         private function iniciaTimer():void{
            timer = new Timer(36000);
            timer.addEventListener(TimerEvent.TIMER, cambiar);
            timer.start();
         }
         private function cambiar(evt:TimerEvent):void{
            this.currentState = estado[int(timer.currentCount%estado.length)]
         }
      ]]>
   </fx:Script>
   <s:states>
      <s:State name="Page1"/>
      <s:State name="Page2"/>
      <s:State name="Page3"/>
      <s:State name="Page4"/>
      <s:State name="Page5"/>
      <s:State name="Page6"/>
   </s:states>


luego de esto sigue el codigo normal del banner!!

Por caliches52

6 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 May 2011 04:56 pm
Es que en ningún momento llamas a iniciaTimer, agregalo al creationComplete de Application

<Application ...... backgroundColor="#FFFFFF" preloaderChromeColor="#FFFFFF" creationComplete="iniciaTimer">

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.