PDA

View Full Version : simple variable problem (i hope)


system16
04-27-2007, 06:30 PM
hi, im making a simple rpg game in flash and having trouble getting a variable to change on an event.

the command to change is on a frame within a movie clip and the variable is on a frame within a different movie clip. i've used absolute target paths so there should be no way flash is missing the right variable. anyway here's the code:

_root.movieclip1_mc.movieclip2_mc.enemyhealth -= 20;

ive got a trace in there to see if the value changes but it doesnt. hopefully im being dumb and this can be fixed. thanks for any help!

xxneon
04-27-2007, 06:40 PM
when you trace it are you tracing it from the frame you are trying to change the value?

system16
04-27-2007, 07:06 PM
tracing it from the frame which tells the variable to change and it comes up with the same number each time (60). basically on the characters attack animation the frame should tell the enemies health variable to -= 20. and the enemy has an if statement which should play his death animation when his life is 0 or less. so 3 attacks should cause his death animation to play

xxneon
04-27-2007, 07:25 PM
i'd have to see some code to see where the conflict is..