Blur (DuplicateSprite)

 

The purpose is to show a Blur effect only with script. I suppose you know well how to create objects, thus I will not insist on.

⇒ animation ⇐

Creating Object.

1 - Set up movie sizes 320x240 (background color #000099).
Frame Rate 25.

2 - Create an horizontal line centered on the stage :
X = 160 Y = 120 W = 80 thickness = 1 color #FFCC00.
Note : Anchor point must be center

3 - Convert this line into sprite ( name : ligne , target toggled )
Menu Modify / Convert / Convert to sprite.

Scripts

In Outline, select Scene_1. Entrez le script suivant :

onLoad ()
{ // sprites
     nombre= 26;
}
onFrame (1,afterPlacedObjectEvents)
{
     for (i=1; i < nombre; i++)
     {
          duplicateSprite(_root.ligne, "ligne"+i, i);
          ("ligne"+i)._rotation = 360 - i; // startup position
          ("ligne"+i)._alpha = 2*(nombre-i); // decrease alpha progressivement
     }
}

In Outline, select sprite ligne. Entrez le script :

onEnterFrame(includingFirstFrame) { _rotation += 10; }

'Et voilà'. You 've got an airscrew 3D effect in a very simple way.

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.004 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google