Forum Topic: ground has forsacken me : (

(102 views • 5 replies)

This topic is 1 page long.

<< < > >>
Sad

junipe

Reply To Post Reply & Quote

Posted at: 7/22/08 05:56 PM

junipe LIGHT LEVEL 07

Sign-Up: 10/02/07

Posts: 358

for(i=0; i<2; i++){
if(_root["ground"+i].hitTest(_x, _y, true)){
//code Here
}
}

hi, im making a game and im having some trouble the action script above is for my ground platform movie clips but i keep getting a comlpier error it describes it as "Statement must appear within on/onClipEvent handler" and the problem is in the first row "for(i=0; i<2; i++){" i have little knowledge of action script so i was only able to do little but to no prevale. can anyone out there help me?

feel odd... feel very odd

BBS Signature

None

Dad00

Reply To Post Reply & Quote

Posted at: 7/22/08 05:58 PM

Dad00 LIGHT LEVEL 04

Sign-Up: 05/30/07

Posts: 634

use this

onClipEvent (enterframe) {
//ure code here
}

pm me for any coding help

MY website www.gamingrounds.co.uk (under construction) As:Main
I now do games/website for people very cheaply!!! for more info pm me


None

junipe

Reply To Post Reply & Quote

Posted at: 7/22/08 06:32 PM

junipe LIGHT LEVEL 07

Sign-Up: 10/02/07

Posts: 358

At 7/22/08 05:58 PM, Dad00 wrote: use this

onClipEvent (enterframe) {
//ure code here
}

pm me for any coding help

no luck, the same thing is happening

feel odd... feel very odd

BBS Signature

None

Afflict

Reply To Post Reply & Quote

Posted at: 7/22/08 06:34 PM

Afflict NEUTRAL LEVEL 07

Sign-Up: 08/05/06

Posts: 111

Yes after applying previous advice, make sure your putting the code on a movie clip.


None

junipe

Reply To Post Reply & Quote

Posted at: 7/22/08 06:37 PM

junipe LIGHT LEVEL 07

Sign-Up: 10/02/07

Posts: 358

At 7/22/08 06:34 PM, Afflict wrote: Yes after applying previous advice, make sure your putting the code on a movie clip.

yes its deffinitly a movieclip

feel odd... feel very odd

BBS Signature

None

Disarray-yarrasiD

Reply To Post Reply & Quote

Posted at: 7/22/08 09:27 PM

Disarray-yarrasiD DARK LEVEL 09

Sign-Up: 11/14/04

Posts: 1,474

MovieClips in flash 8 require an onClipEvent Method to function. If you are using flash 8 then Afflict defeniatly has the right idea.

In flash 9, all code must go on the frame and complex instances are not strictly permitted for movieClips (no _root["name"+id]).

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 08:32 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!