Full flash problem...again

  • Hi guys,
    I am using this script:

    Stage.scaleMode = "noScale";

    Stage.align = "LT";

    box2._x = Math.round((Stage.width/2)-(box2._width/2));
    box2._y = Math.round((Stage.height/2)-(box2._height/2));

    box2.onResize = function() {
    box2._x = Math.round((Stage.width/2)-(box2._width/2));
    box2._y = Math.round((Stage.height/2)-(box2._height/2));
    };
    Stage.addListener(box2);
    box2.onResize();

    When loading an external swf into box2, the code does not move the box to the middle when the browser is rescaled. What is the problem?


  • Thanks 999, works perfectly.


  • By assigning the listener to box2 your killing it when you load into it. Create a new object to listen for the resize function instead. I've never heard of "LT" before? I think you mean "TL"?

    Stage.scaleMode = "noScale";
    Stage.align = "TL";
    stageListener = new Object();
    setStage = stageListener.onResize=function () {
    box2._x = Math.round((Stage.width/2)-(box2._width/2));
    box2._y = Math.round((Stage.height/2)-(box2._height/2));
    }
    setStage();
    Stage.addListener(stageListener);

    /*In your MovieClipLoader or preloader call setStage()
    to center box2 on init or just put an OnClipEvent
    directly on it */

    onClipEvent(load) {
    _parent.setStage();
    }







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Full flash problem...again , Please add it free.

    Jonas Brothers cd or what? Who's better for Nick Jonas - Miley Cyrus or Selena Gomez?