STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228138
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5122

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/71787034?noj=FRM71787034-17DC" width="1" height="1"></div>

Flash TUT - Preloader.swf

This is the info page for
Flash #57338

(Click the ID number above for more basic data on this flash file.)


Text
Loading

Preloaders

Mak

START

START

This is a tutorial on how to create preloaders in Flash, with and without a loading bar.
Preloaders should make your animations run more smoothly since it will load the whole
thing before playing. If your file is small, then there's no reason for a preloader for
obvious reasons but if it's pretty big, you might want to consider making one. There are
many ways to make preloaders. These are just two of them.
This tutorial was written for Flash CS3 Professional, but it works the same with previous
versions of Flash with a few changes.
Use the buttons on the bottom right to navigate. Click > to continue, < to go back and «
to come back here.
If you want to skip to the preloader without the bar,                .

click here

click here

Create a new Flash Document. It should already be open when you open Flash. If not, go
to File > New or press Ctrl+N. If a box comes up, select Flash File (ActionScript 2.0).
Set the dimensions of the file (default: 550x400) and background color if you want.
Make sure you can see the Timeline shown below. If you don't, go to Window and make
sure Timeline is checked or press Ctrl+Alt+T.

Preloaders - Bar

In the Timeline, you will see a layer called Layer 1. Double-click on it or select Modify >
Timeline > Layer Properties... and rename the layer Bar.
Click on the Rectangle Tool     or press R. The properties should appear. If not, select
Window > Properties and make sure Properties is checked or press Ctrl+F3.

Change the properties to whatever you want. In this example, it is set to hairline, Stroke
color black and Fill color red.
Draw a rectangle wherever you want your preloader to be. Make it any size you want. It
should look something like this:
If your bar does not have a stroke, you can skip this step.
If you have a stroke, double-click on it to select it. Now ONLY the outline should be
selected, as shown below.
Now select Edit > Cut or press Ctrl+X to cut it.

Create a new layer by clicking on the Insert Layer icon     in the Timeline or by selecting
Insert > Timeline > Layer. A new layer should appear in the Timeline. Double-click on it
and rename it Outline.
With this layer selected, paste the stroke you just cut by selecting Edit > Paste in Place
or by pressing Ctrl+Shift+V. The outline should appear in the exact same place except
on a different layer.

Select the layer named Bar. This should select the bar on that layer. It should be the
ONLY thing selected. Do not select the stroke if you have one.
Change this to a movie clip by selecting Modify > Convert to Symbol... or by pressing
F8. A box will appear. In the Name box, give your symbol any name such as Bar. Make
sure the Type is set to Movie Clip and the Registration is at the top left corner. Click OK
when you're done.

Make sure the bar is still selected. In the Properties box, change the <Instance Name> to
BAR. Make sure you type it exactly like that.
Create a new layer by clicking on the Insert Layer icon     in the Timeline or by selecting
Insert > Timeline > Layer. A new layer should appear in the Timeline. Double-click on it
and rename it Percent.

Select the Text Tool or press A. In the Properties box, change the Text Type to Dynamic
Text. Then adjust the font, size and color to whatever you want the percentage to look
like.

With the Text Tool (T)     and the third layer (Percent) still selected, click and drag a
text box onto the document (wherever you want the percentage to appear). Make it long
enough to fit 4 characters since it will have to say "100%" later. Do not type anything in
the text box. It should look like the picture below. As you can see, I have the percentage
on top of the bar in my file.

In the Properties window, you will notice a box that says Var: and a white box after it.
Type in TEXT in the box as shown below. Make sure you type it exactly like that.

Now create another new layer by clicking on the Insert Layer icon    . Rename this layer
to Actions. Your layers should look something like this by now. If not, drag whatever you
need to its appropriate place.
With the Actions layer selected, insert a blank keyframe by pressing F7 or by selecting
Insert > Blank Keyframe. Your timeline should now look like this:

