Loader

12 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.91
List Price:  €92.74
You save:  €27.82
£55.84
List Price:  £79.77
You save:  £23.93
CA$95.73
List Price:  CA$136.76
You save:  CA$41.03
A$105.88
List Price:  A$151.27
You save:  A$45.38
S$94.74
List Price:  S$135.35
You save:  S$40.60
HK$546.74
List Price:  HK$781.10
You save:  HK$234.35
CHF 63.47
List Price:  CHF 90.67
You save:  CHF 27.20
NOK kr758.86
List Price:  NOK kr1,084.13
You save:  NOK kr325.27
DKK kr484.32
List Price:  DKK kr691.91
You save:  DKK kr207.59
NZ$116.44
List Price:  NZ$166.35
You save:  NZ$49.91
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳8,192.12
List Price:  ৳11,703.53
You save:  ৳3,511.41
₹5,845.24
List Price:  ₹8,350.71
You save:  ₹2,505.46
RM331.19
List Price:  RM473.15
You save:  RM141.96
₦101,684.97
List Price:  ₦145,270.47
You save:  ₦43,585.50
₨19,468.63
List Price:  ₨27,813.52
You save:  ₨8,344.89
฿2,574.93
List Price:  ฿3,678.63
You save:  ฿1,103.70
₺2,254.33
List Price:  ₺3,220.61
You save:  ₺966.27
B$360.86
List Price:  B$515.53
You save:  B$154.67
R1,285.96
List Price:  R1,837.17
You save:  R551.20
Лв126.94
List Price:  Лв181.36
You save:  Лв54.41
₩95,732.56
List Price:  ₩136,766.67
You save:  ₩41,034.10
₪261.33
List Price:  ₪373.34
You save:  ₪112.01
₱4,047.59
List Price:  ₱5,782.52
You save:  ₱1,734.93
¥10,909.97
List Price:  ¥15,586.34
You save:  ¥4,676.37
MX$1,171.54
List Price:  MX$1,673.70
You save:  MX$502.16
QR255.51
List Price:  QR365.03
You save:  QR109.52
P951.34
List Price:  P1,359.12
You save:  P407.77
KSh9,168.69
List Price:  KSh13,098.69
You save:  KSh3,930
E£3,292.89
List Price:  E£4,704.33
You save:  E£1,411.44
ብር4,020.45
List Price:  ብር5,743.75
You save:  ብር1,723.29
Kz58,375.85
List Price:  Kz83,397.65
You save:  Kz25,021.80
CLP$64,835.23
List Price:  CLP$92,625.73
You save:  CLP$27,790.50
CN¥506.35
List Price:  CN¥723.39
You save:  CN¥217.04
RD$4,074.29
List Price:  RD$5,820.67
You save:  RD$1,746.37
DA9,399.01
List Price:  DA13,427.73
You save:  DA4,028.72
FJ$158.92
List Price:  FJ$227.04
You save:  FJ$68.12
Q544.02
List Price:  Q777.21
You save:  Q233.18
GY$14,649.16
List Price:  GY$20,928.27
You save:  GY$6,279.10
ISK kr9,756.60
List Price:  ISK kr13,938.60
You save:  ISK kr4,182
DH701.90
List Price:  DH1,002.76
You save:  DH300.86
L1,242.81
List Price:  L1,775.52
You save:  L532.71
ден3,996.50
List Price:  ден5,709.54
You save:  ден1,713.03
MOP$563.52
List Price:  MOP$805.07
You save:  MOP$241.54
N$1,287.85
List Price:  N$1,839.87
You save:  N$552.01
C$2,577.61
List Price:  C$3,682.46
You save:  C$1,104.85
रु9,354.77
List Price:  रु13,364.54
You save:  रु4,009.76
S/258.41
List Price:  S/369.18
You save:  S/110.76
K271.72
List Price:  K388.19
You save:  K116.47
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,916.71
List Price:  ZK2,738.27
You save:  ZK821.56
L323.04
List Price:  L461.50
You save:  L138.46
Kč1,610.16
List Price:  Kč2,300.33
You save:  Kč690.17
Ft25,114.33
List Price:  Ft35,879.15
You save:  Ft10,764.82
SEK kr760.20
List Price:  SEK kr1,086.05
You save:  SEK kr325.84
ARS$61,800.59
List Price:  ARS$88,290.35
You save:  ARS$26,489.75
Bs483.82
List Price:  Bs691.20
You save:  Bs207.38
COP$272,193.39
List Price:  COP$388,864.37
You save:  COP$116,670.97
₡35,883.99
List Price:  ₡51,265.04
You save:  ₡15,381.05
L1,730.53
List Price:  L2,472.30
You save:  L741.76
₲524,817.92
List Price:  ₲749,772.03
You save:  ₲224,954.10
$U2,694.96
List Price:  $U3,850.11
You save:  $U1,155.14
zł278.08
List Price:  zł397.28
You save:  zł119.19
Already have an account? Log In

Transcript

