We Recommend

Essential ActionScript 3.0 Essential ActionScript 3.0
The book focuses on the core language and object-oriented programming, but also adds a deep look at the centerpiece of Flash Player's new API: display programming. Enjoy hundreds of brand new pages covering exciting new language features, such as the DOM-based event architecture, E4X, and namespaces--all brimming with real-world sample code.


Posted By

zeman on 07/10/08


Tagged

textmate video


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

Wiederkehr
abdsign
farrellj
lzyy


video


Published in: ActionScript 3 


  1. var video:Video = new Video(380, 214);
  2. addChild(video);
  3.  
  4. var nc:NetConnection = new NetConnection();
  5. nc.connect(null);
  6.  
  7. var ns:NetStream = new NetStream(nc);
  8. ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
  9.  
  10. function onStatusEvent(stat:Object):void {
  11. trace(stat.info.code);
  12. }
  13.  
  14. var meta:Object = new Object();
  15. meta.onMetaData = function(meta:Object){
  16. trace(meta.duration);
  17. }
  18.  
  19. ns.client = meta;
  20.  
  21. video.attachNetStream(ns);
  22.  
  23. ns.play("video.flv");

Report this snippet 

You need to login to post a comment.