0 Replies Latest reply on Nov 10, 2009 11:39 AM by Enfors

    Access button in Window component content

    Enfors

      Hi!

      I have trouble accessing a button contained in a mc displayed in the Window component.

      It´s the part with red text in the code below that don´t work.

      myMc is a movieclip that holds the button myBtn.

      Any suggestions anyone?

      -----

      /**
      Requires:
      - Window component in library
      */

       

      import mx.managers.PopUpManager;
      import mx.containers.Window;

       

       

      var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true, contentPath:"myMc"});
      var winListener:Object = new Object();
      winListener.click = function(evt_obj:Object) {
      my_win.deletePopUp();
      };
      winListener.complete = function(evt_obj:Object) {
      my_win.setSize(my_win.content._width, my_win.content._height + 25);

      my_win.content.myBtn.onRelease = function(){

           trace("hello");

      }
      }
      my_win.addEventListener("click", winListener);
      my_win.addEventListener("complete", winListener);

       

      -------