Flash · Align to Window

Out of context: Reply #1

  • Started
  • Last post
  • 2 Responses
  • unfittoprint0

    //on a blank HTML page
    //make your swf 100% width % height

    //in a _root actionscript layer
    //make an align function

    //use to align your MC
    alignMC=function(align){
    if(align=="top left"){
    myMC._x=0;
    myMC._y=0;
    } else if (align == "center"){
    myMC._x=(Stage.width-myMC._width...
    myMC._y=(Stage.height-myMC._heig...
    } else if (align == "bottom right"){
    myMC._x=Stage.width- myMC._width;
    myMC._y=Stage.height - myMC._height;
    }
    }

    //create the stage listener
    Stage.align = "LT";
    Stage.scaleMode = "noScale";
    Reziser = new Object();
    Stage.addListener(Reziser);
    Reziser.onResize = function() {
    alignMC("bottom right");
    };

View thread