rickid
07-29-2006, 05:15 PM
Hi,
I've looked through loads of posts about this question but I can't find a solution and just wondered if any flash genius out there can provide it once and for all!
I'm loading an swf into a scrollpane:
1. Firstly I want the content to be centered in the scrollpane. When I use the following code, any redraw function of moving the scrollbars resets the position to the top left.
var scrollwidth = myscrollpane.width / 2;
var scrollheight = myscrollpane.height / 2;
var contentX = (myscrollpane.content.width / 2) + myscrollpane.content._x;
var contentY = (myscrollpane.content.height / 2) + myscrollpane.content._y;
myscrollpane.content._x = (scrollwidth) - (contentX);
myscrollpane.content._y = (scrollheight) - (contentY);
2. I want a zoom in/out button to zoom the movie at the center of the scrollpane. I'm currently using 'myscrollpane.content._xscale'
Many thanks!
Rik
I've looked through loads of posts about this question but I can't find a solution and just wondered if any flash genius out there can provide it once and for all!
I'm loading an swf into a scrollpane:
1. Firstly I want the content to be centered in the scrollpane. When I use the following code, any redraw function of moving the scrollbars resets the position to the top left.
var scrollwidth = myscrollpane.width / 2;
var scrollheight = myscrollpane.height / 2;
var contentX = (myscrollpane.content.width / 2) + myscrollpane.content._x;
var contentY = (myscrollpane.content.height / 2) + myscrollpane.content._y;
myscrollpane.content._x = (scrollwidth) - (contentX);
myscrollpane.content._y = (scrollheight) - (contentY);
2. I want a zoom in/out button to zoom the movie at the center of the scrollpane. I'm currently using 'myscrollpane.content._xscale'
Many thanks!
Rik