all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

movie clip button issue


movie clip button issue hushhurt
5/30/2006 7:28:14 PM
flash actionscript:
hello,
I am still in the process of learning flash, and i am trying to make a
animated MC button.
I created the MC, it has a begining animation then stops at frame 80, on frame
84, which I labeled "over" I have a small "over state" animation.
the issue i am having is, when i test the complete movie and rollover the
button, it jumpes straight to the "over" state without playing the begining
animation first. I dont want to be able to see the rollover animation until the
begining animation is finished.
so i created this script:

work_mc.onRollOver = function() {
var cFrame:Number = _currentframe;
var hFrame:Number = 80; //last frame of btn anim (with a stop action on frame)
if (this.cFrame == hFrame) {
this.gotoAndPlay("over");
}
else {
trace("not working");
}
};

it looks rough, but i'm still learning - hopefully i made my clear, can
someone help me out?

thanks
david

Re: movie clip button issue nardove
5/31/2006 12:00:00 AM
well i got a different way to do that i can tell you if you want,
but looking at your code you can just do this unless you need those variables
for later(cFrame and hFrame)

work_mc.onRollOver = function() {
if ( _currentframe == 80 ) {
gotoAndPlay("over");
}
else {
trace("not working");
}
};

hope that helps

rS
Re: movie clip button issue hushhurt
6/1/2006 5:18:33 PM
thank you - sorry for the delayed response.

that did work - but what im trying to do now is make the playhead go to the
frame labels insted of the frames themselves.

how would i write;
if(_currentfame < "frame label")
gotoAndPlay("another frame label");

i want to make this function more dynamic. is the frame label method only work
with the "gotoAndPlay", "gotoAndStop" methods?

can I assign a variable to a frame label, and call that varabile in a logical
statement?
AddThis Social Bookmark Button