Solved

Adding preloader to existing fla

Posted on 2003-11-03
6
649 Views
Last Modified: 2009-01-01
I have an existing fla project.  I need to add a preloader screen to the project.  Can anyone give me a suggestion on how to do this.  I have found several preloader's but when I try to add to the existing fla, the preloader does not work.  I am adding the additional layers for the preloader to the top of the timeline and I move the existing movie frames over ~10 frames (to the end of the preloader).  When I run the movie, the preloader does not run but the movie starts immediately.  Sometimes the preloader shows up after the movie plays.

The movie that I am using is a rather large file and my customers that are on slow connections will not like not seeing anything happen while the movie loads.

Thanks,

Craig
0
Comment
Question by:Craig Sharp
6 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 250 total points
ID: 9670836
• start from you existing fla
• open the "Scene Panel"
• add a new Scene with the "+" button
• rename the new Scene: "preloader"
• click and drag the preloader scene *over* the previously existing  scene/s
• go the main timeline of the preloader scene, which at this time should be empty
• add a second frame to this timeline
• drop this code on the first frame:

car = _root.getBytesLoaded();
tot = _root.getBytesTotal();
if(car == tot){
      _root.gotoAndPlay(3);
}

• drop this code on the next frame:

gotoAndPlay(1);


This is the base code for a preloader. To see it work, you have to test it in the "preview" mode, or on line. If your movie is made to loop (start again when i reaches the last frame), go to the last frame of the last scene, and write on that frame:

_root.gotoAndPlay(3);

)
0
 

Assisted Solution

by:master_of_puppetz
master_of_puppetz earned 250 total points
ID: 9674771
Hi:
you can do this

create four dynamic text:
_________________
|________________| KB Loaded  // you will write in var 'loadedkb'
_________________
|________________| Total KB  // you will write in var 'totalkb'
_________________
|________________| Remaining KB  // you will write in var 'remainingkb'
_________________
|________________| Percent Done  // you will write in var 'percent_done'

ok, then select all and click 'F8' or go to Modify>Convert to Symbol... and put a name.
Now give an instance name, something like 'preloader' and in the first frame of main movie, not the movie clip, write this: stop();

Now click the movie clip and in the actions panel write this:
onClipEvent (enterFrame) {
      // bytes
      total_bytes = _root.getBytesTotal();
      loaded_bytes = _root.getBytesLoaded();
      remaining_bytes = total_bytes-loaded_bytes;
      // kilo bytes
      totalkb = int(total_bytes/1024) add " KB";
      loadedkb = int(loaded_bytes/1024) add " KB";
      remaining_kb = int(remaining_bytes/1024);
      remainingkb = int(remaining_kb) add " KB";
      percent_done = int((loaded_bytes/total_bytes)*100) add "%";
      //If the complete movie is loaded it will go to frame 2
      if (totalkb == loadedkb) {
            _level0.gotoAndPlay(2);
      }
}

Well, I think its all, any doubt just tell.
Bye ;)
0
 
LVL 3

Author Comment

by:Craig Sharp
ID: 9675788
Thanks for the replies!

Nagatyve...What do you mean by "click and drag the preloader scene *over* the previously existing  scene/s" ???

Master..Looks interesting, I will give it a try.

Thanks,

Craig
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:negatyve
ID: 9680468
>What do you mean by "click and drag the preloader scene *over* the previously existing  scene/s"

it the scene panel, you can click a scene name and drag it before other scenes names. that means that the scene will be played before the other scenes, as the playing order is (looking at the scene panel) from up --> bottom
0
 
LVL 3

Author Comment

by:Craig Sharp
ID: 9691435
Got it working!  Used a combination of both replies.  Thanks for the help!!!
0
 

Expert Comment

by:paulddaw
ID: 9702001
iT WORKS FOR ME THANKS FOR THE POST
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't get text from a text entry 13 295
flash cs6 4 349
Rotating Adobe pdf document 4 330
You Tube Videos not playing 9 136
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question