Even if I loaded for dozen times an external swf into a movieclip... I dont know how to resize (layout) the targeted movieclip. I don
t mean the quality... Let`s say the external SW开发者_运维百科F has 400 X 300 px and I want it to be loaded into a movieclip container about 200X100. How to resize the external SWF file prior to be loaded? Please HELP ! I know that in AS 3 there is some code with x/y variables... But my external SWF and the main page (in whic I want the swf to be loaded) are in AS 2. Anyone pls Help :) Thanks!
Lets call the container SWF mc_a and the SWF to be loaded mc_b.
Create another container SWF inside of mc_a. We'll call it mc_c for this discussion.
At runtime, set the visibility of mc_c to false.
Load mc_b into mc_c.
mc_c will assume the width and height of the loaded SWF, mc_b, but it will be invisible at this point.
Set the width and height of mc_c according to what you want.
Set the visibility of mc_c to true.
That should do it, or some similar variation of that. You could also forgo the inner container, mc_c, and just set the visibility of mc_a to false at runtime, load mc_b into it, resize mc_a accordingly, and then set mc_a's visibility to true.
The inner container method presumes you might have some other content in mc_a that you would not want resized. When using the inner container method you might have to adjust the x/y of mc_c as well since it will scale anchored at the top left corner.
精彩评论