This content has been marked as final. Show 3 replies
The size of a MovieClip depends on the size of the frame playing plain and simple.
You can dynamically generate a movieclip on the first frame of the external swf once loaded and use the drawing API to draw a 0 alpha rectangle based on the dimensions the user created beforehand. In MovieClipLoader you would do this MovieClipLoader.onLoadInit method.
However you still have the problem if the size of the first frame is larger than what the user specified.
Thanks MM, but if that is the case, how does the Flash Player application know to size itself to the original stage size. So in my example you double click a local swf file and windows opens the flash player app and the player sizes itself to 540x400 and NOT 50x50?
It must store the original stage size somewhere in the swf for flashplayer to know it?! The player will also default to the orginal stagesize even if there is offstage content on the first frame....
Those numbers are the Stage.width and Stage.height. In the IDE that is Menu Modify->Document.
Only the first loaded swf Stage height and Stage width survives. The first loaded swf becomes a mask for any other external swf loaded into it.
When you load an external swf into a Movieclip, the external swf is loaded but its Stage data is lost and it only loads what is compatible inside a MovieClip.
MovieClips have a dynamic changing _height and _width property depending on the frame and the object positions on that frame.
If you need a first frame that is always a certain size, then include a rectangle MovieClip with an alpha = 0 on the first frame. If all frames, extend to all frames but remember any objects that move beyond that change _width and _height..