Scripting the creation of a New Video object?
Posted on 2004-03-24
I can't find this documented anywhere...
This works just fine:
1) With the document open in the Flash authoring tool, in the Library panel (Window > Library) select New Video from the Library options menu to create a video object.
2) Drag a video object from the Library panel onto the Stage. This creates a video object instance.
3) With the video object selected on the Stage, in the Property inspector (Window > Properties) enter myVideo in the Instance Name text box.
4) Add this code:
myUrl = "example.flv";
var myNetConnection:NetConnection = new NetConnection();
var netStream:NetStream = new NetStream(myNetConnection);
But I want to replace steps 1-3 with something like:
_root.myVideo = new Embedded Video ("myVideo", 1, 20, 20, 320, 240);
Is this possible?