please help w/ moviecliploader onLoadProgress event handler

  • mahjik
  • Novice
  • Novice
  • mahjik
  • Posts: 33
  • Loc: Las Cruces, NM USA

Post 3+ Months Ago

okay, heres my problem. I am loading content into different _levels, and in _level0 is my preloader keeping track of whats loaded and what to play, etc. I get the clips to load into the proper levels, and can play them, etc. no problem. my problem is displaying a graphic showing load progress. so here is the code on the _level0 timeline, loading a splash movie into level 7:

Code: [ Select ]
intro_mcl = new MovieClipLoader();

myListener = new Object();

intro_mcl.addListener(myListener);


myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes){
    this._parent.loadBar_mc._xscale = loadedBytes / totalBytes * 100;
    updateAfterEvent();
}


intro_mcl.loadClip("staticrain2test.swf",7);
  1. intro_mcl = new MovieClipLoader();
  2. myListener = new Object();
  3. intro_mcl.addListener(myListener);
  4. myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes){
  5.     this._parent.loadBar_mc._xscale = loadedBytes / totalBytes * 100;
  6.     updateAfterEvent();
  7. }
  8. intro_mcl.loadClip("staticrain2test.swf",7);


the static rain file isnt that big, so i added a bunch of tiff's to it and stuff to make it big enough to take awhile to download. its just over 3 meg now. the preloader screen shows until the new movie starts playing, but the progress bar shows 100% loaded from the get go.

for testing purposes, my display is a movie clip with a white rectangle 400 pixels wide by 50 pixels high. underneath it on the stage is a black rectangle the same size. shouldn't the '_xscale = bytes loaded/bytes total * 100' have it start out black, and gradually become white during load progress?

i have tried literal and relative paths for the loadBar_mc object and can't figure out what i am doing wrong. i checked my typing and capitalization about a hundred times, so i dont think that is the problem.

I also know that i could do this a hundred different ways, but am trying to learn as much as i can about movieClipLoader.

I tried using onEnterFrame both on _root and myListener with getProgress, but using trace in test movie, it seemed to only run once before comp sat there and loaded whole movie, then started going again.

I tried using setInterval with a function that called getProgress and that didnt work either.

I ran a getProgress in the onLoadInit event handler and it came back 0 loaded out of 0 total. is this reset after loading, or should it still show the size of the movie it had just loaded?

does the loader (as opposed to the loadee) stop cycling through its frame rate while loading the movie? i am truly stumped, and any help is greatly appreciated.


thanks
  • mahjik
  • Novice
  • Novice
  • mahjik
  • Posts: 33
  • Loc: Las Cruces, NM USA

Post 3+ Months Ago

well, heck. 30 views and no help. guess i am on my own.


:cry:
  • biesior
  • Born
  • Born
  • biesior
  • Posts: 1

Post 3+ Months Ago

Well there is problem w/ files stored at your harddrive - look at this link:
http://www.informit.com/articles/article.asp?p=170500&seqNum=3
  • mahjik
  • Novice
  • Novice
  • mahjik
  • Posts: 33
  • Loc: Las Cruces, NM USA

Post 3+ Months Ago

thanks, and of course once mentioned, i recall hearing something mentioned about this. maybe i should get my memory upgraded?

thanks again

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 5 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.