0 Replies Latest reply on Mar 1, 2007 6:03 AM by Gutaker

    sequence inside canvas not playing

    Gutaker
      hi guys! i'm a newB in actionscript so i really do need your help :)
      basiclly i'm done with app already but i got a problem just like in title:
      when all of components are out of canvas(in main application section) everything goes well but when i move it into the canvas, so i can position everything at one time, it runs with lots of errors and no animation is played :(

      here is app code:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      public var ending:String = 'Panel';
      ]]>
      </mx:Script>
      <mx:Script source="movement.as"/>
      <mx:Sequence id="ein">
      <mx:Blur duration="100" blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
      <mx:Move yTo="55" duration="200"/>
      <mx:Move xTo="95" duration="200"/>
      <mx:Resize heightTo="310" duration="200"/>
      <mx:Resize widthTo="655" duration="200"/>
      <mx:Blur duration="100" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
      </mx:Sequence>
      <mx:Sequence id="eout">
      <mx:Blur duration="100" blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
      <mx:Resize widthTo="30" duration="200"/>
      <mx:Resize heightTo="30" duration="200"/>
      <mx:Move id="mvx" duration="200"/>
      <mx:Move id="mvy" yTo="10" duration="200"/>
      <mx:Blur duration="100" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
      </mx:Sequence>
      <mx:Canvas>
      <mx:Button x="10" y="171" label="ala" visible="true" id="ala" click="{mv(event)}"/>
      <mx:Button x="10" y="201" label="kot" visible="true" id="kot" click="{mv(event)}"/>
      <mx:Panel id="kotPanel" x="710" y="10" width="30" height="30" layout="absolute" title="kot">
      </mx:Panel>
      <mx:Panel id="alaPanel" x="667" y="10" width="30" height="30" layout="absolute" title="ala">
      </mx:Panel>
      </mx:Canvas>
      </mx:Application>

      and here is movement.as script code:
      public var current:Object;
      public var last:Object;
      public function mv(event:Event):void {
      if (current == null) {
      current = getChildByName(event.target.id+ending);
      if (last == null) {
      last = current;
      }
      ein.end();
      ein.play([current]);
      mvx.xTo = current.x;
      }
      if (getChildByName(event.target.id+ending) != current) {
      last = current;
      current = getChildByName(event.target.id+ending);
      ein.end();
      ein.play([current]);
      if (last != current) {
      eout.end();
      eout.play([last]);
      }
      mvx.xTo = current.x;
      }
      }

      thx in advance :)
      any help greatly appreciated :)