Flash AS3.0 图片播放器,动态加载图片,xml文件配置图片列表,代码有注释。
部分代码:
public function Player() {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
_PlayList = new PlayList("imgList.xml",ListLoadOk);
_PlayList.Load();
}
//播放列表载入完成
private function ListLoadOk() {
trace("播放列表载入完成");
//trace(_PlayList.XmlList);
_ImagesData = new ImagesData(_PlayList.XmlList,ImagesLoadComplete);
_ImagesData.Load();
}
//全部图片载入完成
private function ImagesLoadComplete() {
trace("全部图片载入完成。" );
_MotionContral = new MotionContral(_PlayList.XmlList,_ImagesData,pc);
ML.addEventListener(MouseEvent.CLICK,mlHandler);
MR.addEventListener(MouseEvent.CLICK,mrHandler);
ML.buttonMode =true;
MR.buttonMode = true;
}
1