4 Replies Latest reply on Dec 13, 2010 7:44 AM by Claudiu Ursica

    event:Event ["data"] question

    VirtualCoder Level 1

      The following function is inside of a YouTube API class the I found googling.  It handles state changes  In copied this function into my app because I need to listen to and consume some of the same events.  My function is being fired at the correct times except that event["data"] is throwing the following run time error at me.

       

      ReferenceError: Error #1069: Property data not found on flash.events.Event and there is no default value.

       

      --

       

      private function onPlayerStateChange(event:Event):void {

      // Event.data contains the event parameter, which is the new player state

      var stateIndex:Number = event["data"];

       

      switch(stateIndex){

      case 0: clearInterval(this.updateInterval);break;

      case 1: updateInterval = setInterval(function():void{

      currentTime = player.getCurrentTime()*1000;

      }, 500); break;

      case 3: this.duration = this.player.getDuration()*1000; break;

      }

       

      this.dispatchEvent(event);

      }

      --
      Thanks for you help,
      VC