I have load flash swf file to my flex project.
I have used SWFLoader
for that to load the swf file.
var loader:SWFLoader = new SWFLoader();
loader.load("player/VideoPlayer.swf");
loader.width = 320;
loader.height = 280;
parentContainer.addElement(loader);
In which parentContainer
is <s:BorderContainer
. It's width 320 and height 280.
I have also tried to set like following, but didn't got succeeded:
function onComplete(event:Event):void
{
loader.width = 320;
loader.height = 280;
}
Problem: But when i run it swf file load to full width and height.
How can i set it's width and height to it's parent container?
I have also tried like:
<s:BorderContainer id="parentContainer" width="320" height="280">
<s:SWFLoader width="320" height="280" scaleContent="false" autoLoad="true"
source="@Embed(source='player/VideoPlayer.swf')" />
</s:BorderContainer>
But still it take 100% size of application. Application size is 600 X 500.
Edit:
swfloader
cover whole application and all other flex component hide beside the swfloader