A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: come frome right, leave from left

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    25

    come frome right, leave from left

    Hi!
    I'd like in this example, when I pres one button , the circle that is already on the stage , leave from left (suppose -50 on x axis) and when it reach the -50 on x, then go to 810 again (so it is ready to come from left again).


    Maybe I didn't explained well, but if u see the fla, I think you'll understand quickly what I mean...
    thnx for any help

    chris
    Attached Files Attached Files

  2. #2
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    Attach this code to the clip:

    Code:
    onClipEvent(load){
      xspeed = 5; //speed of the clip
    }
    onClipEvent(enterFrame){
      if(_root.movetoleft){ //if the variable is true
        _x -= xspeed; //move the clip to the left
        if(_x <= -50){
          _x = 810;
          _root.movetoleft = false;
        }
      }
    }
    And on a button:

    Code:
    on(release){
      _root.movetoleft = true;
    }
    XFM

  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    25
    thnx for your reply
    even if it seems not to work ..

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