2015-12-31 43 views
-3

如何解决该问题?我使用Flash CS6和Flash cs6 AS3 1119错误,未定义属性READY通过静态类型的引用类

输出:

符号 'cinematography_mc',层 'AS3',第1帧,第31行1119:可能未定义的属性READY的访问 通过与静态 型类的引用。

import fl.video.*; 
import flash.events.MouseEvent; 
import flash.sampler.pauseSampling; 

var flvPlayer:FLVPlayback = new FLVPlayback(); 
addChild(flvPlayer); 

flash.events.Event.MOUSE_LEAVE; 

if(!stage.hasEventListener("Leave")) 
{ 
    stage.addEventListener("Leave", __onLeaveThis); 
} 

function __onLeaveThis(e:Event):void 
{ 
    myVideo.stop(); 
} 

//The next line assumes you have copied the skin file to the directory 
//that contains the published SWF file. If you are testing the 
//application in Flash Professional, this is the same directory as the 
//FLA file, too. 

function readyHandler(event:VideoEvent):void 
{ 
    // Pause until the video can play till the end 
    myVideo.pause(); 
    myVideo.playWhenEnoughDownloaded(); 
} 

myVideo.addEventListener(VideoEvent.READY, readyHandler); 

var mybtn:Array = new Array(Movie1_btn, Movie2_btn, Movie3_btn, Movie4_btn, Movie5_btn, Movie6_btn, Movie7_btn, Movie8_btn, Movie9_btn); 

for (var i = 0; i < mybtn.length; i++) 
{ 
    mybtn[i].addEventListener(MouseEvent.CLICK, clickhandler); 

    function clickhandler(event:MouseEvent):void 
    { 
     if (event.target == Movie1_btn) 
     { 
      myVideo.source = "1_Bad Water Sequence.mov"; 
     } 
     else if (event.target == Movie2_btn) 
     { 
      myVideo.source = "2_Nat Geo Clips_Red Wolf Docu.mp4"; 
     } 
     else if (event.target == Movie3_btn) 
     { 
      myVideo.source = "3_News_Anthrax_Postal Story.mov"; 
     } 
     else if (event.target == Movie4_btn) 
     { 
      myVideo.source = "4_Energy Ducumentary 2 min Clip.mov"; 
     } 
     else if (event.target == Movie5_btn) 
     { 
      myVideo.source = "5_Wildlife_Scenic_Reel.mov"; 
     } 
     else if (event.target == Movie6_btn) 
     { 
      myVideo.source = "6_Intro Title Sequence for Mt.Rushmore Webcasts.mov"; 
     } 
     else if (event.target == Movie7_btn) 
     { 
      myVideo.source = "7_PowWow Ancestry Dream Sequence.mov"; 
     } 
     else if (event.target == Movie8_btn) 
     { 
      myVideo.source = "8_Fence Fixin-Western style-L.mov"; 
     } 
     else if (event.target == Movie9_btn) 
     { 
      myVideo.source = "9_Docu_3 separate Clips.mov"; 
     } 
     myVideo.stop() 
    } 
} 

stop(); 
+0

由于无处在发布代码有一个“READY”你可以有把握地认为张贴的代码将于事无补。因极度懒惰而投票:在标题中发布错误,只问“如何修复”,发布一个与问题无关的代码,因为你太懒惰。 – BotMaster

+0

我同意@BotMaster。您应该尝试在盲目发布到Stackoverflow之前调试您的代码。 – Brian

+0

你们是不是那么善良。我并不懒,但我自己创建了一个网站,我从来没有学过任何一种代码。我只是不知道从哪里开始修复它。感谢您的帮助。 – Lily

回答

0

你的代码,有READY字的唯一部分是这样的:

myVideo.addEventListener(VideoEvent.READY, readyHandler); 

错误说有没有VideoEvent类中的READY属性。

我看到你导入了fl.video包内的所有类,但是再次检查你是否真的使用了fl.video.VideoEvent类而不是flash.events.VideoEvent

+0

感谢您的帮助。我会研究这一点。 – Lily

相关问题