| Ultrashock Forums
• AS3 - Using Frame Label to Trigger Function |
Member Blogs | ||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
4 Weeks Ago
#2 |
||
|
|
4 Weeks Ago
#3 |
||
|
Thanks for your help Isocase. Would an EventListener on the labeled frame work also?
|
|
|
4 Weeks Ago
#4 |
||
|
You can add the event listener anywhere you want. You just have to make sure you dispatch the event so there is something to listen for.
|
|
|
4 Weeks Ago
#5 |
||
|
Thanks again for your help. I was able to get it to work with this code on the main timeline. ActionScript Code:
Wohoo! 100th post!!! |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|




4 comments
| 290 views



Linear Mode
Code on frame 1:
import AnimationEvent; addEventListener( AnimationEvent.FOO, foo, false, 0, true ); function foo( e:AnimationEvent ):void { trace( "This method runs when the timeline hits frame 30" ); }package { import flash.events.Event; public class AnimationEvent extends Event { public static const FOO:String = "foo"; public function AnimationEvent( type:String ) { super( type ); } override public function clone():Event { return new AnimationEvent( type ); } override public function toString():String { return formatToString( "AnimationEvent", "bubbles", "cancelable", "eventPhase" ); } } }