Jump to content


movie clip returns to original position


  • You cannot reply to this topic
5 replies to this topic

#1 getoffmyland

    Young Padawan

  • Members
  • Pip
  • 78 posts
  • Location:UK

Posted 13 December 2005 - 05:40 PM

Hello there,

I have an image that follows the cursor on its x-axis only, but when the cursor isnt on the stage i want the image to return to a pre-defined position. Its some decoration for a flash nav on a website.

Heres the code..

ball_mc.onEnterFrame = function() {
var xMouse = _root._xmouse;
if (Math.abs(xMouse-this._x)<1) {
this._x = xMouse;
} else {
this._x -= (this._x-xMouse)/6;
}
};


All help appreciated.

Merry Christmas!

#2 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 17 December 2005 - 09:09 AM

post the fla file or mail it to me

#3 getoffmyland

    Young Padawan

  • Members
  • Pip
  • 78 posts
  • Location:UK

Posted 18 December 2005 - 02:08 PM

Hi,

.fla is attached. Thankyou for your help.

Matt

#4 getoffmyland

    Young Padawan

  • Members
  • Pip
  • 78 posts
  • Location:UK

Posted 18 December 2005 - 02:11 PM

i attached the file but i cannot see where it can be accessed??

what is your email address, i will email it to you.

matt

#5 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 22 December 2005 - 03:37 PM

hey matt.. I was just playing around with almost the same thing and I came up with this solution:

var left:Number = 0; //left stage boundary
var top:Number = 0; //top stage bounday
var right:Number = Stage.width;//right stage boundary
var bottom:Number = Stage.height;//bottom stage boundary

now you just need to re-write your actionscript so it reacts on the variables

Edited by funkysoul, 22 December 2005 - 03:38 PM.


#6 getoffmyland

    Young Padawan

  • Members
  • Pip
  • 78 posts
  • Location:UK

Posted 12 January 2006 - 01:17 PM

thanks funkysoul,

my knowledge of actionscript is quite limited, could you elaborate on what your code does, where it goes etc.

I cut and paste it into my script and tweaked the values but nothing changed.

thanks

matt





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users