you can’t tell flash to show the percentage of loaded jpg - it can only work with swf. But you can tell that the image is loaded by checking the width of the container (which increases when the jpg ‘pops’ in)
…What the hell are you talking about, mlk!? You can show the percentage loaded of the JPEG.
Just place the dynamic TextField on the parent of the MovieClip into which the image will be loaded, and the code should be something along these lines:
[AS]this.createEmptyMovieClip(“preloader”, 9876);
preloader.onEnterFrame = function() {
var bloaded = myMovieClip.getBytesLoaded();
var btotal = myMovieClip.getBytesTotal();
var percentage = Math.floor(100*bloaded/btotal);
// is that ^ the percentage loaded? I think it is :****P
myTextField.text = percentage;
if (bloaded>0 && bloaded == btotal) {
trace(“The image has been loaded”);
// some actions here
this.removeMovieClip();
}
};[/AS]
The code would be placed in the parent MovieClip, where myTextField is the instance name of the TextField in which the percentage will be shown and myMovieClip is the MovieClip into which the image will be loaded. :sigh:
// create container for pictures
_root.createEmptyMovieClip(“container”, 1);
// positions the container
container._x = 22;
container._y = 235;
// load movie on button press
but1.onPress = function() {
loadMovie(“pic1.jpg”, “container”);
// load text
loadText = new loadVars();
loadText.load(“pic1.txt”);
intro.text = " ";
// tells movie to execute the function when the data has been transferred
loadText.onLoad = function() {
details.text = this.details;
};
};