I'm building a custom video player containing different external and internal (osmf) player objects. I have the player code in seperate as3 components in my library. Adding the player object directly in the mxml makes the swf filesize bigger than it needs to be because all obejct are already added (but not loaded)
<osmf:OSMFPlayer id="playerOSMF" depth="1" />
how can i add the as3 components dynamically to the stage?
my mxml contains a main script
<fx:Script source="main.as" />
when i add in the init() function on applicationComplete()
public var player:OSMFPlayer;
private function init():void {
player = new OSMFPlayer();
addChild(player);
}
this doesn't work and i already tried everything i could think of, anybody got some helpful advice?