Scope issue - Controlling a movieclip inside a button with actionscript -
i'm trying show/hide movieclip (or graphic) symbol on layer of button symbol using actionscript 2. here's tried
in actions button:
on (release) { this.button_name.movieclip_name._alpha = 0; trace(this.button_name.movieclip_name); }
and trace returns undefined... think i've got problem understanding how address child element. not flash programmer... hacking on @ moment side project, don't understand how works.
thanks, jim :)
for as2, it's not idea put movieclips inside buttons. easiest , direct approach restructure things button , movieclip had inside @ same level, perhaps within new mc created contain them. should think of button symbol thing provides clickable hit state, not container other things.
as followup, yep, can indeed use movieclips buttons. if give mc functions handle button-like events (onpress, onrelease, onreleaseoutside , on), functions called on button. can control finer details - see docs on movieclip.hitarea , movieclip.usehandcursor.
one thing i've done create frames in mc called "show" , "hide", followed short animations , "stop()" command, , done this:
mymc.onrollover = function() { gotoandplay("show"); } mymc.onrollout = mymc.onreleaseoutside = function() { gotoandplay("hide"); } mymc.onrelease = function() { // something.... }
Comments
Post a Comment