Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: health bar problem

(83 views • 9 replies)

This topic is 1 page long.

<< < > >>
Crying

BloodSucker150

Reply To Post Reply & Quote

Posted at: 5/10/08 01:06 PM

BloodSucker150 LIGHT LEVEL 06

Sign-Up: 03/20/08

Posts: 298

i wrote this:
-code:

if(_root.player.hitTest(_root.enemy)){
_root.hpbar.nextFrame()
}

-------------------

ant when i hitTest in the enemy nothing happens

what to do??
plz help me!


None

Coaly

Reply To Post Reply & Quote

Posted at: 5/10/08 01:14 PM

Coaly FAB LEVEL 20

Sign-Up: 08/11/04

Posts: 2,470

At 5/10/08 01:06 PM, BloodSucker150 wrote: if(_root.player.hitTest(_root.enemy)){
_root.hpbar.nextFrame()
}

Well there are a few things that you could be doing wrong. Make sure that the enemy has the instance name enemy and that the player has the instance name player, and that the health bar has the instance name hpbar. Also tell us where your code is, and make sure that the three movieclips are on the main timeline. And make sure your health bar has more than one frame to go to, it could happen...

profile | pm me | sig by bomtumes

BBS Signature

None

El-Presidente

Reply To Post Reply & Quote

Posted at: 5/10/08 01:14 PM

El-Presidente LIGHT LEVEL 23

Sign-Up: 06/02/05

Posts: 4,280

Do you have it within an onEnterFrame function. Are the instance names correct? Are you 100% sure that you've done everything correctly? Where are you putting this code?

Some more information might be nice.

MY E-PENIS IS BIGGER THAN YOURS
8=================================>
AS: Main || AS3: Main || FAB: Warning! Only for real men.

BBS Signature

None

BloodSucker150

Reply To Post Reply & Quote

Posted at: 5/10/08 02:06 PM

BloodSucker150 LIGHT LEVEL 06

Sign-Up: 03/20/08

Posts: 298

ALLTHE INTANCE NAMES ARE OK
but
maybe it's beacuse i put the hpbar in the player movie clip for following


None

El-Presidente

Reply To Post Reply & Quote

Posted at: 5/10/08 02:09 PM

El-Presidente LIGHT LEVEL 23

Sign-Up: 06/02/05

Posts: 4,280

At 5/10/08 02:06 PM, BloodSucker150 wrote: maybe it's beacuse i put the hpbar in the player movie clip for following

Oh that would have been nice to know...that means:

_root.player.hpbar.nextFrame();

MY E-PENIS IS BIGGER THAN YOURS
8=================================>
AS: Main || AS3: Main || FAB: Warning! Only for real men.

BBS Signature

Crying

BloodSucker150

Reply To Post Reply & Quote

Posted at: 5/10/08 02:36 PM

BloodSucker150 LIGHT LEVEL 06

Sign-Up: 03/20/08

Posts: 298

nop stil don't working....


None

BloodSucker150

Reply To Post Reply & Quote

Posted at: 5/10/08 02:38 PM

BloodSucker150 LIGHT LEVEL 06

Sign-Up: 03/20/08

Posts: 298


None

Coaly

Reply To Post Reply & Quote

Posted at: 5/10/08 02:40 PM

Coaly FAB LEVEL 20

Sign-Up: 08/11/04

Posts: 2,470

if(_root.player.hitTest(_root.enemy)){
_root.player.hpbar.nextFrame()
}

if that isn't working and the bar is in the player, than you have not named them correctly, or are not giving us enough information, both of us asked where the code is.

Also, don't fucking double post saying the same thing within two minutes. You are doing something wrong and you haven't given us enough information to be able to know what it is.

profile | pm me | sig by bomtumes

BBS Signature

None

El-Presidente

Reply To Post Reply & Quote

Posted at: 5/10/08 02:43 PM

El-Presidente LIGHT LEVEL 23

Sign-Up: 06/02/05

Posts: 4,280

Just to specify, like Coaly said, you're 100% that this is the EXACT code you have within the MAIN TIMELINE:

function onEnterFrame () {
    if(_root.player.hitTest(_root.enemy)){
        _root.player.hpbar.nextFrame();
    }
}

If you can't get it then, just send the .fla, because clearly you don't have the instance names in correctly. Instance names are the things when click the object and go to the properties panel, it says <Instance Name> and you type it in.

MY E-PENIS IS BIGGER THAN YOURS
8=================================>
AS: Main || AS3: Main || FAB: Warning! Only for real men.

BBS Signature

None

BloodSucker150

Reply To Post Reply & Quote

Posted at: 5/11/08 07:14 AM

BloodSucker150 LIGHT LEVEL 06

Sign-Up: 03/20/08

Posts: 298

At 5/10/08 02:43 PM, El-Presidente wrote: Just to specify, like Coaly said, you're 100% that this is the EXACT code you have within the MAIN TIMELINE:

function onEnterFrame () {
if(_root.player.hitTest(_root.enemy)){
_root.player.hpbar.nextFrame();
}
}

If you can't get it then, just send the .fla, because clearly you don't have the instance names in correctly. Instance names are the things when click the object and go to the properties panel, it says <Instance Name> and you type it in.

i know what is <Instance Name> XD but
i try to write it in the enemy code and it's work now so never mind...


All times are Eastern Daylight Time (GMT -4) | Current Time: 09:57 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!