Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: [flasher] MovieClip load and unload
From: Bill Gunter
Date: Tue, 13 Feb 2001 21:15:06 -0000

Todd-

There are two different ways you can approach this, 1: you can use the load
movie command and load external files, and 2: you can use the attach movie
command and load internal movieclips into a blank movieclip wherever you
want in your file.

The first approach using loadMovie is done by making all of the content you
want to be loaded into it's own seperate swf(making sure to keep the files
in the same directory as the main file). Loading movies deals with levels
and levels are basically layers for movieclips and or external swf's, it's a
way to keep track of them and organize them. Because of this you must assign
a level to each external file you load so that when you load it, it knows
where to go. The main movie is always going to be on level 0 so you must
load the external file into a level higer than 0(note: only 1 movie can be
loaded into a level at once, if you load more than one it will remove the
old one and replace it with the one you are loading). Once you create your
external files all you have to do is assign the action to a button or
whatever else like so:

on(release){
loadMovieNum("nameofmovie.swf", 2)
}

namofmovie.swf is the external files name and 2 is the level you are
assigning the movie to.

To unload that movie just use the unload movie statement:

on(release){
unloadMovieNum(2)
}

by unloading 2 you are unloading the movie that is sitting in level 2.



The second option you have is to use the attach movie script which can be a
little more tricky, I suggest you not use this if you are not comfortable
with scripting. To do this you would load a blank movie clip into wherever
you want the movies to load and give it an instance name like blankclip.
Next go to your library and right click(control click for mac users) on the
movieclips you want to load and select linkage. A dialogue box pops up and
you then need to toggle the export this symbol radio button and name the
clip. When you have finished that you can then assign the attachmovie action
to a button or whatever like so:

on(release){
_root.blankclip.attachMovie('linkagename', 'instancename', level#)
}

In order to get this script into your actions pallette you will need to
toggle your actions window from normal mode to expert mode and then type
this script into the box by hand for there is no attachmovie command in the
actions menu.
To unload a clip use this:

on(release){
_root.blankclip.removeMovieClip()
}

That is it, I hope this will help get your project up and running, good
luck.

Bill
iStream Interactive
-----Original Message-----
From: Todd R. Warfel [calypsostudiosatcalypsostudios [dot] com (mailto:calypsostudiosatcalypsostudios [dot] com)]
Sent: Tuesday, February 13, 2001 9:37 AM
To: flasher from chinwag
Subject: [flasher] MovieClip load and unload


Okay, so I'm building an interactive application in Flash 5 and want to use
movie clips instead of scenes for a particular area. In short, I have a case
studies section, and I'd like to have each case study load as a movie clip.

Here's the current set-up. I have a scene called scnCaseStudy. I have the
main navigation fly in -- currently built in the scene, but will be changed
to a movie clip, as this navigation will grow. Then I have a MC (movie clip)
for the animation sequence of the navigation for the Case Studies placed in
the scnCaseStudy. This MC is called mcCaseStudyList

In the MC mcCaseStudyList, I have all the different case studies as MCs.
Again, I'll be updating these MCs to use scrolling text boxes, but for now
they're static. Hence, the reason for making them a MC.

What I'm trying to do is have the mcCaseStudyList load and unload the
different MCs (e.g. mcCaseStudy01, mcCaseStudy02, mcCaseStudy03). I've tried
the loadMovie, unloadMovie command, but it unloaded the main movie. This may
have been because I set the variable level to 0. Should I load the MCs at
their own level, or level 1 to prevent this? Will this allow me to load
mcCaseStudy01 at level 1? Then creating a button, which has the action,
unloadMovie at level 1, will this unload the movie mcCaseStudy01, returning
me to the stage of the main scene in mcCaseStudyList?

Right now, I have a button set to play a current scene in mcCaseStudyList,
which is just the list w/o any MCs loaded. The drawback is, this isn't in
the case study MCs, it's in the mcCaseStudyList, placed ontop of the MCs
(e.g. mcCaseStudy01, mcCaseStudy02, mcCaseStudy03).

Thanks!

--
Todd R. Warfel
Internet Director
Ucentric Systems

www.ucentric.com
P: 978-823-8124
F: 978-823-8160


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Chinwag site carries a wealth of Flash resources.
Find useful links, suggested reading and archives at:

** http://www.chinwag.com/flasher **
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You are subscribed to flasher as: billgatistreaminteractive [dot] com
To unsubscribe, email leave-flasher-479823Natlists [dot] chinwag [dot] com




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]