Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1133
  • Last Modified:

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

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
Socorro
Asked:
Socorro
  • 3
  • 3
1 Solution
 
henrywwCommented:
u mean each of the those movieclips has its own preloader as the code listed?
0
 
SocorroAuthor Commented:
Yes. The sizes of the video clips vary between 50k and 500k and each have the same actionscript as above for a preloader.
0
 
henrywwCommented:
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.

 
SocorroAuthor Commented:
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
 
henrywwCommented:
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
 
rascalpantsCommented:
why can't you just do this:

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


rp
0
 
SocorroAuthor Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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