3 Replies Latest reply: Apr 26, 2012 7:26 AM by Ned Murphy RSS

    Array and moving a object???

    LukeElChul Community Member

      I want so when i make worker it moves to a object called Garrison.

       

       

       

      import mx.transitions.Tween;

      import mx.transitions.easing.*;

       

       

      workers = new Array();

      tag=0;

       

       

      function CreateWorker(){

                worker = _root.attachMovie("worker","worker" +tag, tag,{_x:55,_y:55})

      worker.gotoFunction = GarrisonPoint();

      workers.push(worker);

                          tag++;

      }

      function GarrisonPoint(){

                var t1:Tween = new Tween(this, "_x", None.easeNone, this._x, _root.Garrison, 10, true);

          var t2:Tween = new Tween(this, "_y", None.easeNone, this._y, _root.Garrison, 10, true);

      }

       

      Help?