How can Loading video files in AS3?



How can Loading video files in AS3?..

Answer / dindayal dhakar

Loading videos using the NetStream and NetConnection
classes is a multistep process:
1. The first step is to create a NetConnection object.
The NetConnection class lets you play streaming FLV files
from either an HTTP address or a local drive by passing the
value null to the connect() method, if you are connecting
to a local FLV file that is not using a server such as
Adobe's Flash Media Server 2 or Adobe Flex.
2. var nc:NetConnection = new NetConnection();
3. nc.connect(null);
4. The second step is to create a NetStream object
which takes a NetConnection object as a parameter and
specify which FLV file you want to load. The following
snippet connects a NetStream object to the specified
NetConnection instance and loads an FLV named video.flv in
the same directory as the SWF file:
5. var ns:NetStream = new NetStream(nc);
6. ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR,
asyncErrorHandler);
7. ns.play("video.flv");
8. function asyncErrorHandler
(event:AsyncErrorEvent):void
9. {
10. // ignore error
11. }
12. The third step is to create a new Video object and
attach the previously created NetStream object using the
Video class's attachNetStream() method. Then you can add
the video object to the display list using the addChild()
method, as seen in the following snippet:
13. var vid:Video = new Video();
14. vid.attachNetStream(ns);
addChild(vid);

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Scripts AllOther Interview Questions

How can Loading video files in AS3?

1 Answers  


database acl level has manager access.his name is listed in author and Reader fields. but he didn't sea a documents what is the reason?

0 Answers  


how can i type the text message in compose box in yahoo mail using descriptive programming in QTP?

0 Answers  


Would you tell me that what is test script? and how to write it? are there some templates?

0 Answers  


i a had secured second class in tenth and twelth and i secured first claas.can i apply for job

1 Answers   IBM,






please send the scrpit driver program

1 Answers  


In sap script, created 1 form but when its went to production system , client want some changes in 1 (ex - addrss) window, what we will do?

0 Answers  


Hi Guys, I am very new to QTP tool , In real time environment how to test the application with this tool, 1. How to load application in QTP tool 2. How to write test script in QTP. 3. In manual testing we test login box (user id , password) how can we test this kind of testing with QTP tool with examples . Please guys put some focus on my questions , real time ecperienced answers would be appreciate, advance thanks ,please guys i am expecting ur answers as soon as posible

0 Answers  


why script is client dependant.

0 Answers  


'IMP' is not recognized as an internal or external command, operable program or batch file. this is the error message i am getting when i importing dmp for the backup. where is the problem?

3 Answers   Mobilink,


what is difference between AS2 and AS3.?

6 Answers  


I Am Planning to Write ISTQB foundation level Ceritification of inida. can Any Body let me know how to prepare for it & Any Study material can you provide or Any other E-books i should need to Study. Please Mail to me ajaybe_2004@yahoo.co.in THnaks in advance Ajay

0 Answers  


Categories