...

View Full Version : Hi.Need help with Flash Game



lana
04-12-2008, 07:40 PM
I am currently working on a basic Flash game for children. It involves spiders coming up onto the screen and there is a trigger that must hit the spiders. With every hit the score increases by 1.

i followed a tutorial to design the game but i keep getting 2 errors.


**Error** Symbol=balloonmove, layer=Layer 1, frame=2:Line 1: Clip events are permitted only for movie clip instances
onClipEvent (load) {

**Error** Symbol=balloonmove, layer=Layer 1, frame=2:Line 5: Clip events are permitted only for movie clip instances
onClipEvent (enterFrame) {

Total ActionScript Errors: 2 Reported Errors: 2



could someone please help:(

gnomeontherun
04-12-2008, 08:20 PM
Without knowing anything more about your code, it appears that you are using the wrong syntax for the type of object that you are applying the code to. So you should be putting that on a movieClip.

lana
04-12-2008, 09:08 PM
Yes so basically its saying that balloonmove should be a movieclip?..but it is a movie clip so i dont understand why it doesnt recognise this.

The game isnt that complicated im just new to this. Is there anything else that i could show you that might help it easier for you to help me ?

The game includes 3 movie clips and 2 buttons.Movie clips are

Movie clip ONE-"balloon" (which is a spider in my game)
this movie clip includes 3 layers

layer 1 -
4 keyframes -
1st KF shows the spider with the trigger on top of it (if clicked into this brings u into its up over down hit )
2nd KF shows the spider normal
3rd KF shows the spider cut in half (im guessin how he will apear if hit by the trigger)
4th KF - blank

Layer 2 - named actions
1st keyframe has
stop();
2nd has the same (stop)
3rd has the same (stop)
4th has
_parent.gotoAndPlay(3);

Layer 3 (Dummy Button)
appears to be same as layer 1

MOVIE CLIP 2 - Balloon Move (spider in my game, ive kept the tutorials names the same but will change them when i get the game working etc so will change it to spider moce...)

Includes 2 layers
layer 1
2 keyframes
1st KF is blank (has a + in middle of screen)
2nd KF shows the spider with trigger on top again (the balloon movie clip)
with these actiona applied to it


onClipEvent (load) {
_root.hitz = 0;
this._alpha = 0;
}
onClipEvent (enterFrame) {
this._y -= _root.speedz;
this._rotation += 7;
if (this._y<=-80) {
this._alpha = 100;
}
if (this._y<=-380 && _root.hitz == 0) {
gotoAndPlay(2);
_root.missed += 1;
_root.hitz = 1;
}
if (_root._currentframe == 3) {
_parent.nextFrame();
}
}

[close]

This is the code that is showing the 2 errors..

2nd layer is the actions layer
3 Keyframes
1st has stop action applied to it (nothing on stage)
2nd has stop action applied to it (balloon movie clip on stage)
3rd has [code] removeMovieClip(""); (nothing on stage)

3rd Movie clip - trigger
its just has one layer and one keyframe
the keyframe kust shows the trigger on the stage (which is a simple circular black dot)

the buttons includes the simple "click to play"
which is fone

the 2nd button is hit button
it just has one layer - up over down hit

the trigger only appears on the stage on the hit keyframe


lol does this help at all ?

jairusbondoc
04-13-2008, 03:28 PM
you put the "onClipEvent (enterFrame)" on the frame (that is not allowed).. don't put "onClipEvent (enterFrame)" on the frame. put it on a movieclip. F9 on the movieclip instance and paste the "onClipEvent (enterFrame)" code there.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum