A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Image scroll boundaries - what am I doing wrong?

  1. #1
    Junior Member
    Join Date
    Nov 2010

    Image scroll boundaries - what am I doing wrong?

    Okay, so i've been trying to solve this for an hour now and I have to resort to a forum post. I don't understand why this isn't working.
    I have two background images that scroll up,right,left and down with arrow keys. They also scroll to the left while no arrow keys are being used.
    What I want is the background images to reach a boundary, so the player never leaves the background image and sees the stage.
    My background image x,y coordinates by default are: x(223.0), y(272.4)

    Just to see if my condition works, I have it move the wisp(player). However, even in the debug screen when it shows the Y coordinate of backround image go below 170, it never moves the wisp.

    if (backgroundimage._y<170){

    What could I possibly be doing wrong?

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Either that if statement isn't getting called, backgroundimage never goes below 170, or the statement controlling the wisp isn't working.

    You can use trace statements to figure this stuff out.

    Put a trace statement right before that if statement so you know it's being called, what the y is and if your wisp controller is working (will show you "undefined" if it isn't):

    trace("if statement being called - backgroundimage._y = " + backgroundimage._y + "  wisp._x = " + wisp._x);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center