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

preload swf video

HI experts,
I am trying to put swf videos on my site.
I would like to preload the video and show by percent how much it has loaded. Please help...
Thanks.
0
kephillips
Asked:
kephillips
  • 3
  • 2
1 Solution
 
sam85281Commented:
Quick easy way:

1. Start your video on frame 5
2. On frame 4 put this code:
  loadedBytes = _root.getBytesLoaded();
  totalBytes = _root.getBytesTotal();
  totalKB = int(totalBytes/1024);
  if (loadedBytes<totalBytes) {
         percent = int((loadedBytes/totalBytes)*100);
        percent += "%";
        gotoAndPlay(1);
  } else {
  gotoAndPlay(5);
  }
3. Make a layer for text.
4. Put a blank keyframe on frame 5 of that layer.
5. Go to frame 1 of that layer.
6. Make some static text that says "loading" or something.
7. Next to that make a dynamic text box, empty, wide enough to where it will fit "99%"
    In that variable box type: percent
    Click the "characters" button and select 0-9, in the "include characters" box towards the bottom, put the percent sign.

That's it

-Sam
0
 
kephillipsAuthor Commented:
Sam,
Thanks for your reply.
i have no clue how to work with flash. I DO have Flash MX so that should help.
Please explain though in newbie language.
Thanks.
0
 
sam85281Commented:
Here's an fla with everything in place (except video of course) they keyframe where you would put your video is marked.

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

-Sam
0
 
kephillipsAuthor Commented:
Sam,
Ok. that works (i think) except that it puts the video up in the top left corner...
0
 
sam85281Commented:
You can drag the vido to wherever you want it.  Also if you want the stage to just be the size of the video, you can resize it. Top Menu=>Modify=>Document.

-Sam
0

Featured Post

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.

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