all groups > flash actionscript > july 2006 >
You're in the

flash actionscript

group:

loadMovie() vs. loadClip HELP


loadMovie() vs. loadClip HELP Mr. Helpy McHelpson
7/7/2006 6:30:16 PM
flash actionscript:
So here is what I want to do...

this.loadermov1.loadMovie("yadayada.swf")
if ( load success ) {
do something
}
else if (load fails) {
do something else
}

Anyway, thats an oversimplified version of what I'd like to do, but from what
I read I suppose I need a listener, which is only found in loadClip(); ? I
have no idea how to actually execute this properly. Anybody lend a hand?
Re: loadMovie() vs. loadClip HELP Rothrock
7/7/2006 7:16:22 PM
For somebody with "help" in your screen name, I bet you can guess what the
answer is going to be: Look in the Help files.

loadClip is a method of the MovieClipLoader class which was introduced with
Flash MX04. So if you are publishing for that or newer you will be able to use
the MovieClipLoader class. Check the help files. Copy the code from the help
files and you are good to go.

There are several events for the MovieClipLoader class that will help you with
what you want to do. In general onLoadInit should be used instead of
onLoadComplete.

If you aren't using MX04 or later you will have your work cut out for you. The
basic old-school preloader can do the first part of your conditional, but there
is no easy way to do the second part.

If that is what you need, post back and I'll go into more detail.
Re: loadMovie() vs. loadClip HELP Mr. Helpy McHelpson
7/7/2006 7:27:34 PM
yeah, I know where the help files are. The name is from Happy Gilmore, albeit
not the greatest name to ask a question with I spose ;)

Anyway, I've been reading through the help files, and been unable to actually
transfer the words to relevent thoughts: call it ADD, or just inability to
comprehend the MovieClipLoader class. Anyway, I thought I'd post here hoping
somebody could lend a few simple words to help me make that transition. But I
guess I can just stare at the help files more.

I am using MX04. I've written this with loadMovie using logic loops, and
probably more code than necessary, but I'd like to take advantage of the
previously mentioned class.
Re: loadMovie() vs. loadClip HELP Rothrock
7/7/2006 8:04:18 PM
I could go to the help file and copy the examples, but I think you can copy
that yourself just as well.

Are you using Flash 8? Don't use search or anything like that. Start with a
brand new completely empty flash file, open your Actionscript window and just
type the word onLoadInit on a line by itself, put the cursor in the word and
press F1. This will take you directly to the entry for that event.

Copy the code from the bottom of the entry (there are two examples, but I
suggest just taking the last one) and paste it into your actionscript window.
Be sure to get rid of the onLoadInit you typed earlier.

Now do the same thing for the onLoadError. In that case you only need the part
that starts loadListener.onLoadError and goes down to the first/closing curly
brace. Put that into your actionscript window.

There you go! You may need to change some little bits to make the names work
with what you have.
Re: loadMovie() vs. loadClip HELP Rothrock
7/22/2006 1:02:49 PM
If you are publishing for Flash 6 or earlier then you need to use it. Otherwise
I don't see any reason to use it. Even so, I do see learning to use loadMovie
and making an old-school preloader as a very valuable learning tool for
understanding how Flash works.

If I ran the world (hey, it could happen!) I would make everybody learn this
first and then be, "But wait, now that you have hurt your brain with that, here
is the easy way!"

Good luckl
AddThis Social Bookmark Button