I have a custom component that opens a new window with a video player in it. I need to pass a bunch of stuff into it, so there's a lot of binding expressions. I need to be able to catch it's complete event (when the video is finished playing). But the event I dispatch isn't working. Here's my custom component class:

[CODE]

<?xml version="1.0" encoding="utf-8"?><!-- This is a window component which creates a transparent window with no system chrome (no bars, close, min, max buttons, resize stuff) that contains a single video object to be able to play videos from a folder called "videos" in the root of this application. This screen is spawned from the main MXML WindowedApplication using AS 3. --><s:Window xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:customComponents="customComponents.*" systemChrome="none" visible="true" transparent="true" showStatusBar="false" width="400" height="300" > <fx:Metadata> [Event(name="MOVIE_LOAD", type="flash.events.Event")] [Event(name="MOVIE_FINISH", type="flash.events.Event")] </fx:Metadata>

<fx:Script> <![CDATA[ import org.osmf.events.TimeEvent; [Bindable] public var displayScreenWidth:int = 1024; [Bindable] public var displayScreenHeight:int = 768; [Bindable] public var videoName:String; // Note that the following two variables are set to true by default because the screen saver goes in first. [Bindable] public var muteVideo:Boolean=true; [Bindable] public var loopVideo:Boolean=true; // In order to allow it to play, I had to extend the play method for the VideoDisplay to a public function. public function play():void { videoDisplay.play(); }

The problem is, i get the error by the addEventListener line that reads:

Multiple markers at this line:-1119: Access of possibly undefined property MOVIE_FINISH through a reference with static type Class.-addEventListener

I don't know how to get around this. When I type "addEventListener(" and hit control+space bar, I see "Event.MOVIE_FINISH" on the list, citing my custom component as the source. Even when I had it called movieFinish in the component, I still saw "MOVIE_FINISH" for my event in the code help. So, I changed the name, but I cannot get rid of the error, and therefore my program won't compile fully. Any ideas?