A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: [RESOLVED] Scalable window component going weird

  1. #21
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Ok, here is a revised version of the script for 2 buttons.
    PHP Code:
    import mx.utils.Delegate;
    myTW mx.managers.PopUpManager.createPopUp (_rootmx.containers.Windowfalse, {closeButton:truetitle:"This is the title"_x:270_y:40color:16711680contentPath:"images/a1.jpg"});
    myTW.visible false;
    sizerPop = new Object ();
    sizerPop.handleEvent = function (img)
    {
        if (
    img.type == "complete")
        {
            
    myTW.setSize (myTW.content._widthmyTW.content._height 25);
        }
    };
    myTW.addEventListener ("complete"sizerPop);
    but.onPress = function ()
    {
        
    myTW.visible true;
        
    myTW.contentPath "images/a1.jpg";
    };
    but2.onPress = function ()
    {
        
    myTW.visible true;
        
    myTW.contentPath "images/BMW_milk_ad.jpg";
    };
    var 
    closeWindow:Object = new Object ();
    closeWindow.click Delegate.create (thiscw);
    function 
    cw (evt)
    {
        
    evt.target.visible false;
    }
    myTW.addEventListener ("click"closeWindow); 
    When the movie loads you create a window but make it invisible. Then you can press any button to load another image and it will be resized. You can place the window wherever you want. The closebutton only makes it invisible. So the window is always present.
    - The right of the People to create Flash movies shall not be infringed. -

  2. #22
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    Hi,
    I got 2 btns named- 'btn', 'btn2'. Wrote this new code on the actions layer. Wow, grt. this is exactly what i wanted. thanks a zillion
    but, when i uploaded it on:
    http://www.cndmotorhomes.com/1Aug/1aug.swf
    the same problem appeared. the close btn going to the left. Maybe a preloader is needed. I don't know how to do this. Pls help.

  3. #23
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    i have searched a lot. But couldn't figure how to put a preloader in the window component. I would like to remind that my window is generated thru actionscript. the content for the popup is coming thru as and xml at the click of a radio/chk. so pls help me keeping that in mind.

  4. #24
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You need to preload the images before or just at the time the movie is loaded. You can try this.

    http://www.flashscript.biz/component...preloader.html

    It works also without a button. Just put the component somewhere in a corner, name it, fill out the chart in the property inspector and set alpha to 0. Then you don't even see the preloading.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #25
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    thanks so much. I'll try it and let u know if i meet any problem

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