4 Replies Latest reply on Sep 30, 2010 11:35 PM by Flex Rock

    Flex Event isn't fired

    EliezerReis Level 1



      I have te following situation:




                private function onClick(event:MouseEvent):void {
           <s:TextInput id="file" text="Storage01/The Only.mp3" width="150"/>
           <s:Button click="onClick(event)"/>
      <view:Mp3Player id="mp3Player"/>




      public class Mp3Player extends SkinnableContainer {

           public function Mp3Player() {
           _nc=new NetConnection();
           _nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);


           public function netStatus(event:NetStatusEvent):void {
           //NEVER FIRED


           public function connect(url:String):void {




      On this peace of code you can see that my button call a method on my Mp3Player class to connect on my stream server. You can see that on my Mp3Player constructor I configure a listener to NestStatusEvent. So, When I call connect method the event should be called but it doesn't happen. But, if i use my netconnection outside of this class, direct in my main.mxml it works great.


      I don't know what happen but if a event call a method that should dispatch another event the second event will not be dispatched. Why? How can I fix it?