Have i got the concept of levels right?

ok - as a mid-newby now, i’m still hoping (foolishly) to get somewhere without ever having to use loadMovie and levels, as they seem too hard to grasp. at the back of my mind however is the suspicion that i’m going to need them at some point.

ok - levels:

are levels related to the library it is? i.e. if i have a mc in a folder called movie1, which is inside another folder called movies, am i 2 levels deep?

and lastly: which is the good and the bad way to target locations: (_) or (.)?

thanks

:slight_smile: … you’re thinking that it’s too hard so it is. I’ve writen a few posts on this… so I do suggest taking a look around at the older posts, especially those in “best of Kirupa”, but these are the basics.

Levels are pretty simple. When you write the code in an html document, to embed a flash player, there is an address in there for an swf on the server.

The embeded player loads this swf into level0. From your words I can tell you right now that that’s all you’ve seen of your own movies.

Now… the Flash player can also take more movies and display them. It starts with level0 the base movie. If you load something into level1, it is played by the Flash player in a place above level0 physicaly. A movie in level1 will cover the movie in level0 so that you can’t see it there. It’s still there though. The processor is still paying attention to it, it just doesn’t have to display it because it’s displaying things in level1.

note… that’s a little deceiving because if you have a clear area of the stage in an swf in level1 whatever is below it on level0 will show through to the viewer.

Think of levels as layers of a sort which are not the same as internal layers of a movie, but instead are external layers (very much like html layers) which reside one above another in a stack.

Just to let you know… there will come a time when you will use loadMovieNum(); extensively, and it will be easy to understand. Once I started using and understanding them, I really realized that I couldn’t live without them.


You’re second question is actually a false notion. The nature of “" vs “.” is that there is no vs. You use “.” in Flash 5.0 and above. You also use "” in Flash 5.0 and above. Those are both part of the same naming syntax system for dot notation of location of movie clips.

_root.myMovieClip.myVariable=something;

in a statement like this, you see both of those notations. The “_” is used at the beginning of certain Flash words. In this case “_root” refers to the main timeline… the timeline upon which all other media in your movie opperates. Each period is used to separate elements that you’re refering to in a chain of objects. So the variable called “myVariable” exists inside of the movie clip called “myMovieClip” which in turn exists on the main timeline or the root timeline.

If that’s still not too clear… take a look at my web site www.centerspin.com. gotoAndRead Flash 101: an introduction to Flash. Pay special attention to the paragraph on OOP, but read the whole thing… it should give you a more clear understanding of the notation that we use in Flash.

When you’re done reading that, come back to this post and make a reply to me. I’ll explain loadMovie and loadMovieNum so that you can understand them.

(PS you like that Flash humor in there? gotoAndRead :slight_smile: )

you explained levels fabulously!! :smiley:
and i’m with it now on the “.” and the “_” (i program in visual basic, so the notion of symbols in front of objects makes good sense (now that you pointed it out)
:smiley:

PS flash humour? well, i laughed but had to stopAllSounds because i’m in work.

:smiley:

loadMovie and loadMovieNum…
(shudder)

some people get through life without being able to read and write! can’t i get by without these things?
:stuck_out_tongue:

ok, just kidding
ready!

I doubt it. Just be thankful you’re not into loading php variables yet. Just learning to understand loadMovie is not tough at all.

loadMovie(); is a method which lets you take any swf on the same server as the swf that’s calling for it to load; and load this into a movie clip on the stage.

loadMovieNum(); is a method which let’s you take any swf on the same server as the swf that’s calling for it to load; and load it into a level of the Flash player.

PS… there is a little bit of trickiness with loading an swf into a movie clip. The loaded movie uses it’s upper left corner as a registration point for where it is possitioned. The movie clip you’re loading it into uses it’s centerpoint as a registration point. So, when you do load an swf into a movie clip, some people get confused by the possitioning of the peice. Once you know what’s going to happen a head of time though, it’s easy to compensate for the offset.

uh…

you mean loadMovie is for loading separate mc’s? (presumably that’s handy when you have seriously big sites?)

i thought loadMovie was to do with loading one movie clip on (let’s say) release from a button in another mc (that’s why i was asking about levels)

or did i get lost there somewhere? (scratch head)

it’s making vague sense, i just need to see an application for it, i suppose

many thanks, as always
:smiley:

loadMovieNum, loads an swf from your server into a level.

loadMovie, loads an swf from your server into a target movie clip.

Also check this : www.kirupa.com/developer/mx/loading.asp
and this : www.kirupa.com/developer/…dmovie.asp

pom 0]

i’ve been using labels in my scenes to landmark my movieclips and then using goTos from buttons in either my scene or other movieclips - and those scenes can get long!!

to make the scene shorter [visually] i wondered briefly if i could place many movieclips in the same frame (say, frame 1) and set their visible property to 0, then making them visible from the buttons as i need them

but i don’t want to start experimenting in the wrong direction - if loadMovie is the way to go

:smiley:

ok - if i use loadMovieNum: am i referencing movieclips by their number?

If you want to have all your movie clips on the scene, you’d rather not put them all at the same place and make them invisible. What you could do is make your buttons go to a frame where one of the movies is, is you see what I mean.

>> if i use loadMovieNum: am i referencing movieclips by their number?
No. You’re referencing the _level by its number. Did you check that tutorial ?

pom 0]

I agree with POM. You’ll bog down the processor if you have them all in the same frame.

i follow your logic now, chaps!

i just read the tutorials (very nicely written, btw) and the thing that struck me was using an empty movie clip! (that concept took some getting used to…)

can i just ask then: is the point of loading movies in this way to save having to download the whole site when you’re visiting? (i.e. to improve performance over bandwidth?)

PS i like the idea of dynamically loading a pic - that’s so useful!! can i do the same with text?

(i’ll have to play with this more over the weekend)

cheers for your time
:slight_smile:
and for pointing out the tutorials page (i’d missed that previously) (and yes, i know there’s a link to it in the forum… he he…)
:slight_smile:

loading text is even easier than loading a pic to tell the truth.

The loading of a movie into a movie clip is exactly for that purpose… to save on download. Let the visitor get through to some of the site, while the rest continues to download streaming into the comp. The advantage to loading them into movie clips, as opposed to levels is that you get a more complete control over the location of the loaded material. You’re not restricted to the upper left corner of the stage, but instead are in the upper left corner of a clip, which you can move around and such using action script.

cheers for that

well, i will be [forcing myself] using loadMovie at some point soon then, when i get my first effort underway (i’m re-doing work’s website using my 1 step forward, 2 steps back approach)

:slight_smile:

:slight_smile: good luck to ya. If you’ve got any questions let us know.

can i export certain mc’s to .sfw so i can then target them using loadMovie? or does flash make a separate .sfw when the mc gets to a certain size?

on(releaseCoffeMug){
gotoBed(“crypticActionscriptEverywhere”, “tooMuch”);
headbroken();
}

:slight_smile:

lol… now you’re scripting like a fellow Narcaleptic.

If you want something to be an swf then you have to open a new movie in Flash, and place what ever you want on that stage. Often times that’s as simple as droping a movie clip from your current work into this new movie… sometimes it’s as complex as copying and pasting frames, and or resetting wayword tweens.

of course!
i just needed to step back a little (the answer was just a matter of logic)

:slight_smile: