Very weird problem, I am new to AS, but I have to say it's hard to comprehend AS is a modern language:
private function completed():void
{
trace("completed.");
var player:Object = (loader.content as SystemManager).application as Object;
player.playVideo();
player.setSize(200,300);
}
SWFLoader id="loader" horizontalCenter="0" width="100%" height="362" source="http://localhost:8000/testflv1.swf" init="completed()"
What I want to do is embed a swf in another parent swf, and call a function from parent to the embedded swf. Then, I use the init event for the SWFLoader to invoke the method. Before doing this I have verified that using the same code in a button click handler, it is fine with:
var player:Object = (loader.content as SystemManager).application as Object;
But if in a init event handler, the (loader.content as SystemManager).application is a null.
Whereas, in the document of SWFLoader:
init
Dispatched when the properties and methods of a loaded SWF file are accessible.