There is something wrong with this…
WHAT?!
OnClipEvent(load){
if (this.hitTest(_root.coll)){
gotoAndPlay(2)
}}
PS I am using FLASH 5:
There is something wrong with this…
WHAT?!
OnClipEvent(load){
if (this.hitTest(_root.coll)){
gotoAndPlay(2)
}}
PS I am using FLASH 5:
I have no idea what you are trying to create with that script but…
Make sure that the code is on the movieclip which collision is being detected!
Make sure “coll” is one the main timeline!
Make sure if you need anything in front of gotoAndPlay(); like _root. or something because it will go and play frame 2 inside the movieclip that collision is being detected!
And finally I think this is the problem
Change onClipEvent(load) {} to onClipEvent(enterFrame) {}
onClipEvent(load) will execute the actions within it once the movieclip has appeared on the stage but onClipEvent(enterFrame) will trigger the actions yourfps/second! So if your fps is 20 it will trigger the actions 20 times in a second! So it detects the collision every moment not just in the beginning!
One of thses has got to be the problem!:pirate:
onClipEvent is case senitive. (you have OnClipEvent)
be aware that load events occur before internal frame events. So if you have a stop() on frame 1 of this movieclip, it will be called AFTER this load script so if that clip is hittesting true on coll, then it will gotoAndPlay on frame 2 then run the stop() call in frame 1 of the clip if it exists. Not exactly a problem with that code, but the problem has the potential to exist.
Might wnana change this:
onClipEvent(enterFrame)
Instead of load…
Cause it’ll just laod the movieclip… Execute that line of code… And that’s it… If you wnat it to loop around and everytime it enters the fraem. Chekc to see if it hitTest’s… use the enterFrame command…
Peace
Ok… If I type gotoAndPlay(2) it will play the 2nd frame of the timelin.
So, how do you make it play 2nd frame in the main timeline?:hangover:
it’s _root.gotoAndPlay();
OK… What’s wrong with this?
:: Copyright KIRUPA 2024 //--