Log in

View Full Version : This is insane, i need help!



Elan
03-11-2009, 10:02 PM
Okay, im feeling that im getting good at as now, but this is just wierd
im creating this shooting game, where you can upgrade your weapon
so to test the function, i made 3 buttons, and a character who shoots.
made all the codes, and told him to shoot bullet 1 when bullet1 variable is true and so on.

but when i tell the button:
on(release){
_root.bullet1 == true;
}

the variable doesnt turn true. it stays false :S
i dont understand anything now
ive tried with one = to.

what im i doing wrong?
i thought i knew this by now : /

Elan
03-12-2009, 03:00 PM
Resolved!
needed to call the variables with _global

Medyman
03-13-2009, 03:43 AM
It's not necessarily wrong to be using _root or _global, but if you find yourself using it too much, it's probably indicative of larger problems in your code. It shouldn't cause trouble with your code, but it's important to understand what is implied by that keyword. This article (http://www.gskinner.com/blog/archives/2005/03/to__root_or_not.html) by Grant Skinner explains the implications of _root (the same logic applies to _global.