View Full Version : Horizontal scroll resizing problem
SachinSolanki
11-12-2008, 12:36 PM
Hi,
I have a canvas component in a panel of fixed height and width.
I am scaling the content of canvas keeping the panel's attribute horizontalAlign="center" .
I am not able to see the content on the left hand side after scaling more then the panel's area. The horizontal scroll bar shows up but i can move it only towards right not towards left.
Please help me out of this.
Thanks,
rebelheart
11-13-2008, 06:04 AM
Please post the code either in full or a snippet atleast, when you ask questions about code. How the hell is someone supposed to know how are you scaling ?
Unless you are scaling by a negative number, you wouldn't hit a scenario you seem to be describing.Take a look at the following which scales just fine.Change the scalex to a negative number and observe. If you doing something else, show that !
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Panel width="600" height="400">
<mx:Canvas scaleX="2">
<mx:Image source="../Sunset.jpg" />
</mx:Canvas>
</mx:Panel>
</mx:Application>
SachinSolanki
11-14-2008, 05:28 AM
Hi,
Thanks for responding.
Following is the code :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
import mx.events.SliderEvent;
import mx.controls.sliderClasses.Slider;
private function scalePlat( zoomLevel:Number ):void {
somePanel.getChildAt(0).scaleX = zoomLevel;
somePanel.getChildAt(0).scaleY = zoomLevel;
}
private function sliderChangeLive(event:SliderEvent):void {
var currentSlider:Slider=Slider(event.currentTarget);
var zoomLevel:Number = event.target.value;
scalePlat( zoomLevel );
}
]]>
</mx:Script>
<mx:Panel width="956" height="122" layout="absolute" includeInLayout="true" verticalCenter="5" horizontalCenter="2" visible="true" maxHeight="122" minHeight="122" maxWidth="956" minWidth="956">
<mx:HBox y="32" width="839" horizontalCenter="-21" visible="true">
<mx:HSlider id="SKSlider" showDataTip="false" allowTrackClick="true" enabled="true" liveDragging="true" change="sliderChangeLive(event)" minimum=".5" maximum="2.5" height="32" value="1"/>
</mx:HBox>
</mx:Panel>
<mx:Panel id="somePanel" height="650" width="960" backgroundColor="#aebcc2" horizontalAlign="center">
<mx:Canvas>
<mx:Image source="Mustang.jpg" scaleContent="true"/>
</mx:Canvas>
</mx:Panel>
</mx:Application>
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.