as 2.0 motion tween

  • triad boy
  • Born
  • Born
  • triad boy
  • Posts: 2

Post 3+ Months Ago

Hi there people

I have created an image scroller that reacts to the position of your mouse on the stage using the tween class.

I would now like to modify it so it scrolls left to right smoothly without the need to react with the mouse.

Any tips much appreciated

Triad

Here is my code:

Code: [ Select ]
onClipEvent (load)
{
   xcenter=327;
   speed=1/60;
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x+=(distance*speed);
   if (_x > 0.3) _x=-3278.3;
   if (_x < -3278.3) _x=0.3;
}
 
  1. onClipEvent (load)
  2. {
  3.    xcenter=327;
  4.    speed=1/60;
  5. }
  6. onClipEvent (enterFrame)
  7. {
  8.    var distance=_root._xmouse-xcenter;
  9.    _x+=(distance*speed);
  10.    if (_x > 0.3) _x=-3278.3;
  11.    if (_x < -3278.3) _x=0.3;
  12. }
  13.  


triad promotional merchandise

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 5 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.