A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Drag MC out

  1. #1
    Junior Member
    Join Date
    Dec 2011

    Drag MC out

    I tried this tutorial
    and thats what I exactly wanted but I additionally want that if the MC is in its right place (in this tutorial on the right hand side) I want to be able to put it back to the place it was at the very beginning.
    how can I do that?


  2. #2
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Planet Earth
    you would have to store the original x and y values somewhere. then whenever you want to move it back to the beginning, you can lookup those original values again...

    Actionscript Code:
    var origX:Number = 10;
    var origY:Number = 10;

    function resetObject():void {
        object.x = origX;
        object.y = origY;

    hopefully you can use that as an example and make it work for all the objects you want to put back to the beginning
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.

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