Code for a Window Component to open, title, populate and close

Posted on 2005-05-17
Last Modified: 2010-05-18
Could you help me with the code for the Window Component in Flash MX2004? I've read the Macromedia Component Manual (pgs 879-889), and gotten a new window component to open and place the close button on the window. I've also gotten a window to close, but I haven't been able to successfully combine both sets of code. Could you help me with the code to open, title, populate, and close a Window Component? thanks.
Question by:ccllww
    LVL 27

    Accepted Solution

    var initObject = new Object();
    initObject.title = "window title";
    initObject.closeButton = true;
    initObject.contentPath = "symbolLinkage";
    var popup = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, false, initObject);
    var listener = new Object(); = function(evt)
    popup.addEventListener("click", listener);

    Author Comment

    Thank you for your response. I'm new at this. Could you help me understand exactly where I paste the code? Is there anything else I need to do to make it work?
    LVL 27

    Expert Comment

    - open a new movie
    - drag a Window instance to the stage from the component panel, then delete it (but know you have it in the library)
    - create a moviecli in the library, then give it the linkage "symbolLinkage" (right click on the symbol in the library, linkage, Export for actioscript)
    - paste that code in the first frame of your movie, and test it

    Author Comment

    thank you. I'll give it a try later this evening.

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user how to how to record live broadcast.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now