惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
H
Help Net Security
V
Visual Studio Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
The Cloudflare Blog
Martin Fowler
Martin Fowler
D
Docker
腾讯CDC
F
Fortinet All Blogs
雷峰网
雷峰网
GbyAI
GbyAI
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - 叶小钗

博客园 - 迷梦江南

DB2问题记录本 flex开发零碎笔记,随时补充 AS3淡入淡出类 JQuey练习一 转“大型网站架构演变和知识体系” 转“大型高并发高负载网站的系统架构 ” 转“经验分享:大型高并发高负载网站的系统架构 ” 转“关于平台研发的一些想法” 转“国内图片网站Yupoo的架构” mootools 1-4 ajax C#测试代码段运行速度 - 迷梦江南 - 博客园 javascript放大图片 - 迷梦江南 - 博客园 javascript网站导航栏 - 迷梦江南 - 博客园 QQ在线状态接口 - 迷梦江南 - 博客园 (转)Javascript在IE与Firefox下的差异 WebApplication与Profile购物车 网站发布后出现的两个问题 mootools实现搜索提示文本框修正版 ASP.NET查看本地磁盘下的子目录和文件信息
AS3无缝循环播放FLV
迷梦江南 · 2013-03-11 · via 博客园 - 迷梦江南

 import flash.events.NetStatusEvent;
 import flash.media.Video;
 import flash.net.NetConnection;
 import flash.net.NetStream;


  private var myNc:NetConnection;
  private var client:Object;
  private var videoStream:NetStream;
  private var video:Video;
  private var videoURL:String;

    myNc = new NetConnection();
    myNc.connect(null);
    client = new Object();
    videoStream =new NetStream(myNc);
   
    video = new Video();
    video.width = 350;
    video.height = 200;
    video.x = 665;
    video.y = 190;
    sprite.addChild(video);
    video.attachNetStream(videoStream);
    videoStream.play(videoURL);
    videoStream.client=client;
   
    videoStream.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);

 private function netStatusHandler(event:NetStatusEvent):void
  { 
   switch (event.info.code) 
   {  
    case "NetConnection.Connect.Success" :   
     connectStream();   
     break;  
    case "NetStream.Play.StreamNotFound" :   
     trace("Unable to locate video: " + videoURL);   
     break;  
    case "NetStream.Buffer.Full" :   
     break;  
    case  "NetStream.Play.Stop" :
     connectStream();
     break; 
   }
  }
  
  private function connectStream():void
  {
   videoStream.pause();
   videoStream.seek(0);
   videoStream.resume();
  }