A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Swapping x positions

  1. #1
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116

    Swapping x positions

    I really hope someone can help me with this, I've been trying to get it to work for 3 days and it's driving me CRAZY!!! What I have is 3 box MCs in a horizontal row, each has a button in it. What I'm looking for, is to be able to click a box and have it tween to the position of the left-most box, while the left-most box tweens to where the other box is coming from. I can get it to work a little, but I can't figure out how to have the second box trigger the box that is now in the left-most position to swap with it...it's driving me NUTS, and I've been looking for tutorials, but it's a hard thing to search for..if anyone has any advice whatsoever, I'd really appreciate it.

    Thanks, and I hope that made sense
    Adam

  2. #2
    Cheap Bear Imitation eRkLaErBaEr's Avatar
    Join Date
    Mar 2003
    Location
    Forests
    Posts
    308
    see the attached file, this should do it.
    there's just one little snag in it: if you trigger the buttons too fast, it can happen, that they remain on the same x position.
    Attached Files Attached Files
    Pink signature?


  3. #3
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    That is GREAT!!!! Thank you so much for your time, and help..I might be able to get some sleep tonight

    Thanks,
    Adam

  4. #4
    Cheap Bear Imitation eRkLaErBaEr's Avatar
    Join Date
    Mar 2003
    Location
    Forests
    Posts
    308
    lol great. sweetest dreams for you.
    Pink signature?


  5. #5
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    hey, cool script this is...
    btw, i found a small bug...(is this intentional? i dont know)
    when i clicked the middle box, during the time it moves to the left, if i clicked the rightmost box, the rightmost box goes over to the leftmost box, and voila! there's only 2 box in view!
    the same thing happens when i clicked the rightmost box, and if i clicked the middle box while it's moving, the middle box will go over the left box and there's only 2 box visible.
    It's only that one box always be on top on another, and there's no way of returning it back to 3 box-view

    just FYI i guess

    "Mr. Anderson, welcome back...we MISS you." - Agent Smith

  6. #6
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    I've been working on that for over an hour, can't seem to get a fix. I don't mind, eRkLaErBaEr has given me a huge head start. If I get it, I'll post the fix here in case you want to see it, but I wouldn't be holding your breath if I was you

    Adam

  7. #7
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    i'm holding my breath here...

    Go Adam!
    "Mr. Anderson, welcome back...we MISS you." - Agent Smith

  8. #8
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    Well, I hope your breathing by now, 'cause I'm lost with this, lol..tried everything I know - which is very limited - but to no avail....

  9. #9
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    *gasp* *gasp* *sputter*
    i'm turning blue for nothing...

    I really appreciate it though.
    Thanks Adam

    "Mr. Anderson, welcome back...we MISS you." - Agent Smith

  10. #10
    Senior Member
    Join Date
    Feb 2004
    Location
    California
    Posts
    174
    let me know if this works...
    Attached Files Attached Files

  11. #11
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    oops...
    are you using MX2004? i'm still using MX so its "invalid file format" for me...
    could you save it for MX?
    thanks

    "Mr. Anderson, welcome back...we MISS you." - Agent Smith

  12. #12
    Senior Member
    Join Date
    Feb 2004
    Location
    California
    Posts
    174
    yeah, no problem.
    Attached Files Attached Files

  13. #13
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    woo hoo
    this is good...even more, there's nothing here but AS...
    wicked!
    maybe i'll try to make it so that the leftmost boxes can also be swapped

    thanks
    "Mr. Anderson, welcome back...we MISS you." - Agent Smith

  14. #14
    Cheap Bear Imitation eRkLaErBaEr's Avatar
    Join Date
    Mar 2003
    Location
    Forests
    Posts
    308
    Originally posted by mbokjamu
    hey, cool script this is...
    btw, i found a small bug...(is this intentional? i dont know)
    when i clicked the middle box, during the time it moves to the left, if i clicked the rightmost box, the rightmost box goes over to the leftmost box, and voila! there's only 2 box in view!
    the same thing happens when i clicked the rightmost box, and if i clicked the middle box while it's moving, the middle box will go over the left box and there's only 2 box visible.
    It's only that one box always be on top on another, and there's no way of returning it back to 3 box-view

    just FYI i guess

    that's the snatch, i meant. the leftmost box receives it's new x position from the box clicked on. so when clicking a box "on the move", the leftmost gets x positions, which don't work with the script.

    edit: caramba rysolag, awesome scripting ... i don't get it, but it's working great (and without errors, not like mine ).
    Last edited by eRkLaErBaEr; 03-05-2004 at 06:34 AM.
    Pink signature?


  15. #15
    Senior Member
    Join Date
    Feb 2004
    Location
    California
    Posts
    174
    yeah it's sort of sloppy...what don't you get?

  16. #16
    Cheap Bear Imitation eRkLaErBaEr's Avatar
    Join Date
    Mar 2003
    Location
    Forests
    Posts
    308
    your script ... too much maths, i'm not that clever.
    Pink signature?


  17. #17
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    Thanks, rysolag for another idea on how to do this, now I'm more lost than before Thanks to the both of you for great directions to go in.

    Adam

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