A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 48

Thread: Flash 8's window component

  1. #21
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    It's perfect iaskwhy. I wonder if it can be customed. Sara is my flash designer. (CG)

  2. #22
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Check it again. I got the windows to center.

    http://www.learningflashmx.com/popup/windowcomp2.html

    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 - xSiz / 2, yPos - ySiz / 2); 
        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", 392.5, 275, 400, 320); 
    }; 
    myButton2.onPress = function () {
    	tw.deletePopUp ();
        popup ("Old Pictures", "old32b.jpg", 392.5, 275, 400, 260); 
    };
    myButton3.onPress = function () {
    	tw.deletePopUp ();
        popup ("Stop Watch", "clocktimerclass.swf", 392.5, 275, 300, 300); 
    };
    myButton4.onPress = function () {
    	tw.deletePopUp ();
        popup ("Web Commercial", "web.swf", 392.5, 275, 300, 200); 
    };
    myButton5.onPress = function () {
    	tw.deletePopUp ();
        popup ("Video Player", "video5.png", 392.5, 275, 383, 353); 
    };
    popup ("Video Player", "video5.png", 392.5, 275, 383, 353); The 392.5 and 275 are half the pixel width and height of that oulined box in my example.

  3. #23
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I have to thank you guys for inspiration. I solved one of my search engine problems.

    http://flashscript.biz/flash8/window/search_demo.html

    I will write a simple tutorial on the window component and how to use it as a slideshow
    - The right of the People to create Flash movies shall not be infringed. -

  4. #24
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Well, since your here, what about preloading in a window?

    And your windows are stacking up in your example. Use the code I ended up with to delete the old ones when a new one is opened.

  5. #25
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Need to look into preloading.

    Regarding the stacking I am planning to let the window close when the user has clicked on an item in the listbox.
    - The right of the People to create Flash movies shall not be infringed. -

  6. #26
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Ive find out that the popup does not support some .SWF movies/apps like in normal brower window does:

    Here is a .swf = http://69.156.40.55/103/main.swf
    Here is inside the popup = http://69.156.40.55/103/popup.html

    I used the same code as iaskwhy. ive only changed "sunsetwater.jpg" to main.swf.
    Last edited by Dr.Eggman; 10-17-2005 at 05:01 PM.

  7. #27
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Are the path to the pic and the textfile recognized, since that is what is missing.
    - The right of the People to create Flash movies shall not be infringed. -

  8. #28
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Ive changed:

    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:NumberxSiz:NumberySiz:Number) { 
        
    tw mx.managers.PopUpManager.createPopUp (thismx.containers.Windowfalse, {closeButton:truetitleStyleDeclaration:"TitleStyles"}); 
        
    tw.title wText
        
    tw.setSize (xSizySiz); 
        
    tw.contentPath wContent
        
    tw.move (xPos xSiz 2yPos ySiz 2); 
        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""main.swf"720820400320); 
    }; 
    myButton2.onPress = function () {
        
    tw.deletePopUp ();
        
    popup ("Old Pictures""old32b.jpg"392.5275400260); 
    };
    myButton3.onPress = function () {
        
    tw.deletePopUp ();
        
    popup ("Stop Watch""clocktimerclass.swf"392.5275300300); 
    };
    myButton4.onPress = function () {
        
    tw.deletePopUp ();
        
    popup ("Web Commercial""web.swf"820820300200); 
    };
    myButton5.onPress = function () {
        
    tw.deletePopUp ();
        
    popup ("Video Player""video5.png"392.5275383353); 
    }; 
    The main.swf is http://69.156.40.55/103/main.swf
    Inside 103 i have main.swf and the popup.swf. i run the popup http://69.156.40.55/103/popup.html and click button 1 and stuffs dont work anymore inside the window.

    same thing with the game: http://69.156.40.55/103/web.swf inside Button4
    Last edited by Dr.Eggman; 10-17-2005 at 05:32 PM.

  9. #29
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Ah I think I know the reason. Inside the movies you load into the window add this line in the first line of your movie:

    this._lockroot = true;

    then it will work, I guess?
    - The right of the People to create Flash movies shall not be infringed. -

  10. #30
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    Yes it works now
    Last edited by Dr.Eggman; 10-17-2005 at 06:12 PM.

  11. #31
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    For the moderator:

    http://flashscript.biz/flash8/window/winpop.html

    but for the script you have to wait until I have written the tutorial.
    - The right of the People to create Flash movies shall not be infringed. -

  12. #32
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Great.

    It's not much use unless you can preload the content.

  13. #33
    Junior Member
    Join Date
    Oct 2005
    Posts
    16
    I have a question, is it recommended to add: this._lockroot = true; to each movie i want to add in the window component ? Cause some of them work without it.

  14. #34
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    lockroot forces any movie to use it's root code on itself. So you don't have to plan for using Relative targetting or modifying code when you want to load a movie already made as a standalone into another movie at a later time.

  15. #35
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    - The right of the People to create Flash movies shall not be infringed. -

  16. #36
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Works great.

  17. #37
    Junior Member
    Join Date
    Nov 2001
    Posts
    23
    anyone know what the code would be to change the popup background color from white to grey...

    _global.styles.TitleStyles.color = 0x000000;
    _global.styles.TitleStyles.fontSize = 14;

    thanks

  18. #38
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    _global.styles.Window.setStyle ("backgroundColor", 0xCCCCCC);
    - The right of the People to create Flash movies shall not be infringed. -

  19. #39
    Junior Member
    Join Date
    Nov 2001
    Posts
    23
    thanks man works great....

  20. #40
    Junior Member
    Join Date
    Nov 2001
    Posts
    23
    Quick question?

    Anyone know why at first i had the window component working great and it was draggable around the stage...now when i click on the header it closes as it would with the close button...

    is there a paramater somewhere im missing?

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