Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the _x or _y value in actionscript 1

Status
Not open for further replies.

mikewza

Technical User
Nov 3, 2006
5
GB
I want to use a button to change the _x and _y value of a symbol by 5 each time the button is pressed. I can change the value by using setProperty but only to a definite value. I have tried ++ and +5 but that is not working. What do i need to do??
 
Thanks, that works a treat. Any chance you know how to make the code repeat as long as the mouse is over the button or would i have to embed the button in its own movieclip and set it to loop?
 
Something like...
Code:
//On the button...

on(press){
    _level0.moveX = true;
}
on(release){
    _level0.moveX = false;
}

//And on the symbol itself...

onClipEvent(enterFrame){
    if(_level0.moveX == true){
        _x +=5;
    }
}

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top