2 Replies Latest reply on Aug 5, 2009 8:00 AM by Piotr Wierzgała

    access to parallel child

    Piotr Wierzgała Level 1

      Is there any property of parallel object that allows to accsess its children?


      I have five parallel blocks and each one has end effect that refers to randomPatch function.


      <mx:Parallel id="object1Animation" target="{object1}" effectEnd="randomPatch(event,-34,648)">        
           <mx:Fade alphaFrom="1" alphaTo="0"/>
           <mx:Move xFrom="-34" xTo="648" yFrom="-79" yTo="338"/>
      <mx:Parallel id="object5Animation" target="{object5}" effectEnd="randomPatch(event,600,1080)">       
           <mx:Fade alphaFrom="1" alphaTo="0"/>
           <mx:Move xFrom="600" xTo=1080" yFrom="-79" yTo="275"/>


      And here's my randomPatch function:


      private function randomPatch(event:Event,xFrom:int, xTo:int):void {
           var object:Object = event.currentTarget; //it's reference to parallel object now (should be referce to parallel Move child)
           var random:Number;
           random = Math.random()*1000;
           object.xFrom = -34 + random; 
           object.xTo = 648 + random;


      Do you know what I should assign to my object variable if I want it to be reference to second parallel child?