?
Solved

preloader doesn't work - waits until whole movie is loaded

Posted on 2003-03-14
7
Medium Priority
?
1,130 Views
Last Modified: 2007-12-19
I have a number of vido clips embedded in SWF files that get loaded into the interface with loadMovie, works like a charm and very easy to update.
The video files themselves are a problem, however; sometimes they don't load at all, sometimes it takes a few clicks before they start playing. When they do, the three frames of the preloader that worked at first are now somehow skipped. The file seems to halt at the first frame, waits for the whole movie to load, then rushes through the preloader frames and plays the video (in its own movie clip symbol). I have no idea why it's doing this. The actionscript is pretty straightforward:

Frame 1: nothing

Frame 2:

  filler._yscale = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
  if (_root.getBytesLoaded()<_root.getBytesTotal()) {
     gotoAndPlay (1);
  } else {
     gotoAndPlay (3);
  }

Frame 3: stop();

Layer 1: no objects, only the two keyframes with the actionscript
Layer 2: Frames one and two for the outline of the progress bar and the bar itself
Layer 3: Frame three contains the movie clip with the video


That's it. Anything you can tell me is, of course, greatly appreciated =)
0
Comment
Question by:Socorro
[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
  • 3
  • 3
7 Comments
 
LVL 6

Expert Comment

by:henryww
ID: 8140361
u mean each of the those movieclips has its own preloader as the code listed?
0
 

Author Comment

by:Socorro
ID: 8143503
Yes. The sizes of the video clips vary between 50k and 500k and each have the same actionscript as above for a preloader.
0
 
LVL 6

Expert Comment

by:henryww
ID: 8143687
then .. there might be a problem ..

if u have the main movie "main.swf" to load "ex1.swf" & "ex2.swf" etc ...

when they are being loaded
 _root.getBytesTotal <- _root is refering to the "main.swf" that could be a problem ...

can u post part of the code, ... how u load those movie in ... ?

are u loading them in a movieclip like
mc.loadMovie("ex1.swf");
or
mc.loadMovieNum etc ...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Socorro
ID: 8148159
In the main SWF there are a number of buttons, each assigned to load the external SWF into an empty movie clip called "dropzone." The actionscript for the buttons is just this:

on (release) {
     _root.dropzone.loadMovie("clip01.swf");
}
0
 
LVL 6

Expert Comment

by:henryww
ID: 8149842
i have just done something here ...
http://www.mavisw.com/new/index.html
(not 100% finished yet)

in the "photo" section it is loading like 30 jpgs into the flash ... the preloads the jpg one by one into the flash but while it is loading, u can still click on the those loaded (darken numbers) to see the picture.

i am using a movieclip (with loading script) to loop and load the images, so ... u the main movie is not affected.

0
 
LVL 22

Accepted Solution

by:
rascalpants earned 225 total points
ID: 8155494
why can't you just do this:

if (movieClipName.getBytesLoaded()<movieClipName.getBytesTotal()) {
    gotoAndPlay (1);
 } else {
    gotoAndPlay (3);
 }


rp
0
 

Author Comment

by:Socorro
ID: 8177349
That seemed to have done trick. I replaced all the _root.blabla with this.blabla and it worked. Quite obvious and inobservant of me not to try it out - probably because I was looking in the wrong place. Thanks.
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 have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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