Stopping a current frame

Okay, so I’m trying to get a movieclip (lets call it ALFRED) to stop when I mouse over a button.

I want that movieclip to keep playing until it reaches that exact frame. Let’s call that frame “rank1.” “Rank1” happens to be on frame 100.

So, you mouse over… and the movieclip, ALFRED is in the middle of it’s animation or whatever and is currently on frame 35. Nothing should happen. A second later, when ALFRED reaches frame 100 or “Rank1” ALFRED should stop();

on(rollOver){
if (_root.ALFRED._currentframe = “rank1”) {
_root.ALFRED.stop();
}
}

Doesn’t work. Instead, when you roll your mouse over it, it stops ALFRED on whatever frame ALFRED happens to be on. Replacing “rank1” with frame “100” yields the same result.

Help anyone?

use “=” to assign a value

use “==” to check a value

on(rollOver){
if (_root.ALFRED._currentframe == "rank1") {
_root.ALFRED.stop();
}
}

Firstly, this:
if (_root.ALFRED._currentframe = “rank1”)

Should be
if (_root.ALFRED._currentframe == “rank1”)

A single = mean you are setting a value not checking for equality.

Secondly, it might be easier to do something like:

on ALFRED frame 100:

if (pauseme){
stop();
}else{
//what ever else alfred should do if the button has not bee rolled over.
}

on the button:
on (rollOver){
_root.ALFRED.pauseme = true;
}

that way alfred will keep going till 100 and stop cause pauseme will be true, but only true is the button has been rolled over.

[FONT=Courier New][LEFT][COLOR=#0000ff]on[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
if [COLOR=#000000]([/COLOR][COLOR=#0000ff]_root[/COLOR].[COLOR=#000080]ALFRED[/COLOR].[COLOR=#0000ff]_currentframe[/COLOR] == [COLOR=#ff0000]“rank1”[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
root.[COLOR=#000080]ALFRED[/COLOR].[COLOR=#0000ff]stop[/COLOR]COLOR=#000000[/COLOR]
}
[/LEFT]

[/FONT]

ALFRED does not stop when mouseOver with the above script.

That’s because this:
on(rollOver){
if (_root.ALFRED._currentframe == “rank1”) {
root.ALFRED.stop()
}

is only checking to see if alfred is on that frame at the time of the rollover, it does not continue to check while the mouce is on top of the button. So if alfred is not on that exact frame when you roll over the button, then n othing is going to happen.

That’s why I suggested the other method.

Got ya. Thanks a bunch guys.