2009-10-12 57 views
0

我有一個FL播放器,我試圖讓它在一個div內正確顯示,它在IE中看起來不錯(只在刷新頁面後),但沒有其他的瀏覽器正確顯示它(僅顯示電視節目的1/4)。Flash文檔大小爲336px x 220px,我將電視和遙控器放在裏面。Flash在瀏覽器中無法正常顯示

我使用SWFObject調用使用該閃光燈:

<script type="text/javascript"> 
    var so = new SWFObject("tv.swf?videoUrl=video1.flv&imageUrl=image/image1.jpg&tvName=", "DSI", "100%", "100%", "6", ""); 
    so.addVariable("autostart","true"); 
    so.addParam("allowFullScreen", "true"); 
    so.write("flashcontent");  
</script> 

而且它位於一個div這也是336像素X 220px用紅色邊框(僅用於可見性)內。

這裏的網址:http://live.gfwa.360southclients.com/commercial/test.html

有人可以幫助我走出這讓它顯示OK,我沒有配備閃光燈等這麼好..:S

哦,這裏的動作腳本文件:

package 
{ 
    import flash.display.*; 
    import flash.events.*; 
    import flash.media.*; 
    import flash.net.*; 
    import flash.utils.*; 

    public class tvplayer extends MovieClip 
    { 
     private var seekbarChangeInterval:uint; 
     private var vid:Video; 
     private var mute:Boolean; 
     private var imageUrl:String; 
     public var remote_mc:MovieClip; 
     private var realVideoWidth:Number; 
     private var volumeChangeInterval:uint; 
     private var videoLoaded:Boolean; 
     private var currentState:Boolean; 
     private var req:URLRequest; 
     private var screenHeight:Number; 
     private var screenWidth:Number; 
     private var seekbarHideTimer:Timer; 
     private var videoUrl:String; 
     private var realVideoHeight:Number; 
     private var totalVideoTime:Number; 
     public var All_mc:MovieClip; 
     private var xmlLoader:URLLoader; 
     private var muteHideTimer:Timer; 
     private var volumeHideTimer:Timer; 
     private var videoLoadedInterval:uint; 
     private var imageLoader:Loader; 
     private var videoLoadedTime:Number; 
     private var showVideo:Boolean; 
     private var nc:NetConnection; 
     private var ns:NetStream; 
     private var latestVolumeVal:Number; 

     public function tvplayer() : void 
     { 
      nc = new NetConnection(); 
      currentState = false; 
      screenHeight = 336; 
      screenWidth = 580; 
      setValues(); 
      readFlashVars(); 
      addButtonsEvents(); 
      arrangeObjects(); 
      loadImage(); 
      loadVideo(); 
      return; 
     }// end function 

     private function videoFinished() : void 
     { 
      ns.close(); 
      vid.clear(); 
      All_mc.lcd_mc.removeChild(vid); 
      All_mc.lcd_mc.imageHolder_mc.alpha = 1; 
      remote_mc.playpause_mc.play_mc.visible = true; 
      remote_mc.playpause_mc.pause_mc.visible = false; 
      clearInterval(videoLoadedInterval); 
      videoLoaded = false; 
      currentState = false; 
      return; 
     }// end function 

     public function loadImage() : void 
     { 
      try 
      { 
       imageLoader = new Loader(); 
       imageLoader.load(new URLRequest(imageUrl)); 
       imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createImage); 
      } 
      catch (e:Error) 
      { 
      } 
      return; 
     }// end function 

     private function setValues() 
     { 
      videoUrl = "video/video1.flv"; 
      imageUrl = "image/image1.jpg"; 
      All_mc.txt.text = "Your Logo"; 
      remote_mc.playpause_mc.pause_mc.visible = false; 
      mute = false; 
      latestVolumeVal = 1; 
      videoLoadedTime = 0; 
      All_mc.muteDisplay_mc.visible = false; 
      All_mc.volumeDisplay_mc.visible = false; 
      All_mc.volumeDisplay_mc.volumeBar_mc.width = latestVolumeVal * 348; 
      All_mc.seekbarDisplay_mc.visible = false; 
      muteHideTimer = new Timer(2000, 1); 
      muteHideTimer.addEventListener(TimerEvent.TIMER, hideMuteDisplay); 
      volumeHideTimer = new Timer(2000, 1); 
      volumeHideTimer.addEventListener(TimerEvent.TIMER, hideVolumeDisplay); 
      seekbarHideTimer = new Timer(2000, 1); 
      seekbarHideTimer.addEventListener(TimerEvent.TIMER, hideSeekbarDisplay); 
      stage.addEventListener(FullScreenEvent.FULL_SCREEN, fsEvent); 
      stage.addEventListener(Event.RESIZE, resizeHandler); 
      remote_mc.ledOn_mc.alpha = 0; 
      return; 
     }// end function 

     private function hideVolumeDisplay(event:TimerEvent) : void 
     { 
      All_mc.volumeDisplay_mc.visible = false; 
      volumeHideTimer.stop(); 
      return; 
     }// end function 

     private function seekDown_mouseDown(event:MouseEvent) : void 
     { 
      All_mc.muteDisplay_mc.visible = false; 
      muteHideTimer.stop(); 
      All_mc.volumeDisplay_mc.visible = false; 
      volumeHideTimer.stop(); 
      ledon(); 
      ns.pause(); 
      seekDown(); 
      seekbarChangeInterval = setInterval(seekDown, 200); 
      return; 
     }// end function 

     private function metaDataGather(param1:Object) : void 
     { 
      realVideoHeight = param1.height; 
      realVideoWidth = param1.width; 
      totalVideoTime = param1.duration; 
      setMovieScale(); 
      return; 
     }// end function 

     private function seekDown_mouseUp(event:MouseEvent) : void 
     { 
      ns.resume(); 
      if (seekbarChangeInterval) 
      { 
       clearInterval(seekbarChangeInterval); 
      } 
      seekbarHideTimer.start(); 
      ledoff(); 
      return; 
     }// end function 

     private function outButton(event:MouseEvent) : void 
     { 
      event.currentTarget.out_mc.alpha = 1; 
      event.currentTarget.over_mc.alpha = 0; 
      return; 
     }// end function 

     private function updateLoader() : void 
     { 
      videoLoadedTime = Math.floor(totalVideoTime * (ns.bytesLoaded/ns.bytesTotal)); 
      return; 
     }// end function 

     private function stopdrag(event:MouseEvent) : void 
     { 
      remote_mc.stopDrag(); 
      return; 
     }// end function 

     function netStatusHandler(event:NetStatusEvent) 
     { 
      switch(event.info.code) 
      { 
       case "NetStream.Play.StreamNotFound": 
       { 
        trace("Unable to locate video"); 
        break; 
       } 
       case "NetStream.Play.Stop": 
       { 
        videoFinished(); 
        break; 
       } 
       case "NetStream.Seek.InvalidTime": 
       { 
        break; 
       } 
       default: 
       { 
        break; 
       } 
      } 
      return; 
     }// end function 

     private function volumeUp_mouseDown(event:MouseEvent) : void 
     { 
      All_mc.muteDisplay_mc.visible = false; 
      muteHideTimer.stop(); 
      All_mc.seekbarDisplay_mc.visible = false; 
      seekbarHideTimer.stop(); 
      ledon(); 
      volumeUp(); 
      volumeChangeInterval = setInterval(volumeUp, 200); 
      return; 
     }// end function 

     private function arrangeFullscreenObjects() : void 
     { 
      All_mc.lcd_mc.width = stage.stageWidth; 
      All_mc.lcd_mc.height = stage.stageHeight; 
      var _loc_1:int = 0; 
      All_mc.lcd_mc.y = 0; 
      All_mc.lcd_mc.x = _loc_1; 
      var _loc_1:int = 0; 
      All_mc.y = 0; 
      All_mc.x = _loc_1; 
      remote_mc.x = All_mc.lcd_mc.x + All_mc.lcd_mc.width - remote_mc.width - 30; 
      remote_mc.y = All_mc.lcd_mc.y + All_mc.lcd_mc.height - remote_mc.height - 30; 
      All_mc.volumeDisplay_mc.x = Math.floor(All_mc.lcd_mc.x + (All_mc.lcd_mc.width - All_mc.volumeDisplay_mc.width)/2); 
      All_mc.volumeDisplay_mc.y = All_mc.lcd_mc.y + (All_mc.lcd_mc.height - All_mc.volumeDisplay_mc.height) - 20; 
      All_mc.seekbarDisplay_mc.y = All_mc.lcd_mc.y + (All_mc.lcd_mc.height - All_mc.seekbarDisplay_mc.height) - 20; 
      All_mc.seekbarDisplay_mc.x = All_mc.volumeDisplay_mc.x; 
      All_mc.muteDisplay_mc.x = All_mc.lcd_mc.x + (All_mc.lcd_mc.width - All_mc.muteDisplay_mc.width) - 20; 
      All_mc.muteDisplay_mc.y = All_mc.lcd_mc.y + 20; 
      All_mc.txt.visible = false; 
      return; 
     }// end function 

     private function startdrag(event:MouseEvent) : void 
     { 
      remote_mc.startDrag(); 
      return; 
     }// end function 

     private function clickPlayPause(event:MouseEvent) : void 
     { 
      All_mc.lcd_mc.imageHolder_mc.alpha = 0; 
      if (!videoLoaded) 
      { 
       loadVideo(); 
      } 
      if (currentState) 
      { 
       currentState = false; 
       event.currentTarget.pause_mc.visible = false; 
       event.currentTarget.play_mc.visible = true; 
       ns.pause(); 
      } 
      else 
      { 
       currentState = true; 
       ns.resume(); 
       event.currentTarget.play_mc.visible = false; 
       event.currentTarget.pause_mc.visible = true; 
      } 
      return; 
     }// end function 

     private function addButtonsEvents() 
     { 
      remote_mc.playpause_mc.buttonMode = true; 
      remote_mc.playpause_mc.addEventListener(MouseEvent.CLICK, clickPlayPause); 
      remote_mc.playpause_mc.addEventListener(MouseEvent.MOUSE_DOWN, function() 
      { 
       ledon(); 
       return; 
      }// end function 
      ); 
      remote_mc.playpause_mc.addEventListener(MouseEvent.MOUSE_UP, function() 
      { 
       ledoff(); 
       return; 
      }// end function 
      ); 
      remote_mc.playpause_mc.play_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.playpause_mc.play_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.playpause_mc.pause_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.playpause_mc.pause_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.fullscreen_mc.buttonMode = true; 
      remote_mc.fullscreen_mc.addEventListener(MouseEvent.CLICK, clickFullscreen); 
      remote_mc.fullscreen_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.fullscreen_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.fullscreen_mc.addEventListener(MouseEvent.MOUSE_DOWN, function() 
      { 
       ledon(); 
       return; 
      }// end function 
      ); 
      remote_mc.fullscreen_mc.addEventListener(MouseEvent.MOUSE_UP, function() 
      { 
       ledoff(); 
       return; 
      }// end function 
      ); 
      remote_mc.remoteBg_mc.buttonMode = true; 
      remote_mc.remoteBg_mc.addEventListener(MouseEvent.MOUSE_DOWN, startdrag); 
      remote_mc.remoteBg_mc.addEventListener(MouseEvent.MOUSE_UP, stopdrag); 
      remote_mc.mute_mc.buttonMode = true; 
      remote_mc.mute_mc.addEventListener(MouseEvent.CLICK, toggleMute); 
      remote_mc.mute_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.mute_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.mute_mc.addEventListener(MouseEvent.MOUSE_DOWN, function() 
      { 
       ledon(); 
       return; 
      }// end function 
      ); 
      remote_mc.mute_mc.addEventListener(MouseEvent.MOUSE_UP, function() 
      { 
       ledoff(); 
       return; 
      }// end function 
      ); 
      remote_mc.volumeUp_mc.buttonMode = true; 
      remote_mc.volumeUp_mc.addEventListener(MouseEvent.MOUSE_DOWN, volumeUp_mouseDown); 
      remote_mc.volumeUp_mc.addEventListener(MouseEvent.MOUSE_UP, volumeUp_mouseUp); 
      remote_mc.volumeUp_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.volumeUp_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.volumeDown_mc.buttonMode = true; 
      remote_mc.volumeDown_mc.addEventListener(MouseEvent.MOUSE_DOWN, volumeDown_mouseDown); 
      remote_mc.volumeDown_mc.addEventListener(MouseEvent.MOUSE_UP, volumeDown_mouseUp); 
      remote_mc.volumeDown_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.volumeDown_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.forward_mc.buttonMode = true; 
      remote_mc.forward_mc.addEventListener(MouseEvent.MOUSE_DOWN, seekUp_mouseDown); 
      remote_mc.forward_mc.addEventListener(MouseEvent.MOUSE_UP, seekUp_mouseUp); 
      remote_mc.forward_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.forward_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      remote_mc.rewind_mc.buttonMode = true; 
      remote_mc.rewind_mc.addEventListener(MouseEvent.MOUSE_DOWN, seekDown_mouseDown); 
      remote_mc.rewind_mc.addEventListener(MouseEvent.MOUSE_UP, seekDown_mouseUp); 
      remote_mc.rewind_mc.addEventListener(MouseEvent.MOUSE_OVER, overButton); 
      remote_mc.rewind_mc.addEventListener(MouseEvent.MOUSE_OUT, outButton); 
      return; 
     }// end function 

     private function seekUp_mouseDown(event:MouseEvent) : void 
     { 
      All_mc.muteDisplay_mc.visible = false; 
      muteHideTimer.stop(); 
      All_mc.volumeDisplay_mc.visible = false; 
      volumeHideTimer.stop(); 
      ledon(); 
      seekUp(); 
      seekbarChangeInterval = setInterval(seekUp, 100); 
      return; 
     }// end function 

     private function volumeDown() : void 
     { 
      volumeHideTimer.stop(); 
      if (ns.soundTransform.volume > 0) 
      { 
       if (ns.soundTransform.volume - 0.1 <= 0) 
       { 
        ns.soundTransform = new SoundTransform(0); 
        latestVolumeVal = 0; 
       } 
       else 
       { 
        ns.soundTransform = new SoundTransform(ns.soundTransform.volume - 0.1); 
        latestVolumeVal = ns.soundTransform.volume; 
       } 
      } 
      All_mc.volumeDisplay_mc.volumeBar_mc.width = latestVolumeVal * 348; 
      All_mc.volumeDisplay_mc.visible = true; 
      return; 
     }// end function 

     private function seekUp_mouseUp(event:MouseEvent) : void 
     { 
      if (seekbarChangeInterval) 
      { 
       clearInterval(seekbarChangeInterval); 
      } 
      seekbarHideTimer.start(); 
      ledoff(); 
      return; 
     }// end function 

     private function overButton(event:MouseEvent) : void 
     { 
      event.currentTarget.over_mc.alpha = 1; 
      event.currentTarget.out_mc.alpha = 0; 
      return; 
     }// end function 

     private function ledon() : void 
     { 
      remote_mc.ledOn_mc.alpha = 1; 
      remote_mc.ledOff_mc.alpha = 0; 
      return; 
     }// end function 

     private function seekUp() : void 
     { 
      if (ns.time < totalVideoTime) 
      { 
       if (ns.time + 2 >= videoLoadedTime) 
       { 
        ns.seek(videoLoadedTime); 
       } 
       else 
       { 
        ns.seek(ns.time + 2); 
       } 
      } 
      All_mc.seekbarDisplay_mc.seekbar_mc.width = ns.time/totalVideoTime * 348; 
      All_mc.seekbarDisplay_mc.visible = true; 
      return; 
     }// end function 

     private function loadVideo() : void 
     { 
      videoLoaded = true; 
      nc.connect(null); 
      ns = new NetStream(nc); 
      vid = new Video(); 
      ns.client = new Object(); 
      ns.bufferTime = 3; 
      ns.play(videoUrl); 
      ns.client.onMetaData = metaDataGather; 
      ns.pause(); 
      vid.attachNetStream(ns); 
      vid.smoothing = true; 
      All_mc.lcd_mc.addChild(vid); 
      ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 
      ns.soundTransform = new SoundTransform(latestVolumeVal); 
      videoLoadedInterval = setInterval(updateLoader, 100); 
      return; 
     }// end function 

     private function volumeUp_mouseUp(event:MouseEvent) : void 
     { 
      if (volumeChangeInterval) 
      { 
       clearInterval(volumeChangeInterval); 
      } 
      volumeHideTimer.start(); 
      ledoff(); 
      return; 
     }// end function 

     private function seekDown() : void 
     { 
      if (ns.time > 0) 
      { 
       if (ns.time - 2 <= 0) 
       { 
        ns.seek(0); 
       } 
       else 
       { 
        ns.seek(ns.time - 2); 
       } 
      } 
      All_mc.seekbarDisplay_mc.seekbar_mc.width = ns.time/totalVideoTime * 348; 
      All_mc.seekbarDisplay_mc.visible = true; 
      return; 
     }// end function 

     private function volumeDown_mouseDown(event:MouseEvent) : void 
     { 
      All_mc.muteDisplay_mc.visible = false; 
      muteHideTimer.stop(); 
      All_mc.seekbarDisplay_mc.visible = false; 
      seekbarHideTimer.stop(); 
      ledon(); 
      volumeDown(); 
      volumeChangeInterval = setInterval(volumeDown, 200); 
      return; 
     }// end function 

     private function readFlashVars() 
     { 
      var paramObj:Object; 
      try 
      { 
       paramObj = stage.loaderInfo.parameters; 
       if (paramObj.videoUrl != null) 
       { 
        videoUrl = paramObj.videoUrl; 
       } 
       if (paramObj.imageUrl != null) 
       { 
        imageUrl = paramObj.imageUrl; 
       } 
       if (paramObj.tvName != null) 
       { 
        All_mc.txt.text = paramObj.tvName; 
       } 
       if (paramObj.screenHeight != null) 
       { 
        screenHeight = paramObj.screenHeight; 
       } 
       if (paramObj.screenWidth != null) 
       { 
        screenWidth = paramObj.screenWidth; 
       } 
      } 
      catch (error:Error) 
      { 
      } 
      return; 
     }// end function 

     private function volumeUp() : void 
     { 
      if (mute) 
      { 
       mute = false; 
      } 
      volumeHideTimer.stop(); 
      if (ns.soundTransform.volume < 1) 
      { 
       if (ns.soundTransform.volume + 0.1 >= 1) 
       { 
        ns.soundTransform = new SoundTransform(1); 
        latestVolumeVal = 1; 
       } 
       else 
       { 
        ns.soundTransform = new SoundTransform(ns.soundTransform.volume + 0.1); 
        latestVolumeVal = ns.soundTransform.volume; 
       } 
      } 
      All_mc.volumeDisplay_mc.volumeBar_mc.width = latestVolumeVal * 348; 
      All_mc.volumeDisplay_mc.visible = true; 
      return; 
     }// end function 

     private function clickFullscreen(event:MouseEvent) : void 
     { 
      if (stage.displayState == StageDisplayState.NORMAL) 
      { 
       stage.displayState = StageDisplayState.FULL_SCREEN; 
      } 
      else 
      { 
       stage.displayState = StageDisplayState.NORMAL; 
      } 
      return; 
     }// end function 

     private function ledoff() : void 
     { 
      remote_mc.ledOn_mc.alpha = 0; 
      remote_mc.ledOff_mc.alpha = 1; 
      return; 
     }// end function 

     private function hideSeekbarDisplay(event:TimerEvent) : void 
     { 
      All_mc.seekbarDisplay_mc.visible = false; 
      seekbarHideTimer.stop(); 
      return; 
     }// end function 

     private function toggleMute(event:MouseEvent) : void 
     { 
      All_mc.volumeDisplay_mc.visible = false; 
      volumeHideTimer.stop(); 
      if (mute) 
      { 
       mute = false; 
       muteHideTimer.stop(); 
       All_mc.muteDisplay_mc.muteOn_mc.alpha = 0; 
       All_mc.muteDisplay_mc.visible = true; 
       ns.soundTransform = new SoundTransform(latestVolumeVal); 
       muteHideTimer.start(); 
      } 
      else 
      { 
       muteHideTimer.stop(); 
       latestVolumeVal = ns.soundTransform.volume; 
       All_mc.muteDisplay_mc.muteOn_mc.alpha = 1; 
       All_mc.muteDisplay_mc.visible = true; 
       mute = true; 
       ns.soundTransform = new SoundTransform(0); 
      } 
      return; 
     }// end function 

     private function volumeDown_mouseUp(event:MouseEvent) : void 
     { 
      if (volumeChangeInterval) 
      { 
       clearInterval(volumeChangeInterval); 
      } 
      volumeHideTimer.start(); 
      ledoff(); 
      return; 
     }// end function 

     private function arrangeObjects() 
     { 
      stage.scaleMode = StageScaleMode.NO_SCALE; 
      stage.align = StageAlign.TOP_LEFT; 
      All_mc.x = All_mc.stage.stageWidth/2 - (screenWidth + 40)/2; 
      All_mc.y = All_mc.stage.stageHeight/2 - (screenHeight + 55)/2; 
      var _loc_1:int = 20; 
      All_mc.lcd_mc.y = 20; 
      All_mc.lcd_mc.x = _loc_1; 
      All_mc.lcd_mc.scree_bg.width = screenWidth; 
      All_mc.lcd_mc.scree_bg.height = screenHeight; 
      var _loc_1:int = 0; 
      All_mc.tv_bg.y = 0; 
      All_mc.tv_bg.x = _loc_1; 
      All_mc.tv_bg.width = screenWidth + 40; 
      All_mc.tv_bg.height = screenHeight + 55; 
      All_mc.foot_mc.y = All_mc.tv_bg.height - 12; 
      All_mc.foot_mc.x = Math.floor((All_mc.tv_bg.width - All_mc.foot_mc.width)/2); 
      All_mc.txt.visible = true; 
      All_mc.txt.y = All_mc.lcd_mc.y + screenHeight + 5; 
      All_mc.txt.x = All_mc.tv_bg.x + Math.floor((All_mc.tv_bg.width - All_mc.txt.textWidth)/2); 
      remote_mc.x = All_mc.x + (screenWidth + 40) - remote_mc.width; 
      remote_mc.y = All_mc.y + (screenHeight + 55) - remote_mc.height; 
      All_mc.volumeDisplay_mc.x = Math.floor(All_mc.lcd_mc.x + (screenWidth - All_mc.volumeDisplay_mc.width)/2); 
      All_mc.volumeDisplay_mc.y = All_mc.lcd_mc.y + (screenHeight - All_mc.volumeDisplay_mc.height) - 20; 
      All_mc.seekbarDisplay_mc.y = All_mc.lcd_mc.y + (screenHeight - All_mc.seekbarDisplay_mc.height) - 20; 
      All_mc.seekbarDisplay_mc.x = All_mc.volumeDisplay_mc.x; 
      All_mc.muteDisplay_mc.x = All_mc.lcd_mc.x + (screenWidth - All_mc.muteDisplay_mc.width) - 20; 
      All_mc.muteDisplay_mc.y = All_mc.lcd_mc.y + 20; 
      return; 
     }// end function 

     private function fsEvent(event:FullScreenEvent) 
     { 
      if (stage.displayState == StageDisplayState.NORMAL) 
      { 
       arrangeObjects(); 
       All_mc.lcd_mc.width = screenWidth; 
       All_mc.lcd_mc.height = screenHeight; 
      } 
      else 
      { 
       arrangeFullscreenObjects(); 
      } 
      return; 
     }// end function 

     private function hideMuteDisplay(event:TimerEvent) : void 
     { 
      All_mc.muteDisplay_mc.visible = false; 
      muteHideTimer.stop(); 
      return; 
     }// end function 

     private function createImage(event:Event) : void 
     { 
      var _loc_2:Bitmap = null; 
      _loc_2 = Bitmap(imageLoader.contentLoaderInfo.content); 
      _loc_2.smoothing = true; 
      _loc_2.width = screenWidth; 
      _loc_2.height = screenHeight; 
      All_mc.lcd_mc.imageHolder_mc.addChild(_loc_2); 
      return; 
     }// end function 

     private function setMovieScale() : void 
     { 
      if (screenWidth/screenHeight >= realVideoWidth/realVideoHeight) 
      { 
       vid.height = screenHeight; 
       vid.width = realVideoWidth/realVideoHeight * screenHeight; 
       vid.x = (screenWidth - vid.width)/2; 
       vid.y = 0; 
      } 
      else 
      { 
       vid.width = screenWidth; 
       vid.height = realVideoHeight/realVideoWidth * screenWidth; 
       vid.y = (screenHeight - vid.height)/2; 
       vid.x = 0; 
      } 
      return; 
     }// end function 

     function resizeHandler(event:Event) : void 
     { 
      All_mc.x = All_mc.stage.stageWidth/2 - All_mc.width/2; 
      All_mc.y = All_mc.stage.stageHeight/2 - All_mc.height/2; 
      return; 
     }// end function 

    } 
} 

回答

0

我設法得到它才能正常顯示,但現在我想知道如果有人可以幫助我獲得視頻自動播放,我已經試過

 <param name="autoPlay" value="true" /> 
     <param name="autoStart" value="true" /> 

但他們不工作,我不知道如何編輯ActionScript使其自動播放..

相關問題