0 Replies Latest reply on Jun 1, 2006 3:10 AM by JJsnake

    Play specific frame in relation to X and Y

      Hello i'm relatively new to Flash and although getting quite familiar with the environment i'm still pretty much a big ignoramus when it comes to actionscript. Appologies if sililar to this has been posted before, I did a search (and have been searching the net all day!)

      I have a stop frame animated head with most of frames done in various movements (at the moment they're JPGs, but if I can get this to work I'll convert to vector). I thought it'd be cool when the user is mousing around the top and right side of the head for the head to move in the cursors direction and look at it. Once the cursor is on top of the head it plays in reverse, back to the start. So I have the frames for this movement now (42 in various positions) and the closest i've come to achieving what I need is from using this:


      xlow = 300
      xhigh = 450
      gotoAndStop(Math.ceil((Math.min(Math.max(_root._xmouse,xlow),xhigh-1)-xlow+1)/(xhigh-xlow) *10))

      This works ok for just looking right (frames 1-10), but I've been useless at adapting this so far, and am not even sure if this it is what I need for the whole thing. I can't work out how to make it work on the y axis simultaneously.

      So all in all I need to tell flash to play a specific frame depening on the X and Y of the cursor and when the user mouses over the face the movie must play from wherever it was stopped.

      An added bonus would be something like a variation in animation speed - speedy at first and slowing as it reaches the target. However I'd be much more than happy to just get the basics down at the moment though.

      If none of this makes any sense I can supply the source file, but until I covert all the graphics to vector the file is big (8 Mb).

      If anyone can give me any help or a nod in the right direction I'd be your new best friend,