Solved

Adding preloader to existing fla

Posted on 2003-11-03
6
640 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
Comment Utility
• 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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 27

Expert Comment

by:negatyve
Comment Utility
>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
Comment Utility
Got it working!  Used a combination of both replies.  Thanks for the help!!!
0
 

Expert Comment

by:paulddaw
Comment Utility
iT WORKS FOR ME THANKS FOR THE POST
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now