Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Preloading My Movie?

Posted on 2000-02-23
9
Medium Priority
?
224 Views
Last Modified: 2010-04-03
How do I preload my flash movie, including sound, pictures and everything so that when the movie plays, there is no delay in it?

Also, how do i create a loading percentage progress bar indicator?
0
Comment
Question by:mhdhallak
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:SuperMario
ID: 2556497
Get your total frame number. if you have 2 scenes, for example, and one is 200 and the other is 100 frames, your total would be 300.

Now, since you have 300 frames to load, every 3 frames that are loaded, that counts as one percent. But since we don't want 100 frames in our little preloader movie, let's make it 30 frames.

Make the progress bar movie with a stop action in the first frame. Then 1 frame down, have an image of the progress bar extending a little. You should have 10 frames total.

Now, in your preloading scene:

You need to code a lot of ActionScript here. Place an instance of your progress bar on the stage and call it "progress" .

You should look at this URL (which I'll put up in a few minutes) to further your understanding, because it's very hard to explain and quite a long process. I'll post a comment when the test .fla is uploaded.

I hope this helps you!

-Dan
0
 
LVL 3

Expert Comment

by:SuperMario
ID: 2556557
Here's the URL for the FLA file. To view it and see the preloader in action, go to Control -> View Movie, then it Control + Enter which will invoke streaming.
0
 

Author Comment

by:mhdhallak
ID: 2556762
What is the URL? I think you forgot to include it in your comment.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Expert Comment

by:SuperMario
ID: 2557778
Oh, you're right! I'm sorry.

http://www.catapultic.com/preload.fla

-Dan
0
 
LVL 2

Expert Comment

by:coopa
ID: 2600375
Supermario wrote...
> Now, since you have 300 frames to
> load, every 3 frames that are loaded,
> that counts as one percent. But since
> we don't want 100 frames in our
> little preloader movie, let's make it
> 30 frames.

Why not use this...

Set Variable: "LoadedFrames" = GetProperty ( "/", _framesloaded)
Set Variable: "totalFrames" = GetProperty ( "/",_totalframes)
Set Variable: "LOADEDsofar" = int((loadedFrames / totalFrames) *100) & "%"

If (loadedFrames < totalFrames)
      Go to and Play ("notloaded")
Else
      Go to and Play ("loaded")
End If

Where:-
LOADEDsofar = a text box variable (that displays the percentage loaded)
notloaded = a label used to loop again
loaded = a label used to skip the loop.

It's a little more complex but the results are better...  check out http://www.coopa.demon.co.uk/new/hifi.htm for a working example.
0
 

Author Comment

by:mhdhallak
ID: 2602775
Hi Coopa,

Ok. It seems good to me. But where should I put this script? i.e., in which frame?
0
 
LVL 3

Expert Comment

by:SuperMario
ID: 2602871
Coopa's got this one - that's definitely a better solution if you're ready to tackle it =)

-Dan
0
 
LVL 2

Accepted Solution

by:
coopa earned 80 total points
ID: 2603685
Okay you use it like this...

1. Label in the first frame of the movie as "notloaded"

2. Add a text variable to the stage and name it "loadedsofar"

3. on the next frame create the following action (i.e. paste the code)
Set Variable: "LoadedFrames" = GetProperty ( "/", _framesloaded)
Set Variable: "totalFrames" = GetProperty ( "/",_totalframes)
Set Variable: "loadedsofar" = int((loadedFrames / totalFrames) *100) & "%"

If (loadedFrames < totalFrames)
      Go to and Play ("notloaded")
Else
      Go to and Play ("loaded")
End If

4. Label the 3rd frame "loaded"

That's it....  Let me know how you get on... I'll send you the .FLA file if you need it.

0
 
LVL 2

Expert Comment

by:coopa
ID: 2616312
mhdhallak, How did you get on with this ?
Did it work ?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.
Suggested Courses

810 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