Groups | Blog | Home
all groups > flash (macromedia) > march 2004 >

flash (macromedia) : preload jpgs in flash mx (not 2004)



kit_hoffman
3/13/2004 10:21:15 PM
I have flash mx (not 2004). Is there any possible way to make sure the image is
loaded, or get percent loaded info on the images progress? most important is
that i need to know when an image is completely loaded, but it would be great
to get live feedback on percent loaded. I know that flash mx 2004 has many
functions that get the info I need. Are there any ideas on how i could do this
without upgrading? I've seemed to try just about everything.
Laiverd.COM
3/13/2004 11:43:44 PM
Any preloader code would do; examples at www.flashkit.com or
www.bokelberg.de/actionscript or just search the google archives (link
below)

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

kit_hoffman
3/13/2004 11:49:10 PM
any preloader? when i load any jpgs this code x = loadingJPG.getBytesLoaded();
returnes x as = to 4? the total bytes is also equal to for, however the jpgs
that i was testing were around 50-100? why do you think this is?
noodle doodle
3/14/2004 12:41:31 AM
ooh don't credit me for this code - some other clever guy wrote it....


// (holderName is an optional parameter)
MovieClip.prototype.loadjpg = function(picName, holderName) {
// holderName can be passed in case needed for progress indicator
// if not passed, use 'holder' as default
var h = holderName==undefined ? "holder" : holderName;
this.createEmptyMovieClip(h, 1);
this._visible = false;
this[h].loadMovie(picName);
var id = setInterval(function (mc) {
if (mc[h]._width > 0) {
mc._alpha = 99;
clearInterval(id);
// may want to move this next line to the onComplete routine
// instead, if visibility is to be set after positioning
// mc._visible = true;
mc.onComplete();
} else {
mc.onLoading();
}
}, 80, this);
};



this.onLoading = function() {
trace("LOADING: This="+this+" has loaded:"+this.h.getBytesLoaded()+"/"+this.h.getBytesTotal()+" bytes");
};
this.onComplete = function() {
trace("This="+this+" is COMPLETE");
};
this.loadjpg("zip.jpg","h");



[quoted text, click to view]

Laiverd.COM
3/14/2004 11:05:26 AM
BAsically yes; any preloader. Well, except for the one perhaps that use
ifFrameloaded. But obviously things are not working as you expect, so why
don't you show us what you have done sofar.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

AddThis Social Bookmark Button