Jump to content


Photo

Move to x and y position and stop


  • Please log in to reply
1 reply to this topic

#1 speaktobrett

speaktobrett

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 04 October 2008 - 01:00 AM

Hi guys,

I'm relatively new to actionscript x and y positioning.. and i was wondering how i would go about: after clicking a button, moving to a specific x and y axis and stopping?
I am unsure on the coding that i would use..

help would be much appreciated!!

Cheers, Brett

Edited by speaktobrett, 04 October 2008 - 01:02 AM.


#2 Jay.

Jay.

    Young Padawan

  • Members
  • Pip
  • 70 posts
  • Gender:Male
  • Location:Latinoamérica yeah!!!

Posted 06 October 2008 - 02:13 PM

try this

import mx.transitions.Tween;
import mx.transitions.easing,*;

function moveOnx(){
var myTween :Tween = new Tween(myObject, "_x", Strong.easeOut,100,350,1,true);
myTween.onMotionFinished = function(){
myTween.stop();
}
}

then just type the function inside the onRelease event of the button.

Hope this helps

Edited by Jay., 06 October 2008 - 02:13 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users