No idea why. * / $s - setLeftFill( $s - addFill(0xff, 0xff, 0xff)); $s - movePenTo(-40, -40); $s - drawLine(80, 0); $s - drawLine(0, 80); $s - drawLine(-80, 0); $s - drawLine(0, -80); $s = $r - getShape2(); $s - setLeftFill($s - addFill(0x00, 0x00, 0x00)); $s - movePenTo(-1, -1); $s - drawLine(2, 0); $s - drawLine(0, 2); $s - drawLine(-2, 0); $s - drawLine(0, -2); / * sprite container for morphing box - this is just a timeline w / the box morphing * / $box = new SWFSprite(); $box - add(new SWFAction( "stop(); ")); $i = $box - add($r); for($n=0; $n =20; ++$n) {$i - setRatio($n / 20); $box - nextFrame();} / * this container sprite allows us to use the same action code many times * / $cell = new SWFSprite(); $i = $cell - add($box); $i - setName('box'); $cell - add(new SWFAction(" setTarget('box'); / * ...x means the x coordinate of the parent, i.e. (. .).x * / dx = (/ mouse.x + random(6)-3 - ...x) / 5; dy = (/ mouse.y + random(6)-3 - ...y) / 5; gotoFrame(int(dx*dx + dy*dy)); ")); $cell - nextFrame(); $cell - add(new SWFAction( "gotoFrame(0); play(); ")); $cell - nextFrame(); / * finally, add a bunch of the cells to the movie * / for($x=0; $x 12; ++$x) {for($y=0; $y 8; ++$y) {$i = $m - add($cell); $i - moveTo(100*$x+50, 100*$y+50);}} $m - nextFrame(); $m - add(new SWFAction(" gotoFrame(1); play(); ")); header('Content-type: application / x-shockwave-flash'); $m - output();?
Aucune idée de pourquoi * / $s - setLeftFill( $s - addFill(0xff, 0xff, 0xff)); $s - movePenTo(-40, -40); $s - drawLine(80, 0); $s - drawLine(0, 80); $s - drawLine(-80, 0); $s - drawLine(0, -80); $s = $r - getShape2(); $s - setLeftFill($s - addFill(0x00, 0x00, 0x00)); $s - movePenTo(-1, -1); $s - drawLine(2, 0); $s - drawLine(0, 2); $s - drawLine(-2, 0); $s - drawLine(0, -2); / * sprite contenant la boîte de morphing - c'est juste un scénario avec une boîte de morphing * / $box = new SWFSprite(); $box - add(new SWFAction( "stop(); ")); $i = $box - add($r); for($n=0; $n =20; ++$n) {$i - setRatio($n / 20); $box - nextFrame();} / * ce conteneur nous permet d'utiliser la même action plusieurs fois * / $cell = new SWFSprite(); $i = $cell - add($box); $i - setName('box'); $cell - add(new SWFAction(" setTarget('box'); / * ...x signifie abscisse du parent, c'est-à-dire (. .).x * / dx = (/ mouse.x + random(6)-3 - ...x) / 5; dy = (/ mouse.y + random(6)-3 - ...y) / 5; gotoFrame(int(dx*dx + dy*dy)); ")); $cell - nextFrame(); $cell - add(new SWFAction( "gotoFrame(0); play(); ")); $cell - nextFrame(); / * finalement, ajoutons quelques cellules à l'animation * / for($x=0; $x 12; ++$x) {for($y=0; $y8; ++$y) {$i = $m - add($cell); $i - moveTo(100*$x+50, 100*$y+50);}} $m - nextFrame(); $m - add(new SWFAction(" gotoFrame(1); play(); ")); header('Content-type: application / x-shockwave-flash'); $m - output();?