Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adding preloader to existing fla

Posted on 2003-11-03
6
Medium Priority
?
660 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 1000 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 1000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

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. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

721 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