Select the first keyframe of the Actions layer as shown below. To make sure you have
the frame selected, make sure your Actions window says Actions - Frame. If you don't
have the Actions window open, select Window > Actions or press F2.
Open the Actions window and it should look something like the image below.

Make sure you select
ActionScript 1.0 & 2.0

Now put the following into the box:
The part that says BAR._width = PERCENT*200; is the width of your bar. You can change
the number to the width of your bar. You can check by clicking on the bar (not the
stroke) and it should say so in the Properties window. This is the ONLY part you need to
change!

LOADED = Math.round(getBytesLoaded());
TOTAL = Math.round(getBytesTotal());
PERCENT = LOADED/TOTAL;
BAR._width = PERCENT*200;
TEXT = Math.round(PERCENT*100)+"%";
if (LOADED == TOTAL) {
gotoAndPlay(3);
}

Select it.

Find the width.

Select the second keyframe in the Actions layer. You
will notice the first keyframe has the letter a in it.
This indicates that an action has been placed. Again,
open the Actions window to make sure the tab says
Actions - Frame. The box should be blank. Type in
the following:
Close the Actions window and you will see that an a has appeared on the second
keyframe.
Insert a frame on each of the other layers by selecting the layer and selecting Insert >
Frame or by pressing F5. Your layers should now look something like this:

gotoAndPlay(1);

Insert a new layer and start your animation but make sure you start it on the THIRD
keyframe. The frames before the third keyframe should be blank.
That's all for preloaders with bars.
Click the > button if you want to learn how to make a preloader without the bar.

Preloaders - No Bar

Double-click on Layer 1 and rename it Percent.
Select the Text Tool (T)    . The Properties should appear. If not, go to Window >
Properties or press Ctrl+F3. Set the text to Dynamic Text. Set the font to whatever you
want.

With the Text Tool (T)     selected, click and drag a text box onto the file wherever you
want the percentage to appear. Make sure it's long enough to fit 4 characters. Do not
type anything in the box. It should look something like the picture below.
In the Properties window, there should be a box that says <Instance Name>. Change it
to myOutput. Type it exactly like that.

Create a new layer by clicking on the Insert Layer icon    . Rename this layer Actions.
With the Actions layer selected, insert a blank keyframe by pressing F7 or selecting
Insert > Blank Keyframe. Your Timeline should now look like this:

Now put the following into the box:

percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
myOutput.text = percent + "%";

Select the second keyframe in the Actions layer. You
will notice the first keyframe has the letter a in it.
This indicates that an action has been placed. Again,
open the Actions window to make sure the tab says
Actions - Frame. The box should be blank. Type in
the following:
Close the Actions window and you will see that an a has appeared on the second
keyframe.
in the Percent layer by selecting the layer and selecting Insert > Frame or by pressing
F5. Your layers should look like this:

if (percent == 100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);
}

Insert a new layer and start your animation but make sure you start it on the THIRD
keyframe. The frames before the third keyframe should be blank.

That's all for this tutorial.
If you have any questions, feel free to ask me.

ActionScript [AS1/AS2]

