Hello,
I'm trying to create a gallery in which images are fed to the gallery by an XML database. I want them to end up in a mouse sensitive scroll gallery. I get this far but keep running into a problem with getting all of the images to stop scrolling at their end point (for my case the right hand corner).
The code controlling the mouse scroll is:
Code:
I'm using AS3. If anyone has any ideas they would be gargantuanally (yes) appreciated.Code:function Scrollable (e:Event){ var centerX = stage.stageWidth /2 ; var galleryWidth = full_mc.width; var speed = 0; //SET SPEED BASED ON CURSOR X speed = -(.02 * (mouseX - centerX)); //UPDATE GALLERY SLIDING SPEED BASED ON CURSOR POSITION full_mc.x += speed; if(full_mc.x > stage.stageWidth/2){ //Shift gallery position to reset on right side full_mc.x = -(0); }; //Determine if gallery has ended on left side if(full_mc.x < (-galleryWidth/2.67)){ //Shift gallery position to reset on right side full_mc.x = (-galleryWidth/2.67); }; };


Reply With Quote
Bookmarks