# Document height

**URL:** <https://forum.kirupa.com/t/document-height/208580>\
**Category:** Uncategorized\
**Created:** [November 30, 2006, 4:57am UTC](https://forum.kirupa.com/t/document-height/208580 "2006-11-30T04:57:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oli\_G](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@Oli\_G](https://forum.kirupa.com/u/Oli_G)\
**Post date:** [November 30, 2006, 4:57am UTC](https://forum.kirupa.com/t/document-height/208580/1 "2006-11-30T04:57:54Z")

</div>

Hi all

I’m using the script below to generate snow/fairy dust.

However I need it to begin falling not from the top of the flash file, but about 300px from the top. And the script will vary this slightly which is what I need.

Can someone let me know how to achieve this? I gather it involves reversing where the swf defines the beginning of ‘height’ (bottom as opposed to top) or somesuch…

Cheers

```auto

stop();

init = function () {
    width = 573;
    // pixels 
    height = 434;
    // pixels 
    max_snowsize = 20;
    // pixels 
    snowflakes = 40;
    // quantity 
    for (i=0; i<snowflakes; i++) {
        t = attachMovie("snow", "snow"+i, i);
        t._alpha = 25+Math.random()*50;
        t._x = -(width/2)+Math.random()*(1.5*width);
        t._y = -(height/2)+Math.random()*(1.5*height);
        t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
        t.k = 1+Math.random()*2;
        t.wind = -1.5+Math.random()*(1.4*3);
        t.onEnterFrame = mover;
    }
};
mover = function() {
    this._y += this.k;
    this._x += this.wind;
    if (this._y>height+150) {
        this._y = -20;
    }
    if (this._x>width+20) {
        this._x = -(width/2)+Math.random()*(1.5*width);
        this._y = -20;
    } else if (this._x<-20) {
        this._x = -(width/2)+Math.random()*(1.5*width);
        this._y = -20;
    }
}
init();

all_mc.swapDepths(10000);

```
