#CopyLeft http://www.ep-ars.net .flash filename="rain2.swf" bbox=345x300 version=9 compress fps=25 .gradient grad1: 0% #ffffffff 80% #ffffffff 100% #085D4Fff .end .gradient grad3: 0% #ff000000 80% #ff0000ff 100% #ff0000ff .end .gradient grad2: 0% #ffffffff 90% #ffffffff 100% #ffffff00 .end #.box square1 width=2 height=2 color=#ffffff00 fill=green .box square1 width=10 height=2 color=#ffffff00 fill=grad3 .box mask width=150 height=345 color=#ffffff00 fill=grad2 .box bg width=300 height=345 color=#ffffff00 fill=grad1 .box person width=50 height=50 color=red fill=red .sprite square_sprite .frame 1 .put square1 pin=center .frame 2 .action: gotoAndPlay(1); .end .end .sprite square .frame 1 .put move=square_sprite .action: if (c == undefined) { c = new Color(move); c.setRGB(0x00FED2); } .end .frame 2 .action: move.useHandCursor=1; var speed; if (life_duration == undefined) { life_duration = Math.round(200+(100*Math.random())); } if (speed == undefined) { speed = Math.round(10+3*Math.random()); } trace("speed = "+speed + "x = "+move._x + ", y = "+move._y); function isinside (x, y) { // trace("speed = "+speed + "x = "+x + ", y = "+y); if ((x>=0) && (x<=345) && (y>=0) && (y<=300)) { return true; } else { return false; } } function keepgoing (x, y) { if ((x>=197 || x<=147) || (y<=125 || y>=300)) { return true; } else { return false; } } absolute_x = move._parent._x+move._x; absolute_y = move._parent._y+move._y; if (isinside(absolute_x, absolute_y) && keepgoing(absolute_x, absolute_y)) { move._alpha = 100 * (1 - (move._y-200) / (life_duration-200)); } else { removeMovieClip(this); } move._parent._y += speed; move._parent._x -= speed; gotoAndPlay(1); .end .end #.box bg width=890 height=300 fill=black #.put mask x=172.5 y=260 pin=center rotate=-90 .put bg pin=center x=172 y=150 rotate=90 #.put person pin=center x=150 y=250 .png bgperso "personnage1.png" .box tex width=110 height=150 color=#FFFFFF00 fill=bgperso .put tex pin=center x=172 y=200 .frame 1 .action: var range; var x_pos, y_pos; if (Math.random() > 0.5) { change = true; range = 0; } else { change = false; range = 10; } for (var i=0; i<3; i++) { if (change) { x_pos = 2.5+340*Math.random(); } var mc = _root.attachMovie("square","square_mc"+getNextHighestDepth(),getNextHighestDepth(), {_x: x_pos-range*i, _y:0+range*i}); mc._rotation = 135; } //} //if (Math.random() > 0.5) { for (var i=0; i<3; i++) { if (change) { y_pos = 2.5+295*Math.random(); } var mc = _root.attachMovie("square","square_mc"+getNextHighestDepth(),getNextHighestDepth(), {_x: 345-range*i, _y:y_pos+range*i}); mc._rotation = 135; } //} //Mouse.hide(); .end .frame 15 .action: gotoAndPlay(1); .end .end