Flash 将视频加载到内存

Flash 将视频加载到内存,flash,actionscript-3,Flash,Actionscript 3,我有3-4个3秒的flv文件,我需要多次播放它们。 我不想导入flv,我不能每次动态加载它们。 我能在我的swf开始时加载一次并在任何时候播放吗?? 感谢加载FLV文件后,flash player将缓存这些文件,如果媒体的URL与先前加载的URL相同,则除非清除flash player的缓存,否则不会再次尝试下载这些文件 以下是预加载的示例: private var preloadQueue:Array = ['http://path/to/firstmovie.flv', 'htt

我有3-4个3秒的flv文件,我需要多次播放它们。 我不想导入flv,我不能每次动态加载它们。 我能在我的swf开始时加载一次并在任何时候播放吗??
感谢

加载FLV文件后,flash player将缓存这些文件,如果媒体的URL与先前加载的URL相同,则除非清除flash player的缓存,否则不会再次尝试下载这些文件

以下是预加载的示例:

private var preloadQueue:Array = 
  ['http://path/to/firstmovie.flv',
   'http://path/to/secondmovie.flv'];

private function startPreload() {
   loadNextItem();
   function loadNextItem() {
     if (preloadQueue.length == 0) {
        preloadingFinished();
     }
     var movie:URLLoader = new URLLoader(new URLRequest(preloadQueue.pop()));
     cacher.addEventListener(ProgressEvent.PROGRESS, function (e:ProgressEvent) {
       //you can show the percentage of the current movie being loaded
     });
     //ideally you'd want to catch IOErrorEvent.IO_ERROR as well for any 404's
     cacher.addEventListener(Event.COMPLETE, function (e:Event) {
        loadNextItem();
     });
   }
}
startPreload();
function preloadingFinished() {
   MyFlvplayer.play('http://path/to/firstmovie.flv'); //movie will play instantly
}

视频被加载到内存中。与内存中保存的任何其他项(如图像、swf、对象、数组等)一样,如果它不再具有指向数据的指针,则数据将被垃圾收集

在您的情况下,如果您已经加载了一次视频(无论是动态加载还是在编译时嵌入),这就是您所需要的。只需隐藏它,直到您再次需要它,然后重置它的播放头回到开始

video.alpha = 1;
video.seek(0)

希望没有其他方式。。。