Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : loadMovie and onLoad event


matthewb1174
2/26/2004 11:00:33 PM
I am loading an external image into an object named square and I would like to
display a simple text while the loading is happening, and set the text to
nothing when it has loaded....

pic16.onPress = function() {
strLoad = 'Loading..';
movieUrl = "/images/flash/pic16.jpg";
loadMovie(movieUrl, "square");
};
square.onLoad = function() {
strLoad = '';
};
Jack.
2/27/2004 12:33:28 AM
myMovieClip.onLoad is invoked when the movie clip is instantiated,
onLoad is also used for data (loadVars and xml) and sound,
it will not detect the loading of a jpeg,
try a loop instead,

pic16.onPress = function() {
strLoad = 'Loading..';
movieUrl = "/images/flash/pic16.jpg";
square.loadMovie(movieUrl);
this.onEnterFrame = function(){
if(square._width > 0){ // empty movieclip has _width=0
strLoad = "";
delete this.onEnterFrame;
}
};
};
AddThis Social Bookmark Button