..:: MX Studio Fóruns ::..: Como dar um tempo entre dois efeitos? - ..:: MX Studio Fóruns ::..

Jump to content

Publicidade




Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Como dar um tempo entre dois efeitos?

#1 User is offline   flavioz 

  • Group: Membros
  • Posts: 2
  • Joined: 16-November 05

Posted 18 November 2005 - 04:58 PM

Obrigado pela dica, agora eu quero saber como deixar um espaço de tempo entre os dois efeitos.

Se alguém puder me ajudar eu agradeço.
0

#2 User is offline   pcsilva 

  • Group: Moderadores
  • Posts: 1940
  • Joined: 23-January 05

Posted 19 November 2005 - 11:23 PM

Use o setInterval / clearInterval
http://livedocs.macromedia.com/flex/15/fle...en/00001662.htm

CODE
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Composite effect -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">

  <mx:Script>
      <![CDATA[

  import mx.effects.Move;
  import mx.effects.Sequence;
  import mx.effects.Parallel;

  var movesequenceA:Move;
  var movesequenceB:Move;
  var moveparallelbutton:Move;
  var sequenceAB:Sequence;
  var parallelAB:Parallel;

 function starteffect(ax,ay,bx,by)
 {
          movesequenceA= new mx.effects.Move(a);
          movesequenceB= new mx.effects.Move(b);
          moveparallelbutton= new mx.effects.Move(button);
          sequenceAB= new mx.effects.Sequence();
          parallelAB= new mx.effects.Parallel();
          sequenceAB.addChild(movesequenceA);
          sequenceAB.addChild(movesequenceB);
          parallelAB.addChild(moveparallelbutton);
          moveparallelbutton.xTo=0;
  moveparallelbutton.xFrom= 245;
          moveparallelbutton.yFrom=85;
          moveparallelbutton.duration= 4000;
          movesequenceA.xTo= ax;
          movesequenceA.xBy= 200;
          movesequenceA.yTo= ay;
          movesequenceA.yBy= 175;
          movesequenceA.duration= 2000;
          movesequenceB.yFrom =175;
          movesequenceB.xTo= bx;
          movesequenceB.xBy= 200;
          movesequenceB.yTo= by;
          movesequenceB.yBy= 200;
          movesequenceB.duration= 2000;
          var fncInterval=function() {
              parallelAB.playEffect();
              clearInterval(Interval );
          };
          var Interval = setInterval(fncInterval, 200);
          sequenceAB.playEffect();
 }
  ]]>
 
  </mx:Script>
<mx:Panel title="Composite Effect" >
  <mx:Canvas id="canvas" width="500" height="200">

      <mx:Label id="a" text="Sequence 1" height="{(canvas.height-20)/2}" width="{(canvas.width-20)/2}"
          effectStart=" a.text= 'sequence 1 Running';"
          effectEnd="a.text='sequence 1 ended!!!' " color="#009966"/>

      <mx:Label id="b" y="175" text="Sequence 2" height="{(canvas.height-20)/2}"
          width="{(canvas.width-20)/2}" effectStart=" b.text= 'sequence 2 Running';"
          effectEnd="b.text='sequence 2 ended!!'" x="0" color="#00CCFF"/>

      <mx:Button id="button" label="Start effect" click="starteffect(200,175,200,0)"
          effectStart="button.label='parallel effect running'"
          effectEnd="button.label='parallel effect ended!!'" x="245" y="85"/>

  </mx:Canvas>

</mx:Panel>

</mx:Application>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic



Publicidade




1 User(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)