0 Replies Latest reply on Jan 28, 2007 12:21 PM by mburbidg

    dispatchEvent

    mburbidg
      I'm modeling an application after the ReviewTube sample application. That application the following class defined. I wrote a class almost identical to this and I get an error "1180: Call to a possibly undefined method dispatchEvent." on the line with the call to dispatchEvent. I have no idea why I'm gettting the error but the ReviewTube sample doesn't. In looking at the below class I do not see where the definition for dispatchEvent is coming from. Can anyone explain?

      quote:


      package com.joeberkovitz.reviewtube.model
      {
      import flash.events.Event;

      [Event(name="selectedVideoChange",type="flash.events.Event")]

      public class Session
      {
      [Bindable]
      public var currentUser:User;

      private var _selectedVideo:VideoInfo;

      [Bindable("selectedVideoChange")]
      public function get selectedVideo():VideoInfo
      {
      return _selectedVideo;
      }

      public function set selectedVideo(v:VideoInfo):void
      {
      if (v != null && v != _selectedVideo)
      {
      _selectedVideo = v;
      dispatchEvent(new Event("selectedVideoChange"));
      }
      }
      }
      }