flash Q

  • Started
  • Last post
  • 2 Responses
  • Mojo

    I have an empty MC and bring other mcs into it on runtime.

    I have a listener that resizes the empty MC to the exact size of the browser window, and moves to the top left (check my code please).

    CODE:
    -------------
    var stageListener:Object = new Object();
    stageListener.onResize = function() {
    _root.silent._width = stage.width;
    _root.silent._height = stage.height;
    _root.silent._x = (stage.height/2);
    _root.silent._y = (stage.height/2);
    }
    Stage.addListener(stageListener...
    ----------

    Now the document is set to noscale, so the rest of the area (outside document size) grows as the window is resized.

    problem is the clips I load in, are only to the top left of the document space onwards, instead of top left of stage size (the whole browser size).

    my code for loading random things is this:

    CODE
    ------
    j=-5;
    moviename2="stamp1";
    blendMode2="normal";
    alpha2=50;
    _root.silent._width = Stage.width;
    _root.silent._height = Stage.height;
    _root.silent._x = (stage.height/2);
    _root.silent._y = (stage.height/2);

    function createRandomThings() {

    if (j less than 30) {
    _root.silent.attachMovie(moviena... moviename2+j, j);
    _root.silent[moviename2+j]._x = Math.random()*_root.silent.width...
    _root.silent[moviename2+j]._y = Math.random()*_root.silent.heigh...
    _root.silent[moviename2+j]._xsca... = _root[moviename2+j]._yscale=100...
    _root.silent[moviename2+j]._rota... = Math.random()*360;
    _root.silent[moviename+j].blendM... = blendMode2;
    j++;
    }
    }
    ID = setInterval(createRandomThings, 20);

  • Engage0

    Yes thats code you've got there

  • Mojo0

    Thanks.

    Nice site and work btw.

    ego + 1