Blinger1
18-02-2009, 12:52 PM
What is wrong with my code?
onClipEvent (load) {
var weaponz = 0;
var taken = 0;
}
onClipEvent (enterFrame) {
// make the weapon
if (taken == 0) {
_root.weapon.duplicateMovieClip("weapon"+weaponz,weaponz);
eval("_root.weapon"+weaponz)._x = 161;
eval("_root.weapon"+weaponz)._y = 280;
taken == 1;
}
// a basic hittest
if (this.hitTest(_root.ball)) {
this.removeMovieClip();
}
}It kind of works, it will draws the item i need drawn but then nothing else happens?
I need it so it only draws ONE box, not an infinite ammount..
I thought if i change the "taken == 1" to "taken = 1" it would work, but it always shows "0 0 1 0 1 0" in the output (a space represents a new line)..
+ rep to whoever helps
:)
onClipEvent (load) {
var weaponz = 0;
var taken = 0;
}
onClipEvent (enterFrame) {
// make the weapon
if (taken == 0) {
_root.weapon.duplicateMovieClip("weapon"+weaponz,weaponz);
eval("_root.weapon"+weaponz)._x = 161;
eval("_root.weapon"+weaponz)._y = 280;
taken == 1;
}
// a basic hittest
if (this.hitTest(_root.ball)) {
this.removeMovieClip();
}
}It kind of works, it will draws the item i need drawn but then nothing else happens?
I need it so it only draws ONE box, not an infinite ammount..
I thought if i change the "taken == 1" to "taken = 1" it would work, but it always shows "0 0 1 0 1 0" in the output (a space represents a new line)..
+ rep to whoever helps
:)