A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Window Component Problem

  1. #1
    Member
    Join Date
    Oct 2001
    Location
    Southampton, England
    Posts
    83

    Window Component Problem

    Hi,

    Ok my code is below and Im having trouble being able to use the close button on the window component.


    on (press) {
    import mx.managers.PopUpManager;
    import mx.containers.Window;
    var myTW = PopUpManager.createPopUp(_root.airPane_mc, Window, true, {closeButton:true, title:"My Window",contentPath:"external/land_droid.swf"});

    myTW.setSize(800, 600);
    myTW.title = "Droid"
    windowListener = new Object();
    windowListener.click = function(evt) {
    _root.myTW.deletePopUp();
    };
    myTW.addEventListener("click", windowListener);
    }


    It worked fine when this action was on a button instance in the stage but now this code is inside a movie clip with a button inside of it..it loads the window fine and plays the movie fine but closing it does not work..any help would very helpful.

    Thanks

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You are probably not creating the instance on stage. Eliminate _root from _root.myTW.deletePopUp(); and see what you get.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Oct 2001
    Location
    Southampton, England
    Posts
    83
    I added my the full path for the movie clip

    _root.airPane_mc.myTW.deletePopUp(); and it seems to work fine now.

    Thanks again for the reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center