flash doesn't have a good memory and every time your use this, _parent or _root, flash has to look up the reference. if you use a variable to reference your timeline, flash will always know were to look.
+
ActionScript Code:
home.createEmptyMovieClip("video_mc", home.getNextHighestDepth());
home.createEmptyMovieClip("oe_mc", home.getNextHighestDepth());
we create two place holders. one for your external movie clip and one so that we can check if your .swf is loaded.
+
ActionScript Code:
video_mc.loadMovie('sos.swf');
begin loading your file...
+
ActionScript Code:
oe_mc.onEnterFrame = function ()
{
if (video_mc._width > 0)
{
removeMovieClip(oe_mc);
video_mc._width = 640;
video_mc._height = 480;
video_mc._x = (Stage.width / 2) - (video_mc._width / 2);
video_mc._y = (Stage.height / 2) - (video_mc._height / 2);
}
}
initiate a loop onto our movieclip. as it continues to loop, onEnterFrame in an endless loop unless stopped, we want to check if the width of the video_mc is greater than 0;
An empty movie clip's width is 0, once any data is loaded, its width is adjusted to the contents.
Once the width has chanced, we want to remove the oe_mc movieclip, remvoing stops the loop automatically, and then you can treating the video_mc movieclip like any other movieclip... change its properties, add properties, adjust its alpha, add funcations etc. etc.