Frame 1
LOADED = Math.round(getBytesLoaded()); TOTAL = Math.round(getBytesTotal()); PERCENT = LOADED / TOTAL; BAR._width = PERCENT * 200; TEXT = Math.round(PERCENT * 100) + "%"; if (LOADED == TOTAL) { gotoAndPlay (3); }
Frame 2
gotoAndPlay (1);
Frame 3
stop();
Frame 4
stop();
Symbol 20 Button
on (release) { gotoAndPlay (4); }
Symbol 27 Button
on (release) { gotoAndStop (19); }
Symbol 34 Button
on (release) { gotoAndStop (4); }
Symbol 38 Button
on (release) { gotoAndStop (5); }
Symbol 42 Button
on (release) { gotoAndStop (4); }
Symbol 48 Button
on (release) { gotoAndPlay (4); }
Symbol 49 Button
on (release) { gotoAndStop (6); }
Symbol 50 Button
on (release) { gotoAndStop (5); }
Symbol 56 Button
on (release) { gotoAndStop (7); }
Symbol 59 Button
on (release) { gotoAndStop (8); }
Symbol 60 Button
on (release) { gotoAndStop (6); }
Symbol 66 Button
on (release) { gotoAndStop (9); }
Symbol 67 Button
on (release) { gotoAndStop (7); }
Symbol 71 Button
on (release) { gotoAndStop (10); }
Symbol 72 Button
on (release) { gotoAndStop (8); }
Symbol 77 Button
on (release) { gotoAndStop (11); }
Symbol 78 Button
on (release) { gotoAndStop (9); }
Symbol 82 Button
on (release) { gotoAndStop (12); }
Symbol 83 Button
on (release) { gotoAndStop (10); }
Symbol 88 Button
on (release) { gotoAndStop (13); }
Symbol 89 Button
on (release) { gotoAndStop (11); }
Symbol 93 Button
on (release) { gotoAndStop (14); }
Symbol 94 Button
on (release) { gotoAndStop (12); }
Symbol 99 Button
on (release) { gotoAndStop (15); }
Symbol 100 Button
on (release) { gotoAndStop (13); }
Symbol 108 Button
on (release) { gotoAndStop (16); }
Symbol 109 Button
on (release) { gotoAndStop (14); }
Symbol 119 Button
on (release) { gotoAndStop (17); }
Symbol 120 Button
on (release) { gotoAndStop (15); }
Symbol 127 Button
on (release) { gotoAndStop (18); }
Symbol 128 Button
on (release) { gotoAndStop (16); }
Symbol 132 Button
on (release) { gotoAndStop (19); }
Symbol 133 Button
on (release) { gotoAndStop (17); }
Symbol 135 Button
on (release) { gotoAndStop (20); }
Symbol 136 Button
on (release) { gotoAndStop (18); }
Symbol 141 Button
on (release) { gotoAndStop (21); }
Symbol 142 Button
on (release) { gotoAndStop (19); }
Symbol 147 Button
on (release) { gotoAndStop (22); }
Symbol 148 Button
on (release) { gotoAndStop (20); }
Symbol 152 Button
on (release) { gotoAndStop (23); }
Symbol 153 Button
on (release) { gotoAndStop (21); }
Symbol 155 Button
on (release) { gotoAndStop (24); }
Symbol 156 Button
on (release) { gotoAndStop (22); }
Symbol 159 Button
on (release) { gotoAndStop (25); }
Symbol 160 Button
on (release) { gotoAndStop (23); }
Symbol 165 Button
on (release) { gotoAndStop (26); }
Symbol 166 Button
on (release) { gotoAndStop (24); }
Symbol 169 Button
on (release) { gotoAndStop (27); }
Symbol 170 Button
on (release) { gotoAndStop (25); }

Library Items

