A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: question using arrow buttons

  1. #1
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540

    question using arrow buttons

    Hi, I've have this flash file which has a large graphic of a map. I have used the arrow buttons to allow one to view different areas of the map.

    This is my code:

    on(keyPress "<Left>") {
    _root.map_mc._x+=15;
    updateAfterEvent();
    }

    Problem is it does't have any params set to make it stop. So one could technically moving left indefinitely, with nothing to view but the bg. How can I tell it to stop at a certain point? I've tried getProperty, but alas, no such luck in making it work.

    Any ideas?

    Thanks and cheers!

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Code:
    on(keyPress "<Left>") {
    if(_root.map_mc._x < 500){ // only move if less than 500
    _root.map_mc._x+=15;
    updateAfterEvent();
    }
    }
    any help ??

  3. #3
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Perfect! Thanks!!

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