Solved

Adding preloader to existing fla

Posted on 2003-11-03
6
648 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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 285
SCCM 2012 - Deploy Flash 16 7,024
Google Chrome - Where is "Enable Resource Tracking" 2 12,201
System Center Configuration Manager 2012R2 7 90
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

840 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