Solved

Adding preloader to existing fla

Posted on 2003-11-03
6
655 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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 goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

624 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