hello.
i'm asking hand-holding on one. can explain enough.
i have complex button when rolled over playhead goes frame label textout.
when roll out executed, playhead go frame label textin.
easy enough.
mcbtnhome1.addeventlistener(mouseevent.roll_over, droptext); function droptext (evt:mouseevent): void { mcbtnhome1.gotoandplay("textout"); } mcbtnhome1.addeventlistener(mouseevent.roll_out, raisetext); function raisetext (evt:mouseevent): void { mcbtnhome1.gotoandstop("textin"); } mcbtnhome1.addeventlistener(mouseevent.click, landhome); function landhome (evt:mouseevent): void { mcbtnhome1.gotoandstop("textstay"); }
the problem occurs when plug in third event, click. click button, , playhead moves frame label textstay, it's supposed to, once roll out/ off of button, roll out action again executed. once click on button, no more interaction supposed possible.
this happens despite having stop(); action @ textstay frame.
i'm guessing need if / then of if / else statements, true / false declarations, i've no clue "if's" should checking for.
in click function remove roll_out listener, , reassign when textstay frame.
(edit - actually, want assign roll_out listener in roll_over function @ times)
mcbtnhome1.addeventlistener(mouseevent.roll_over, droptext);
function droptext (evt:mouseevent): void {
mcbtnhome1.addeventlistener(mouseevent.roll_out, raisetext);
mcbtnhome1.gotoandplay("textout");
}
function raisetext (evt:mouseevent): void {
mcbtnhome1.gotoandstop("textin");
}
mcbtnhome1.addeventlistener(mouseevent.click, landhome);
function landhome (evt:mouseevent): void {
mcbtnhome1.removeeventlistener(mouseevent.roll_out, raisetext);
mcbtnhome1.gotoandstop("textstay");
}
More discussions in ActionScript 3
adobe
Comments
Post a Comment