-
Problems with loading external jpg's using 'loadMovie'
I've got a Flash movie in a popup window that loads several external jpg's (in a for-loop) with the 'loadMovie' command. I have two questions about this:
- When I close the popup window before all jpg's are loaded, Internet Explorer freezes. I have to restart IE to be able to continue working. Is there a way to avoid this?
- A related issue: when I click a html-link on the page that contains the Flash movie, the next html-page doesn't load until all jpg's in the swf on the current page are loaded. Is there a way to cancel the loading of the external jpg's somehow?
-
use moviecliploader
code:
//change imgarray to the array your images are in now
function loadimage(t, n, x, y) {
z == undefined ? z = 0 : z++;
t.createEmptyMovieClip(n, z);
t[n]._x = x;
t[n]._y = y;
t[n].createEmptyMovieClip("jpg", 0);
var ld = new MovieClipLoader();
ld.loadClip(n+".jpg", t[n].jpg);
ld.onLoadInit = function(j) {
j._x = 0-(j._width/2);
j._y = 0-(j._height/2);
};
}
for (var i = 0; i = imgarray.length; i++) {
loadimage(this, imgarray[i], 0, i*100);
}
the nice thing about moviecliploader (er... one of the nice things) is the onloadinit = it's called on the loaded clip as soon as its loaded - so you can do things like (as i have above) center every them so they scale right, or load a bunch of different sized images and place them edge to edge, e.g.,
code:
(j._parent._y=j._parent._height + j._parent._y);
hth, gl
-
This looks very good, I'm gonna try it.
Thanks a lot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|