Symbol 1 GraphicUsed by:Timeline
Symbol 2 FontUsed by:3 15
Symbol 3 EditableTextUses:2Used by:Timeline
Symbol 4 FontUsed by:5 22 44 51 57 61 68 73 79 84 90 95 101 110 115 118 121 129 137 143 149 157 161 167 171
Symbol 5 TextUses:4Used by:Timeline
Symbol 6 GraphicUsed by:7
Symbol 7 MovieClipUses:6Used by:Timeline
Symbol 8 GraphicUsed by:Timeline
Symbol 9 FontUsed by:10 47 134
Symbol 10 TextUses:9Used by:Timeline
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClipUses:11Used by:Timeline
Symbol 13 FontUsed by:14
Symbol 14 TextUses:13Used by:Timeline
Symbol 15 EditableTextUses:2Used by:Timeline
Symbol 16 FontUsed by:17 18
Symbol 17 TextUses:16Used by:20
Symbol 18 TextUses:16Used by:20
Symbol 19 GraphicUsed by:20
Symbol 20 ButtonUses:17 18 19Used by:Timeline
Symbol 21 FontUsed by:22
Symbol 22 TextUses:4 21Used by:Timeline
Symbol 23 FontUsed by:24 25 44 51 57 61 68 73 79 84 95 101 106 121 129 137 143 149
Symbol 24 TextUses:23Used by:27
Symbol 25 TextUses:23Used by:27
Symbol 26 GraphicUsed by:27
Symbol 27 ButtonUses:24 25 26Used by:Timeline
Symbol 28 GraphicUsed by:Timeline
Symbol 29 GraphicUsed by:34 38 42 48 49 50 56 59 60 66 67 71 72 77 78 82 83 88 89 93 94 99 100 108 109 119 120 127 128 132 133 135 136 141 142 147 148 152 153 155 156 159 160 165 166 169 170
Symbol 30 GraphicUsed by:34 48
Symbol 31 GraphicUsed by:34 48
Symbol 32 GraphicUsed by:34 48
Symbol 33 GraphicUsed by:34 38 42 48 49 50 56 59 60 66 67 71 72 77 78 82 83 88 89 93 94 99 100 108 109 119 120 127 128 132 133 135 136 141 142 147 148 152 153 155 156 159 160 165 166 169 170
Symbol 34 ButtonUses:29 30 31 32 33Used by:Timeline
Symbol 35 GraphicUsed by:38 49 56 59 66 71 77 82 88 93 99 108 119 127 132 135 141 147 152 155 159 165 169
Symbol 36 GraphicUsed by:38 49 56 59 66 71 77 82 88 93 99 108 119 127 132 135 141 147 152 155 159 165 169
Symbol 37 GraphicUsed by:38 49 56 59 66 71 77 82 88 93 99 108 119 127 132 135 141 147 152 155 159 165 169
Symbol 38 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 39 GraphicUsed by:42 50 60 67 72 78 83 89 94 100 109 120 128 133 136 142 148 153 156 160 166 170
Symbol 40 GraphicUsed by:42 50 60 67 72 78 83 89 94 100 109 120 128 133 136 142 148 153 156 160 166 170
Symbol 41 GraphicUsed by:42 50 60 67 72 78 83 89 94 100 109 120 128 133 136 142 148 153 156 160 166 170
Symbol 42 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 43 FontUsed by:44 51 57 61 68 73 79 90 95 101 110 121 137 143 149 161
Symbol 44 TextUses:4 23 43Used by:Timeline
Symbol 45 BitmapUsed by:46
Symbol 46 GraphicUses:45Used by:Timeline
Symbol 47 TextUses:9Used by:Timeline
Symbol 48 ButtonUses:29 30 31 32 33Used by:Timeline
Symbol 49 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 50 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 51 TextUses:4 43 23Used by:Timeline
Symbol 52 BitmapUsed by:55
Symbol 53 BitmapUsed by:55
Symbol 54 BitmapUsed by:55
Symbol 55 GraphicUses:52 53 54Used by:Timeline
Symbol 56 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 57 TextUses:4 43 23Used by:Timeline
Symbol 58 GraphicUsed by:Timeline
Symbol 59 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 60 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 61 TextUses:4 23 43Used by:Timeline
Symbol 62 TextUsed by:Timeline
Symbol 63 BitmapUsed by:65
Symbol 64 BitmapUsed by:65 76 98 151
Symbol 65 GraphicUses:63 64Used by:Timeline
Symbol 66 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 67 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 68 TextUses:4 43 23Used by:Timeline
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:Timeline
Symbol 71 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 72 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 73 TextUses:4 43 23Used by:Timeline
Symbol 74 BitmapUsed by:76
Symbol 75 BitmapUsed by:76
Symbol 76 GraphicUses:74 64 75Used by:Timeline
Symbol 77 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 78 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 79 TextUses:4 23 43Used by:Timeline
Symbol 80 BitmapUsed by:81
Symbol 81 GraphicUses:80Used by:Timeline
Symbol 82 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 83 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 84 TextUses:4 23Used by:Timeline
Symbol 85 BitmapUsed by:87 140 146
Symbol 86 BitmapUsed by:87
Symbol 87 GraphicUses:85 86Used by:Timeline
Symbol 88 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 89 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 90 TextUses:4 43Used by:Timeline
Symbol 91 BitmapUsed by:92
Symbol 92 GraphicUses:91Used by:Timeline
Symbol 93 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 94 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 95 TextUses:4 23 43Used by:Timeline
Symbol 96 BitmapUsed by:98
Symbol 97 BitmapUsed by:98
Symbol 98 GraphicUses:96 97 64Used by:Timeline
Symbol 99 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 100 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 101 TextUses:4 43 23Used by:Timeline
Symbol 102 BitmapUsed by:105 154
Symbol 103 BitmapUsed by:105 154
Symbol 104 BitmapUsed by:105 154
Symbol 105 GraphicUses:102 103 104Used by:Timeline
Symbol 106 TextUses:23Used by:Timeline
Symbol 107 GraphicUsed by:Timeline
Symbol 108 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 109 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 110 TextUses:4 43Used by:Timeline
Symbol 111 FontUsed by:112 122 158 162
Symbol 112 EditableTextUses:111Used by:Timeline
Symbol 113 BitmapUsed by:114
Symbol 114 GraphicUses:113Used by:Timeline
Symbol 115 TextUses:4Used by:Timeline
Symbol 116 BitmapUsed by:117
Symbol 117 GraphicUses:116Used by:Timeline
Symbol 118 TextUses:4Used by:Timeline
Symbol 119 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 120 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 121 TextUses:4 43 23Used by:Timeline
Symbol 122 EditableTextUses:111Used by:Timeline
Symbol 123 BitmapUsed by:126 164
Symbol 124 BitmapUsed by:126 164
Symbol 125 BitmapUsed by:126
Symbol 126 GraphicUses:123 124 125Used by:Timeline
Symbol 127 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 128 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 129 TextUses:4 23Used by:Timeline
Symbol 130 BitmapUsed by:131 168
Symbol 131 GraphicUses:130Used by:Timeline
Symbol 132 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 133 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 134 TextUses:9Used by:Timeline
Symbol 135 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 136 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 137 TextUses:4 43 23Used by:Timeline
Symbol 138 BitmapUsed by:140
Symbol 139 BitmapUsed by:140
Symbol 140 GraphicUses:138 85 139Used by:Timeline
Symbol 141 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 142 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 143 TextUses:4 23 43Used by:Timeline
Symbol 144 BitmapUsed by:146
Symbol 145 BitmapUsed by:146
Symbol 146 GraphicUses:144 145 85Used by:Timeline
Symbol 147 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 148 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 149 TextUses:4 23 43Used by:Timeline
Symbol 150 BitmapUsed by:151
Symbol 151 GraphicUses:150 64Used by:Timeline
Symbol 152 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 153 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 154 GraphicUses:102 103 104Used by:Timeline
Symbol 155 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 156 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 157 TextUses:4Used by:Timeline
Symbol 158 EditableTextUses:111Used by:Timeline
Symbol 159 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 160 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 161 TextUses:4 43Used by:Timeline
Symbol 162 EditableTextUses:111Used by:Timeline
Symbol 163 BitmapUsed by:164
Symbol 164 GraphicUses:163 123 124Used by:Timeline
Symbol 165 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 166 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 167 TextUses:4Used by:Timeline
Symbol 168 GraphicUses:130Used by:Timeline
Symbol 169 ButtonUses:29 35 36 37 33Used by:Timeline
Symbol 170 ButtonUses:29 39 40 41 33Used by:Timeline
Symbol 171 TextUses:4Used by:Timeline

Instance Names

"BAR"Frame 1Symbol 7 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
Protect (24)Timeline Frame 131 bytes "..$1$t5$dwCT4RsdQd1jrVi2DmVjt1."

Dynamic Text Variables

TEXTSymbol 3 EditableText""
TEXTSymbol 15 EditableText""




http://swfchan.com/12/57338/info.shtml
Created: 18/4 -2019 07:08:05 Last modified: 18/4 -2019 07:08:05 Server time: 17/05 -2024 20:22:38