FORUMS: list search recent posts

scrolling a movie clip gallery in a panel

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Scott Holwick
scrolling a movie clip gallery in a panel
on Sep 21, 2011 at 5:58:41 pm

I have set up a gallery section with the masked area being defined by a stroke that is a movie clip. My gallery images are pieced together in one long string and saved as a movie clip called "panel". My panel is much wider than my stage area because I have many images that I am viewing large (not simply thumbnails). My stage area is approx. 900px wide and my strung together images that compose my "panel" mc is about 5000px wide. (Can I even do this?). When I preview it the mouse over does cause it to scroll to the left and right, but it stope far short of my entire gallery images contained in my "panel" mc.

Below is the code I have used. Any suggestions on how to view the entire width of 5000px in my viewing area?

panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);

function panelOver(event:MouseEvent):void {
panel.removeEventListener(MouseEvent.MOUSE_OVER, panelOver);
panel.addEventListener(Event.ENTER_FRAME, scrollPanel);

}



var b:Rectangle = stroke.getBounds(this);

function scrollPanel(event:Event):void {
if(mouseX < b.left || mouseX > b.right || mouseY < b.top || mouseY > b.bottom) {
panel.removeEventListener(Event.ENTER_FRAME, scrollPanel);
panel.addEventListener(MouseEvent.MOUSE_OVER, panelOver);
}
//note: these were my constraints, you'll need to put in your own:
if(panel.x > 86) {
panel.x = 86;
}
if(panel.x < -885) {
panel.x = -885;
}
var xdist = mouseX - stage.stageWidth / 2;
panel.x += -(xdist / 4);
}


Return to posts index

Scott Holwick
Re: scrolling a movie clip gallery in a panel
on Sep 21, 2011 at 7:14:07 pm

never mind. I figured out how to make this work.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]