Hi guys!
I’ve used the tutorial on gotoAndLearn.com called Scrolling Thumbnail Panel and it’s working fine and all, but I need to adjust it for my own webpage. And since I’m using a list that can be dynamically changed there’s some script changes I need to make.
Now, I’m going berserk trying to figure this one out.
The things I have a problem with are setting the y-coordination where the panel should stop scrolling, the middle point of the panel if you will. The tutorial on gotoAndLearn.com uses the stage width divided by 2 to to acquire that position. But I have a stage that I need to be able to change the size of. And since my scroll panel will be attached to the root stage using attachMovie it’s not attached to the absolute middle of the root stage. This causes some problems I haven’t been able to fix.
I was hoping someone could help me out a bit.
One other problem I have is that I will be expanding the scrollpanel dynamically with XML, so the “stop” position on the last picture will have to be dynamic.
Here’s the AS:
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds(_root);
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(panel._y >= 76) {
panel._y = 76;
}
if(panel._y <= -752) {
panel._y = -752;
}
//Down below is where it should be dynamically calculated or something
var ydist = _ymouse - Stage.height/2;
panel._y += Math.round(-ydist / 7);
}
Here’s the .fla (simplified without the XML loading and stuff) if anyone wants to take a look at it.
http://www.subfusc.se/scrolling_panel.zip
Thanks a lot in advance,
Subfusc