Posted By

Tagged

actionscript - button action [to attach to the timeline]

basic actionscript button action that should be attached directly to a frame on the timeline - NOT to the button itself. this is a slightly more complex version of the 'standard' button action which attaches directly to the button itself. this version has the advantage of allowing you to keep all your actionscript code together in one place on the timeline, rather than having it scattered across all the various elements in your movie.

for this to work, your button must have an instance name. in the code here, my button instance name is "stupidbutton".

this action will NOT work in actionscript 3, which uses "addEventListener" to respond to button events.

make sure you're attaching this action to the timeline and not directly to the button. the actions window should say "actions - frame" when you open it. if it says "actions - button" you're trying to attach this action to the button itself and flash will blow a fuse!