Hi,

Here is a piece of code to focus on my problem.

When i make a scale operation on the inner canvas, the canvas growth
and my problem is that i want the label stay on center of the page.
How can i deal with outer canvas scrollbars to do that?

Thanks,

Charles

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <mx:Script>
                <![CDATA[
                        private function onclick():void
                        {
                                inner.scaleX *= 1.5
                                inner.scaleY *= 1.5
                                
                                // DOESN'T WORK
                                //outer.horizontalScrollPosition = 
outer.maxHorizontalScrollPosition/2
                                //outer.verticalScrollPosition = 
outer.maxVerticalScrollPosition/2
                                
                        }
                ]]>
        </mx:Script>
                

        <mx:Canvas autoLayout="true" id="outer" width="100%" height="100%"
horizontalScrollPolicy="on" verticalScrollPolicy="on">
                <mx:Canvas autoLayout="false" id="inner" click="onclick()"
backgroundColor="0xFF0000" width="{parent.width}"
height="{parent.height}" horizontalScrollPolicy="off"
verticalScrollPolicy="off">
                        <mx:Label id="center" text="STAY CENTERED PLEASE"
x="{inner.width/2-center.width/2}"
y="{inner.height/2-center.height/2}"/>                  
                </mx:Canvas>
        </mx:Canvas>
</mx:Application>




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcomponents/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcomponents/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to