0 Replies Latest reply on Jul 11, 2010 11:04 AM by AMIR820321548863

    Get a dispatch event from component to main

    AMIR820321548863 Level 1

      Hi

       

      I have build an application with a component that control sound files

       

      I wish to send an event to the main application that indicate that the file (the sound effect) has ended

       

      Does anyone know how does the event recieve in the main application?

      How does the main applicaton recieve and handle the evebt?

       

      here some of my code

       

      this is the component

       

       

       

        public function chooseSound(value:int):void

      {

      switch(value)

      {

      case:1

      case:1

       

      _soundSource = "asset/test1/1_el1_f_n.mp3";

      _soundTarget =

      "PlaySounFile";

      sound2.play();

      yyy=sound2.duration;

      sound2.addEventListener(EffectEvent.EFFECT_END, SoundEnd);

       

      break;

       

       

      public function SoundEnd(event:EffectEvent):void

      {

       

      dispatchEvent(event);

      }

       

      Amir

       

      _

      thanks

       

      _

       

       

      _

       

       

       

       

       

       

       

       

       

       

      ;