Toxiclab.org

Shine Text Effect

25.3.2006, 21:12
Submited in: Flash | Total Views: 140367

In this lesson, I will explain to how to create advanced shine text effect in flash, using the Action Script. You will also see how to use Align Panel (Ctrl+K), how to use instance name and how to apply action script on text. This text effect is very practical and you can use it for some header, banner or something else.



Example:



Step 1

Open a new Flash document. Select Modify > Document (shortcut key: Ctrl+J). Set the width of your document to 300 pixels and the height to 100 pixels. For Frame rate set 28 fps (Frames per Second), and click ok.





Step 2


Take the Text Tool (A), go to the Properties Panel (Ctrl+F3) below the stage and choose font, size and color which you like, and type any text. For this example I'll type toxiclab.org.

While the text is still selected, go to the Align Panel (shortcut: Ctrl+K). Then, do the following in the Align panel:

a) Make sure that the Align/Distribute to Stage button is turned on
b) Click on the Align horizontal center button and
c) Click the Align vertical center button.





Step 3

Press Ctrl+A key to select your text, and after that press F8 key (Convert to symbol) to convert that text into a Movie Clip Symbol. See the picture below.



Step 4

Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip. Then, while the text is still selected, press again F8 key (Concert to symbol) to convert again that text into a Movie Clip. See the picture below.



After that, open the Properties Panel (Ctrl+F3) and for <instance name> type shine.



Step 5

Lock layer 1, create a new layer above layer 1 and name it Action.



Step 6

Click on the first frame of layer Action, open the Action Script Panel (F9) and paste this script:

maxlight = "28";
dxstep = "0.08";
dx = "0.9";
setProperty("shine", _visible, "0");


After that click on the second frame, press F6, and paste this script:

i = "1";
while (Number(i)<=Number(maxlight)) {
duplicateMovieClip("shine", "li" add i, i);
setProperty("li" add i, _xscale, getProperty("li" add (i-1),_xscale)+i*0.3);
setProperty("li" add i, _yscale, getProperty("li" add (i-1),_yscale)+i*0.3);
setProperty("li" add i, _alpha, 10-i*(10/50));
setProperty("li" add i, _x, getProperty("li" add (i-1),_x)+i*dx);
i = Number(i)+1;
}


Then click on third frame, press F6, and paste this script:

dx = dx-dxstep;
if (Number(dx)>0.9 or Number(dx)<Number(-0.9)) {
dxstep = -dxstep;
}
i = 1;
while (Number(i)<=Number(maxlight)) {
setProperty("li" add i, _x, getProperty("li" add (i-1),_x)+i*dx);
setProperty("li" add i, _y, getProperty("li" add (i-1),_y)+i*dx/20);
i = Number(i)+1;
}


And finally click on frame 4, press F6 and paste this script:

gotoAndPlay(_currentframe-1);




Step 7

Unlock layer 1 and double-click on the movie clip on stage with the Selection tool (V).

Step 8

While the text is still selected press again F8 key  (Convert to symbol) to convert it again into a Movie Clip Symbol.



Step 9

Go to the Properties Panel (Ctrl+F3) below the stage, and for <instance name> type shine again. See the picture below.



Step 10

Click on frame 15 and press F6 key. Then, take the Free Transform Tool (Q) and do like it is shown on the picture below.



Step 11

Click after that on thirtieth frame, press F6 , take again the Free Transform Tool (Q) and do this:



Step 12

Repeat steps 10 and 11 few times!

Step 13

Go back on the main scene (Scene1), create a new layer above layer 1 and name it ActionScript.





Step 14

Click on first frame of layer ActionScript, open the Action Script Panel (F9) and paste this script:

toggleHighQuality();
startDrag("/mxy", true);


After that click on second frame and paste this script:

stop();


We're done!

Enjoy!

Download example (28 KB)

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category


Most popular tutorials


Resources Worth visiting


Friends