Matthew,
[quoted text, click to view] > So, if your dont' mind dumbing down what you said up there?
> If you don't have time, its alright as well.
Ha! No problem. :) I wouldn't call it dumbing down -- I'm sure you're
not dumb -- just a different or more thorough explanation.
[quoted text, click to view] > A button called "bt_ForestMap" and what I want to happen is
> once I click that it will go to the swf called "Forest.swf"
There are two ways to think of "a button called" something. There is
the name you give the button symbol in your Library. Separate from that is
the instance name you give the button instance on your Stage. Instance
names give you a means of addressing invidual buttons on the Stage, even if
they're dragged there from the same symbol in your library.
Give your button an instance name (see the Properties inspector when you
click once to select your button on the Stage). Now that it has this kind
of name, you can address it via ActionScript.
Create a new layer and name it scripts (this keeps your code all in one
place and easier to find). In a keyframe of your scripts layer that
vertically coincides with your button -- that is, the same frame number as
the frame that contains your button, even though they're on different
layers -- type the following:
yourButtonInstanceName.onRelease = function() {
//
}
So far, you've simply called your button instance by name (by its
instance name) and are assigning a function to its onRelease event handler.
Event handlers ... well, they handle events, such as an onRelease (when the
user clicks, then releases the mouse). How do you know what events your
button can handle? Check out the "Button class" entry in your ActionScript
Language Reference. Classes define objects, and everything in ActionScript
is an object, including MovieClips, TextFields, etc. In your code, you'll
substitute the word yourButtonInstanceName with whatever instance name you
give your button.
Now, the actual code you'll want to invoke is the getURL() function.
Give that a shot in the ActionScript Language Reference, too. You'll see
that it takes at least one parameter, which is usually an http: request.
You might have it open another HTML document that contains your other SWF,
for example.
If you're hoping to actually load another SWF *into* the existing SWF,
you would use something like MovieClip.loadMovie().
yourButtonInstanceName.onRelease = function() {
_root.loadMovie("otherMovie.swf");
}
.... where _root is your main timeline. Doing the above would load the named
external SWF into the _root of the current SWF, which would wipe out
everything but the new SWF. The new SWF will start playing from frame 1
when it loads.
You could, alternatively, load an external SWF into a movie clip. After
all, MovieClip.loadMovie() is a method of the MovieClip class, so it can be
used on any movie clip instance (and, as it happens, on timelines, such as
_root). You would have to have a movie clip -- it could be empty -- on the
Stage with an instance name, such as ... oh ... mcLoader. Whatever you want
to call it.
yourButtonInstanceName.onRelease = function() {
_root.mcLoader.loadMovie("otherMovie.swf");
}
.... in which case the external SWF would *not* wipe out everything, because
it's harnessed into a particluar movie clip instance. You could position
that clip anywhere you like. Experiment with it! :)
David
stiller (at) quip (dot) net
"Luck is the residue of good design."