A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 48

Thread: Flash 8's window component

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    16

    Question Flash 8's window component

    Anyone familliar with flash 8's window component ?
    http://anim.tv/vidmail/popup.html

    I would like to know how can i use it as a popup window like:
    http://anim.tv/104/popupwindow.swf where i can add contents in it and use the close button.

    Also ive find out that not all .swf app work inside the window. why ?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I don't know the problem is fixed by now but the 7 version had a problem. This is the way to fix it:
    http://flashscript.biz/components/co...ks/window.html
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Yeah it like that but actualy i get this in flash 8:

    http://hstrial-jpaz.homestead.com/popupwin.rar

    In the parameters of the window i get:

    closebutton
    contentpath
    title

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I have a look at home.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    You have to add a listener for the close button to work;

    Code:
    var winListener:Object = new Object();
    winListener.click = function() {
     my_win.deletePopUp();
    };

  6. #6
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Thank you iaskwhy. Do you know how to do this:
    http://www.*****.com/demo/components...ndowtTest.html

    I mean, click a button to make the window popup and without having it open when i load my page ?

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Here's the code. Change the link to your own image. I used a component button on stage and the window component in the library, not on the stage.

    Code:
    /**
     Requires:
      - Button component on Stage (instance name: my_button)
      - Window component in library
    */
    import mx.containers.Window;
    
    var my_button:mx.controls.Button;
    
    // Create listener object.
    var buttonListener:Object = new Object();
    buttonListener.click = function(evt_obj:Object) {
     // Instantiate Window.
     var my_win:MovieClip = mx.managers.PopUpManager.createPopUp(evt_obj.target, Window, true, {title:"Sunset On Water", closeButton:true, contentPath:"I:/aaF8/slideshows/images/sunsetwater.jpg"});
     my_win.setSize(400, 320);
     var winListener:Object = new Object();
    winListener.click = function() {
     my_win.deletePopUp();
    };
    my_win.addEventListener("click", winListener);
    };
    // Add listener.
    my_button.addEventListener("click", buttonListener);
    All this is straight from the help files in F8.

  8. #8
    Flash, Mans greatest invention
    Join Date
    Jul 2005
    Posts
    382
    can i use ask whats the advantage of using this component over doing the same thing with AS and your own swf ?

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The advantage is that it takes about 1 minute to set up with the component.

  10. #10
    Junior Member
    Join Date
    Oct 2005
    Posts
    20
    hello iaskwhy,

    Im sorry to say this but i dont know where to add the code. im very new Im looking the exact thing has eggman. i have flash 8 and the window component. do i have to create frames ?

    Please help.

  11. #11
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Do the following with the downloaded movie.

    Delete the window component from the stage but leave it in the library. Then put button on stage and name it myButton (Must not necessarily be a button component). Then put this script in an action frame:
    The script is similar to what the moderator wrote.

    PHP Code:
    // create a new CSSStyleDeclaration named TitleStyles
    // and list it with the global styles list
    _global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration();
    // customize styles
    _global.styles.TitleStyles.color 0x000000;
    _global.styles.TitleStyles.fontSize 14;
    function 
    popup(wContent:String) {
        
    myButton.onPress = function() {
            
    tw mx.managers.PopUpManager.createPopUp(thismx.containers.Windowtrue, {closeButton:truetitleStyleDeclaration:"TitleStyles"});
            
    tw.title "WINDOW";
            
    tw.setSize(528334);
            
    tw.contentPath "game.swf";
            
    tw.move(2020);
            var 
    handleCloseObject:Object = new Object();
            
    handleCloseObject.click = function(evt:Object) {
                
    evt.target.deletePopUp();
            };
            
    tw.addEventListener("click"handleCloseObject);
        };
    }
    popup("Testing...."); 
    Last edited by cancerinform; 10-16-2005 at 11:02 AM.
    - The right of the People to create Flash movies shall not be infringed. -

  12. #12
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    What I haven't figured out, is how to make more than one pop up, or load different content in the same window.

  13. #13
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Quote Originally Posted by iaskwhy
    What I haven't figured out, is how to make more than one pop up, or load different content in the same window.
    I was thinking the same thing. cause i know peoples who abuse pupups on the web. i mean clicking the button more then once.. you know what i mean ?

    I think the only way is to make the user open 1 window.. like an alert box wich woudn't make him click twice or click other popup button untill he/she close the current window.

  14. #14
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    more than one popup example:

    PHP Code:
    // create a new CSSStyleDeclaration named TitleStyles
    // and list it with the global styles list
    _global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration ();
    // customize styles
    _global.styles.TitleStyles.color 0x000000;
    _global.styles.TitleStyles.fontSize 14;
    function 
    popup (wText:StringwContent:StringxPos:NumberyPos:Number) {
        
    tw mx.managers.PopUpManager.createPopUp (thismx.containers.Windowfalse, {closeButton:truetitleStyleDeclaration:"TitleStyles"});
        
    tw.title wText;
        
    tw.setSize (225334);
        
    tw.contentPath wContent;
        
    tw.move (xPosyPos);
        var 
    handleCloseObject:Object = new Object ();
        
    handleCloseObject.click = function (evt:Object) {
            
    evt.target.deletePopUp ();
        };
        
    tw.addEventListener ("click"handleCloseObject);
    }
    myButton1.onPress = function () {
        
    popup ("Testing....""game.swf"2020);
    };
    myButton2.onPress = function () {
        
    popup ("Again testing....""pic_10.jpg"27520);
    }; 
    Last edited by cancerinform; 10-16-2005 at 04:30 PM.
    - The right of the People to create Flash movies shall not be infringed. -

  15. #15
    Junior Member
    Join Date
    Oct 2005
    Posts
    20
    Im sorry guys im total new.

    here's what i did: http://hstrial-nne.homestead.com/pop.rar
    And i didn't succeed. cancerinform your code looks powerful.
    Per the Flashkit FAQ, allowable footer sizes at the maximum is 300 pixels wide by 40 pixels high.
    Not the 339 pixel wide by 156 pixel high image you had. Please follow the rules - gerbick (supermod)

  16. #16
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ah, thank you. Not only did you answer the question, you just gave me a function gestalt.

  17. #17
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Quote Originally Posted by Neneko
    Im sorry guys im total new.

    here's what i did: http://hstrial-nne.homestead.com/pop.rar
    And i didn't succeed. cancerinform your code looks powerful.
    Sara, this is that you was looking for: http://hstrial-pip.homestead.com/popup.rar

    A multiple button for 1 window thanks to cancerinform's codes whe can now do flash popups. Thanks dudes

  18. #18
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    http://www.learningflashmx.com/popup/windowcomp2.html

    5 buttons, but only one window at a time opens.

    From cancerinforms script, modified.

  19. #19
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Quote Originally Posted by iaskwhy
    http://www.learningflashmx.com/popup/windowcomp2.html

    5 buttons, but only one window at a time opens.

    From cancerinforms script, modified.
    How did you do that ? awsome !
    The popup draging limit... and the all in 1 window.
    Last edited by Dr.Eggman; 10-17-2005 at 02:23 AM.

  20. #20
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Code:
    // create a new CSSStyleDeclaration named TitleStyles 
    // and list it with the global styles list 
    _global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration (); 
    // customize styles 
    _global.styles.TitleStyles.color = 0x000000; 
    _global.styles.TitleStyles.fontSize = 14; 
    function popup (wText:String, wContent:String, xPos:Number, yPos:Number, xSiz:Number, ySiz:Number) { 
        tw = mx.managers.PopUpManager.createPopUp (this, mx.containers.Window, false, {closeButton:true, titleStyleDeclaration:"TitleStyles"}); 
        tw.title = wText; 
        tw.setSize (xSiz, ySiz); 
        tw.contentPath = wContent; 
        tw.move (xPos, yPos); 
        var handleCloseObject:Object = new Object (); 
        handleCloseObject.click = function (evt:Object) { 
            evt.target.deletePopUp (); 
        }; 
        tw.addEventListener ("click", handleCloseObject); 
    } 
    myButton1.onPress = function () {
    	tw.deletePopUp ();
        popup ("Sunset On Water", "sunsetwater.jpg", 20, 20, 400, 320); 
    }; 
    myButton2.onPress = function () {
    	tw.deletePopUp ();
        popup ("Old Pictures", "old32b.jpg", 20, 20, 400, 260); 
    };
    myButton3.onPress = function () {
    	tw.deletePopUp ();
        popup ("Stop Watch", "clocktimerclass.swf", 20, 20, 300, 300); 
    };
    myButton4.onPress = function () {
    	tw.deletePopUp ();
        popup ("Web Commercial", "web.swf", 20, 20, 300, 200); 
    };
    myButton5.onPress = function () {
    	tw.deletePopUp ();
        popup ("Video Player", "video5.png", 20, 20, 383, 353); 
    };
    What it still needs is a preloader and some way to center the windows. working on that.

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