actionscript 3 - Mouse move panning -


I am trying to scroll a series of thumbnails horizontally based on mousex status. I can get it to scroll, but it is very choppy and for some reason it's not reading my starting and ending number, so this scrolling will stop. Can anyone point me in the right direction? Thank you.

  var thumbBounds: object = new object (); ThumbBounds = thumbContainer.getBounds (this); ThumbContainer.addEventListener (MouseEvent.MOUSE_OVER, Setscrolling); Scrolling Private Function Set (Me: Mouse Event): Zero {thumbContainer.removeEventListener (MouseEvent.MOUSE_OVER, setScrolling); Stage.addEventListener (Event .ENTER_FRAME, scrollThumbs); } Private Function scrollThumbs (E: Event): Zero {if (mouseX and lt; = thumbBounds.x || mouseX> thumbBounds.width || mouseX and lt; thumbBounds.y || mouseX & gt; thumbBounds.height) {ThumbContainer.addEventListener (MouseEvent.MOUSE_OVER, setcrolling); Stage.removeEventListener (event .ENTER_FRAME, scroll thumbs); } If (thumbContainer.x> = 0) {thumbContainer.x = 0; } If (thumbContainer.x  

An error that I see instantly:

  if (mousex and lieutenant; = thumbbounds.x  thumbbound.width  
< P> Do not you want mouseover to thumbBounds.y and thumbBounds.height again check ?

For instability, it may be related to the film's framerate, the number and size of the images. It also depends on the magnitude of your xdist value and I can use the interpolation (tweening) to calculate how some of the container's final destination and using it or animate it there.

For example

  TweenLite.to (thumbContainer.x, 0.5, {x: thumbContainer.x + Math Plot (-xdist / 10)}) ;  

This will be the cause of the movement between the current status of thumbcontainer and the new situation will easily be from half to second (rather than immediately).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -