• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Preloading My Movie?

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
mhdhallak
Asked:
mhdhallak
  • 4
  • 3
  • 2
1 Solution
 
SuperMarioCommented:
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
 
SuperMarioCommented:
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
 
mhdhallakAuthor Commented:
What is the URL? I think you forgot to include it in your comment.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
SuperMarioCommented:
Oh, you're right! I'm sorry.

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

-Dan
0
 
coopaCommented:
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
 
mhdhallakAuthor Commented:
Hi Coopa,

Ok. It seems good to me. But where should I put this script? i.e., in which frame?
0
 
SuperMarioCommented:
Coopa's got this one - that's definitely a better solution if you're ready to tackle it =)

-Dan
0
 
coopaCommented:
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
 
coopaCommented:
mhdhallak, How did you get on with this ?
Did it work ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now