views:

474

answers:

3

hi, i'm using swfloader to load swf file in the middle of the screen using the following command:

<mx:SWFLoader id="game_swf" source="crazy_counting.swf" x="198" y="0" width="721" maxWidth="721" height="531" maxHeight="531" />

now stage of the flash file takes the exact size that i stated by the flash file itself is overlapping the stage with some graphics. how i can i hide overlapped graphics ?

A: 

i resolved the issue by placing the swfloader inside a Container, for example a box. the flash graphics do not go out of the limits of the Container. i need also to sure that box to match the height and width of the swf.

ufk
please read the comments for konsumierer question, there is a bug and a workaround is written there.
ufk
A: 

I´m having the same problem, but your solution doesn´t work for me.

<mx:Box width="{ model.width }" height="{ model.height }" verticalAlign="middle" horizontalAlign="center">
    <mx:SWFLoader id="loader" width="{ model.width }" height="{ model.height }" source="{ model.swfFile }"
            maxWidth="{ model.width }" maxHeight="{ model.height }"/>
</mx:Box>
Konsumierer
I'll re-check the issue. i think i needed to make the width and the height of the box a bit less then the actual size of the swfloader. please let me know if that resolves the issue.
ufk
well i re-checked the issue. it's probably a bug in flash builder 4 beta 2, but it seems that when the container takes less space then the actual swf file, it does not overlap. i created a VBox of width 540 and height 390 and inside the swf with width 550 and height 400.
ufk
+1  A: 

I'm using Flex 4 (nightly build 4.1.0.14607). A container such as Spark VGroup with it's property clipAndEnableScrolling set to "true" solved this problem for me.

Dilip Shah
thanks a lot I'll try that
ufk