View Full Version : help please
KIERIOSHIMOTO
July 8th, 2005, 07:45 AM
can somebody please help me with this code, it wont add the points to the box
if (red.hitTest(_root.blue) and attach != "" and drag == true) {
_root.tackle += 1;
}
Blackspirit
July 8th, 2005, 07:56 AM
umm, _root.tackle.text += 1; ?
That might give you wierd results though like 1 + 1 = 11
KIERIOSHIMOTO
July 8th, 2005, 08:08 AM
what? .text? wtf? do u know how i cant make the defender close in on my controlled guy?
KIERIOSHIMOTO
July 8th, 2005, 08:09 AM
i mean can i make him move towards the guy
Blackspirit
July 8th, 2005, 09:39 AM
when your targeting a text field, yes you need the .text.
To get a defender to move towards your guy you'll have to check if the defenders x and y position against your guys x/y.
Start pseudo code:
If(defender.x > yourGuy.x)
defender.x--
else
defender.x++
if(defender.y > yourGuy.y)
defender.y--
else
defender.y++
Edit: You can edit your old posts with the edit button, theres no point posting a new one a minute after the old. :)
KIERIOSHIMOTO
July 8th, 2005, 10:21 AM
when your targeting a text field, yes you need the .text.
To get a defender to move towards your guy you'll have to check if the defenders x and y position against your guys x/y.
Start pseudo code:
If(defender.x > yourGuy.x)
defender.x--
else
defender.x++
if(defender.y > yourGuy.y)
defender.y--
else
defender.y++
Edit: You can edit your old posts with the edit button, theres no point posting a new one a minute after the old. :)
sorry dude im pretty new
KIERIOSHIMOTO
July 8th, 2005, 10:27 AM
I tried the text thing and it didnt work
Blackspirit
July 8th, 2005, 11:46 PM
hehe, the text thing doesn't work? hmm the text box is called _root.tackle? And its dynamic?
You could just increment a variable, and the have the text boxes "var:" property point to it.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.