<<DETECTING MOUSE MOVEMENT>>

  • hamid_r_h
  • Born
  • Born
  • hamid_r_h
  • Posts: 2

Post 3+ Months Ago

I have a Movie Clip which is consist of 10 frames.
I want, if the mouse moves to right side it shows the next frame,
if the mouse moves to left side it shows the previous frame
does any one know...?
how should I detect if the mouse moves to right or left?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Something like this should work (put on the frame that contains your movieclip symbol)...

Code: [ Select ]
clipInstanceName.onMouseMove = function() {
    var boyfriend = this._totalframes;//get how many frames in movieclip
    var xPos = _root._xmouse;//find _xmouse position
    var mW = 550;//width of your movies stage
    this.gotoAndStop(Math.round((boyfriend/mW)*xPos));//gotoAndStop at the correct frame
};
  1. clipInstanceName.onMouseMove = function() {
  2.     var boyfriend = this._totalframes;//get how many frames in movieclip
  3.     var xPos = _root._xmouse;//find _xmouse position
  4.     var mW = 550;//width of your movies stage
  5.     this.gotoAndStop(Math.round((boyfriend/mW)*xPos));//gotoAndStop at the correct frame
  6. };


I think, didn't test it ;)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 12 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.