PDA

View Full Version : Unable to solve Error message - on/onclipevent



stockdill
March 26th, 2004, 03:32 AM
Hi – I have made up a snakes and ladders drag and drop board to use with interactive whiteboard in my class. It is only 2 frames, one with the intro and the other with the board.
The squares with snakes or ladders are movieclips (target1, target2 etc). The contestant images are movieclips. Which drag and drop, when they hit the target they move.
It was working fine, but now every time I test it I get the following error message. I don’t know how to solve it as I have looked everywhere.

Scene=Scene 1, Layer=Layer 1, Frame=2: Line 1: Statement must appear within on/onClipEvent handler
stop();

I’ll try to attach the fla but last time it didn’t work, so I’ll give some of the code below.

On the 2nd Frame I have stop();

On each contestant movieclip I have
on (press) {
_root.player2.startDrag();
_root.player2.swapDepths(100);
}
on (release) {
_root.player2.stopDrag();
if (_root["player2"].hitTest(_root["targetone"]))
_root.player2._y -=80;
if (_root["player2"].hitTest(_root["targettwo"]))
_root.player2._y -=80;
if (_root["player2"].hitTest(_root["targetthree"]))
_root.player2._x +=90,_y +=80;
if (_root["player2"].hitTest(_root["targetfour"]))
_root.player2._y -=90;
if (_root["player2"].hitTest(_root["targetfive"]))
_root.player2._x +=80,_y +=80;
if (_root["player2"].hitTest(_root["targetsix"]))
_root.player2._y +=80;
if (_root["player2"].hitTest(_root["targetseven"]))
_root.player2._x +=80, _y +=80;
if (_root["player2"].hitTest(_root["targeteight"]))
_root.player2._x -=130, _y +=80;
if (_root["player2"].hitTest(_root["final"]))
_root.final.gotoAndPlay(2);
}


I have no actions applied to any of the snakes and ladders squares ( movieclips) , apart from the final one (called final) which simply is stop();

I really hope someone can help.
Lesley

Ubik
March 26th, 2004, 07:35 AM
it would be helpful to see your fla, you can upload it to your server.
Your stop () isn't placed at the good place (it is on a mc not on a frame ?), that's why you have to put it in an onClipEvent

Ubik

stockdill
March 26th, 2004, 12:33 PM
Hi i wrote before about a problem error message which i cab't solve.

The message is

Scene=Scene 1, Layer=Layer 1, Frame=2: Line 1: Statement must appear within on/onClipEvent handler
stop();


I have uploaded the fla to my website. I would be really grateful if someone could tell me where I am going wrong.
To see the fla, go to this page and scroll down. It is a game of snakes and ladders.
my site (http://www.reviseonline.co.uk/contactme.htm)

Here is the AS i have used below.

On the 2nd Frame I have stop();

On each contestant movieclip I have
on (press) {
_root.player2.startDrag();
_root.player2.swapDepths(100);
}
on (release) {
_root.player2.stopDrag();
if (_root["player2"].hitTest(_root["targetone"]))
_root.player2._y -=80;
if (_root["player2"].hitTest(_root["targettwo"]))
_root.player2._y -=80;
if (_root["player2"].hitTest(_root["targetthree"]))
_root.player2._x +=90,_y +=80;
if (_root["player2"].hitTest(_root["targetfour"]))
_root.player2._y -=90;
if (_root["player2"].hitTest(_root["targetfive"]))
_root.player2._x +=80,_y +=80;
if (_root["player2"].hitTest(_root["targetsix"]))
_root.player2._y +=80;
if (_root["player2"].hitTest(_root["targetseven"]))
_root.player2._x +=80, _y +=80;
if (_root["player2"].hitTest(_root["targeteight"]))
_root.player2._x -=130, _y +=80;
if (_root["player2"].hitTest(_root["final"]))
_root.final.gotoAndPlay(2);
}

lesley

kode
March 26th, 2004, 02:05 PM
...Merged threads. There's no need to start a new one, stockdill. ;)