In AS3 I am trying to have my background scroll horizontally when the mouse is on the right side of the stage. (My background instance is called “bp”.)
This isn’t working:
while (mouseX > 600)
{bp.x -= 2;}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Flash user interface is updated frame-by-frame, and should not be blocking such as your while loop implementation.
Every frame, you can test mouseX position and determine how much to scroll your background.
Here’s an example implementation: