Skip to main content
Inspiring
December 9, 2007
Question

I need an if statement to check the x position of an object

  • December 9, 2007
  • 2 replies
  • 316 views
How would i make an if statement that checks if the x position of an object is say, 10, and if it is fires off a function

Thank you
This topic has been closed for replies.

2 replies

J_RockerAuthor
Inspiring
December 9, 2007
well, not really. i've got a couple of tweens that respond to buttons. When the button is clicked, i want the script to check to see if the X value is in the wrong position, and if it is i want to activate the tween to correct it.

Thank you kglad ;} any ideas?
kglad
Community Expert
Community Expert
December 10, 2007
then just use an if-statement in your button handler function.
kglad
Community Expert
Community Expert
December 9, 2007
you'll probably need a loop to repeatedly check the x property of your object. if so, use the timer class or the ENTER_FRAME event of a display object with your if-statement.