Hi everyone, and welcome to our Aroha media video tutorials. In this tutorial, we are going to show you how to add a simple preloader to your external flash movie. These loaders are custom indicators that inform the viewer that content is being loaded into the flash player and informs the viewer the status of the loading. Let's start off by creating a new Flash movie with the ActionScript version 3.0 for a lightweight pre loader animation, our pre loaded file is going to have two things, the content and the action script out of them. The first thing we'll start with is the loader content. Pick the text tool and type loading on the stage.

Size and color of this text completely depends on your choice. Name this slide As loader, press Ctrl plus K to open the Align panel and get the text center aligned to the stage. convert this text into movie clip symbol type. For this, press f8 as a shortcut key, name this symbolic loader without extending any of the frames for this here, directly step inside this loader symbol. A simple animation will be worked out here, named this layer text. Press f6 on next frame and add a.in the text.

Add two more such dots on additional key frames as seen in the video. Each don't add it on an additional key frame. So a simple loading animation is done. to refer to this loader in ActionScript. We need to assign an instance name to it while your bar is select Did set load underscore MC as its instance name, test the movie to view the animation part. Press Ctrl plus S to save your file before further modifications name it loader.

Here you will notice that we have already a simple animated file ready with us named animation. This animation file should be loaded in our loader dot SWF file. Both the Flash files are saved in the same directory path. We now have our loading animation ready. So add another layer as action and press f9 on the only frame on it to open the Actions panel. We are going to code our loader now.

First of all, we will add a start load function in which all the loading process for the file will be coded. Now, we need a first video here, in which we will load the URL. This will be a loader variable. Add another variable for URL. This will send a request to the actual file to be loaded. Type the name of file URL here, that is animation dot SWF.

Now add the code for the action to happen after the loading part. Content loader info is the class that keeps track of some information about what's being loaded. Next, we will add the script for what action should happen during the loading progress. In this action script, the on progress handler function will be called on progress event. This creates an event object that contains information about the progress event. Now, the script for the loader to inform which URL is to be loaded.

For this URL, a variable is used. Here, the start load function ends. The next function we need to add is of the progress handler. This function starts when the download process begins in this Which animation should be played during the loading progress will be defined here at the instance name of the animated loader to be played that is, load underscore MC. Next will be the on complete handler function in which the part after the loader animation will be explained. This is dispatched when the file download process is finished load event current target content onload event the content on the current target is loaded.

That means the current target will actively process the event. We also don't need the The loader to be displayed when the file is completely loaded. So, adding a code to remove it this is complete on handler function. Now, add an action script to execute the start load function. Close this panel and press Ctrl plus Enter to test the movie as wF is directly playing the animation file. So, to view the loader Go to View simulate download.

Now, you see that loading part before this ball animation as this ball animation file is not that heavy, so that loading part is done very quickly. So finally, first the loader loads. Then loader is removed and the animation file is played as per the ActionScript. You can try it using any heavy animated file for better understanding This is one of the basic loaders. Let's see one more loader type with additional animation. Get a new Flash file for a new loader named the default layer as loader.

And on this frame, draw a rectangle like this. From the Properties panel, modify its width 200 as it will refer to hundred percent loading animation. Open aligned box by pressing Ctrl plus K and get this rectangle center aligned to the stage. Press f8 and convert this rectangle into a movie clip symbol. Also name it loader. Double click to enter this new symbol.

Our bar graphic is now on stage where we'll need its outline to be separated on a different glare. So, cut and paste in place on a new layer, named this outline layer as border and bar layer as color. This color is the part which will expand as the loading process. So, to show that way, add another layer as mask about the color layer and paste the same color bar on this mask layer to hide the mask layer to select the color bar. Press f8 and convert this color again into a new movie clip. shift its registration point to center left and name it color to interact with the ActionScript.

Set its instance name as color underscore MC. Now right click on the mask layer to add the mask effect. Exit to main scene here to this loader will be needed in ActionScript. So given instance named as load underscore MC. Before moving ahead, save this file as loader in the same folder path, where the animation file is saved. This animation file is supposed to be loaded after the loader.

Now, add another new layer for the action script. So, name it action on this action blank frame, open the action panel. Similar to the first loader we have already created here, all the action script part all three start load on the progress handler and on the complete handler functions, and at the end of the script to call the function on start load. The only change here will be in the on progress handler function part. As said earlier, this function starts when the download process begins. In this, which animation should be played during the loading process.

Progress will be defined. So, for this file, it's a different loader. According to this loader animation, the color will show the film progress till it reaches the outline. First, we will start with a variable named percent in which numerical values will be stored. That means, the value from the loaded file size divided by actual full file size will be stored in this variable bytes loaded is the class divided by bytes total class. This shows the information till now loaded divided by total information to be loaded this way we get the percent value.

Now, according to this value outline box should be filled in proper proportion. So, add one more script to it The actual value of the percentage is shown between 0.1 to one formats, but we need to show the percentage between zero to hundred. For that, we need to multiply the percent value by 100. Rest everything is added. Let's test the movie. You can import any large animation or video from the same path as well.

To view how the preloader works, go through view, simulate download, or just press Ctrl plus enter twice to do the same thing. You can see the color bar progressing till the animation file loads. Similarly, you can create your own shapes and stylish loaders for your files. That's it. We are done for now. We hope that you learn something new from it.

Thank you for watching.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.