Problems getting my movie to "stop"

I am starting to get really pi$$ed off with Flash today, I found a bug which wasted me HOURS of time and even now I still can’t get it to work properly.

I have the following code attached to a button within a movie clip with the named instance “mainb”:


on (rollOut) {
	_root.main.mainb.roll = true;
}
on (releaseOutside, rollOut) {
	_root.main.mainb.roll = false;
}

on the movie clip “mainb” I have the following code:


onClipEvent (enterFrame) {
	if (roll==true && _root.main._currentframe>710) {
		_root.main.stop()
	}
	if (roll==false && _root.main._currentframe>710) {
		_root.main.play()
	}
}

now in my mind this should stop the movie of “_root.main” playing if the button is rolled over & _root.main movie playhead is in a frame higher than 710.

But, needless to say, it doesn’t work. Why is this?

the paths are RIGHT I used the crosshairs to locate them from _root. I tried doing it relatively (ie. _parent etc.) but this didn’t work either.

Please help!

Flash has a problem dealing with nested Mouse Actions, actually the problem is that it doesn’t deal with them. So if there is a Mouse action on ANY of the parent MC’s the child actions are completely ignored. So that MIGHT part of your problem. A fix for that would be to use hitTest (do a search). You might want to check if the functions are being executed at all; by using the trace function–it’s a beauitiful thang.

ok thanks.

Using hitTest I can get the movie to stop:


onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true) & _root.main._currentframe>710) {
		_root.main.stop()
	}
}

I have no idea how to get it to play again when they roll off the movie which is what I need.

Any ideas?

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) & _root.main._currentframe>710) {
_root.main.stop()
}else{
_root.main.play();
}
}