Flex hates to scale things.  Resizing the SWFLoader resizes the test2
application.  You'll need logic in test2 that scales the content based
on application width/height

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Stephen Roy J. Tang
Sent: Friday, November 16, 2007 1:30 AM
To: [email protected]
Subject: [flexcoders] Can I have SWFLoader automatically scale the
content swf?

 

Hi,

I'm trying to do this thing where I have a VDividedBox, the top half
contains an SWFLoader that will load another Flex SWF. I want to
resize the SWFLoader automatically when the containing canvas is
resized by dragging the divider, and also for the content inside the
SWFLoader to scale automatically. Can this be done?

What I tried is something like:

test.mxml
=========

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute">
<mx:VDividedBox width="543" height="312">
<mx:Canvas id="myCanvas" height="300">
<mx:SWFLoader source="test2.swf" id="ld" maintainAspectRatio="true"
height="{myCanvas.height-20}" scaleContent="true" />
</mx:Canvas>
<mx:Canvas>
<mx:Text text="The bottom half of the vdivided box" />
</mx:Canvas>
</mx:VDividedBox>
</mx:Application>

test2.mxml
==========

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute">
<mx:Text x="22" y="10" text="I want this content to scale"/>
<mx:Image x="22" y="36" width="197" height="28" source="untitled.jpg"/>
</mx:Application>

Any advice would be greatly appreciated.

Thanks,

Roy

 

Reply via email to