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

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

博客园 - 迷梦江南

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();
  }