A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: moving along x or y using as

  1. #1
    Senior Member vladdddd's Avatar
    Join Date
    Aug 2004
    Location
    in space
    Posts
    352

    moving along x or y using as

    Hi guys!

    i was wondering if you can help me.. as u can see in the fla attached i m trying to use buttons to move the 2 green and blue boxes along x or y axis; problem is i cand make them move individualy, they both move at 1 click in the same dierction..

    i need to assign actions to a set of btns to move only 1 box, and actions to other set of btns which move the orhet box..

    Hope i am clear enough,

    Thank you!
    Attached Files Attached Files

  2. #2
    Senior Member vladdddd's Avatar
    Join Date
    Aug 2004
    Location
    in space
    Posts
    352
    btw its as2 i need

  3. #3
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    PHP Code:
    //On movieclip
    onClipEvent (enterFrame) {
        
    this._y += (_root.ypos-this._y)/5;
    }
    //I changed it to
    //On movieclip
    onClipEvent (enterFrame) {
        
    this._y += (this.ypos-this._y)/5;

    PHP Code:
    on(release){_root.ypos=29;}
    //I changed it to
    on(release){blue.ypos=29;}
    //I made the 2 original buttons control the blue square and I added a second
    //set of buttons to control the green square and in the code for the second
    //set of buttons I just changed blue.ypos to green.ypos 
    Attached Files Attached Files

  4. #4
    Senior Member vladdddd's Avatar
    Join Date
    Aug 2004
    Location
    in space
    Posts
    352
    Hi and thanks!

    I made the same thing earlyer, it seemed obvious but it didnt work for me :/

    anyway i managed to do it a bit different.

    Here s the fla for whoever is interested

    Thanks alot!
    Attached Files Attached Files
    • File Type: fla 1.fla (53.0 KB, 31 views)

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