Groups | Blog | Home
all groups > flash actionscript > august 2005 >

flash actionscript : how do i check for a loaded movie??


digital_monkey
8/21/2005 12:00:00 AM
Hi,

There is no property that can directly tell you if a clip is loaded or not. If
the clip is empty beforehand, you could check if the width and height of the
movie clip is 0 (this would mean nothing has loaded into it yet).

But it depends on what you need it for. If you want something to happen when
the clip has loaded, then I suggest you use a MoveClipLoader object to load the
clip, and use a listener object with it. Why do you need to check that
something is loaded?
batgirl_Sa
8/21/2005 12:00:00 AM
so that if it is loaded then i dont need to load it anymore.. and if it is not then i load it again...


Rothrock
8/21/2005 12:00:00 AM
Without knowing all the ins and outs of what you are doing, the best advice I
can give you is that if you want to know something you should keep track of it.
So for each empty movie you should set up a variable like.

myClip.loaded=false;

Then when the content is loaded put something like:

myClip.loaded=true;

Into the onLoadComplete or onLoadInit handler. That way you can check the
loaded property of the clip.

If you are also unloading content, then be sure to set the property back to
false. But I agree with digital_monkey it is difficult to advice without
knowing what you are trying to do. I don't think I've ever needed to do this,
so there might be a completely different solution.

For example what do you mean I don't need to load it anymore? And also if it
is not loaded how could you load it again? If you need things loaded once, then
just load them once.
batgirl_Sa
8/21/2005 11:03:57 AM
in my application i am loading various movies into an empty movie clip based on
certain criteria using loadmovie...


but now i want to check if there is something loaded in the empty movie or
not.... is there way to check if there is a movie loaded into the emptymovie or
not...??


thanks
AddThis Social Bookmark Button