-3

How do I fix the problem? I use Flash CS6 and .

Output:

Symbol 'cinematography_mc', Layer 'AS3', Frame 1, Line 31 1119: Access of possibly undefined property READY through a reference with static type Class.

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();
ElChiniNet
  • 2,778
  • 2
  • 19
  • 27
Lily
  • 3
  • 2
  • Given that nowhere in the posted code there's a "READY" you could have safely assumed that posting that code will not help at all. Voted down for being ultra lazy: posting the error in title, only asking "how to fix", posting a code that is not even relevant to the problem, all that cos you are so lazy. – BotMaster Dec 31 '15 at 13:37
  • I agree with @BotMaster. You should try to debug your code before blindly posting to Stackoverflow. – Brian Dec 31 '15 at 18:13
  • You are guys are not so kind. I am not lazy, but I buliding a website all by myself, and I never learn any kind code. I just don't know where to start fix it. Thanks for you help. – Lily Jan 11 '16 at 17:34

1 Answers1

0

The only part of your code that have the READY word is this:

myVideo.addEventListener(VideoEvent.READY, readyHandler);

The error says that there is not a READY property inside the VideoEvent Class.

I see that you imported all classes inside the fl.video package, but check again that you really used the fl.video.VideoEvent Class instead of flash.events.VideoEvent.

ElChiniNet
  • 2,778
  • 2
  • 19
  • 27