A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Full Screen background Question

Hybrid View

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    1

    Smile

    ok...this is a old one... But, I think I had the same problem as describe here:

    you want to have a full browser page image background? and all the other elements (button, movie clic, whatever) not be resized like this:

    http://www.aurelienbercon.com/fullbrowser/

    in this example, I have:
    - a MovieClip that contains the background , instance name : “backg”
    - A MovieClip that contains a image (the turntable) positioned in the middle, instance name: “turn”

    Here is the ActioScript:

    //this function fills the background with the image)-----------------------------
    function fillBG() {
    //backg must have the same size of the stage (browser page
    backg._width = Stage.width;
    backg._height = Stage.height;
    //…and it has to be positioned in the middle
    backg._x = Stage.width / 2;
    backg._y = Stage.height / 2;
    }
    //I call the function
    fillBG();
    //I create an object that be a listener (it will “listen” if the stage is resized)-----------------
    var stageL:Object = new Object();
    //if the stage is resized: I call the function “fillBG” again (to resize the background) and I repositioned the “turn” image in the middle
    stageL.onResize = function() {
    fillBG();
    turn._x = Stage.width / 2;
    turn._y = Stage.height / 2;
    }
    //I attach the listener to the stage
    Stage.addListener(stageL);


    when publishing the HTML, “Dimensions” should be in “Percent” and “flash alignment” : “left” and “Top”

    Then open the HTML file in a text editor and change the body tag by:

    <body bgcolor="#000000" scroll="no" bottommargin="0" rightmargin="0" topmargin="0" leftmargin="0">

    (This will fill totally the html page)


    I hope it will be useful for someone, even if the post is 2 years old.


    By the way: I was helped by this tutorial:
    http://www.gotoandlearn.com/play?id=31 (called “Full Browser Flash”)


    I spent most of the day on it, so I wanted to share it with someone

  2. #2
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    My movie clip still will not consistently fill the window. What might I be doing wrong? http://www.invisiongrafix.com/samples/IG/

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    I got this to work but would like to use it in a number of scenes. When I do this I get conflicts. How would you use this script in multiple scenes?

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