2 Replies Latest reply on Apr 25, 2007 8:08 AM by RossRitchey

    PopUpManager.createPopUp

    cfortin14
      I created a window and loaded a Movie Clip (PopUpContent) on it.

      var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true});
      my_win.contentPath = "PopUpContent";
      my_win.setSize(400, 450);
      my_win.move(124, 133);
      my_win.title = "Window Title";

      I have a button and a label on that movie clip. I need to pass a value to the label.text and a second value that it will be the button target if clicked, i.e. http://macromedia.com. Can someone please help me with this?
        • 1. Re: PopUpManager.createPopUp
          Greg Dove Level 4
          Hi.

          A couple of things for you to follow up on:
          1.Check that you have the .swf extension in your contentPath ...it was missing in your code above.

          2.Because you are waiting for the content to load you can't assign things until the swf inside has loaded completely. So I think you need to listen for the complete event. Once its loaded, you can access the clip and do the things you want with the window's content property.

          Try something like this after what you have already:
          • 2. Re: PopUpManager.createPopUp
            RossRitchey Level 4
            actually GWD, the .swf is unnecessary as capitalino is not loading a .swf as the contentPath. contentPath allows for .swf loading OR a movieClip reference. It sounds like capitalino is using the second method here, and referencing a movieClip in the library.

            Capitalino, it sounds like you're loading of the window is going good, you just want to know how to talk to the movieClip in the contentPath. If this is what you are looking for, try the following

            my_win.content.myBTN.label = "This is the text";

            the .content should direct the player into the contentPath of my_win.

            as for the click handler, you will need the eventListener as detailed by GWD. use the myWindowListener.click function, and place your code to advance in here.

            for the addEventListener code, use my_win.content.myBTN.addEventListener("click",myWindowListener);

            Hope this helps