function setPlayer(playerSwf:MovieClip,pathFile:String) {
playerSwf.sliderMc.width=0;
var swfLoader:Loader = new Loader();
var swfFile:URLRequest=new URLRequest(pathFile);
playerSwf.closeBtn.addEventListener(MouseEvent.CLICK,closePlayer);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler);
var currentSWF:MovieClip = new MovieClip();
function swfLoadedHandler(e:Event):void {
trace("swf loaded");
currentSWF=MovieClip(swfLoader.content);
playerSwf.btForward.addEventListener(MouseEvent.CLICK, button_forward);
playerSwf.btRewind.addEventListener(MouseEvent.CLICK, button_rewind);
playerSwf.btPause.addEventListener(MouseEvent.CLICK, button_pause);
playerSwf.btPlay.addEventListener(MouseEvent.CLICK, button_play);
currentSWF.addEventListener(Event.ENTER_FRAME , checkLastFrame);
}
function checkLastFrame(e:Event):void {
if (currentSWF.currentFrame==currentSWF.totalFrames) {
currentSWF.stop();
}
playerSwf.sliderMc.width=(currentSWF.currentFrame/currentSWF.totalFrames)*140;
}
function button_forward(e:Event):void {
currentSWF.nextFrame();
}
function button_rewind(e:Event):void {
currentSWF.prevFrame();
}
function button_pause(e:Event):void {
currentSWF.stop();
}
function button_play(e:Event):void {
currentSWF.play();
}
swfLoader.load(swfFile);
playerSwf.container.addChild(swfLoader);
function closePlayer(e:MouseEvent):void {
playerSwf.container.removeChild(swfLoader);
removeChild(player);
}
}
this is code for my swf player but my swf player is not support my swf files which i had deisgnwith play pause stop next previous volume,maxmize seekbar ant swf time…i think the problem is in timeline control…i had design my swf with movieclip into movieclip which had different code …do u wat problem with my file…pls help me frds…thanks in advance