Solved

Preloading My Movie?

Posted on 2000-02-23
9
209 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
 
LVL 3

Expert Comment

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

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

-Dan
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 20 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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…
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.

762 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

23 Experts available now in Live!

Get 1:1 Help Now