This is certainly doable. It comes down to understanding how objects
interact in ActionScript, especially what paths they use to "see" each
other. Everything in Flash exists in a hierarchy, much like the documents
and programs on your hard drive. If you're on a PC, the root is generally
c:\, and in SWFs, the root is the keyword _root. Generally speaking, all
objects can refer to each other if they drop back to the _root and build up
again from there.
When you load external SWFs into an instance of the Loader Component,
the absolute path to that loaded SWF might be something like
_root.loaderInstance.content (since the Loader class has a content property,
which is a "reference to the content of the loader" -- see the ActionScript
Language Reference for full details). From that loaded SWF's point of few,
_root is the beginning of all things, as it is for any object. When run on
its own, _root would be the origination point of all paths in that SWF
alone, but once loaded, the term _root now refers to origination point of
all paths of the SWF's parent (that is, the SWF that contains instances of
the Loader Component). So if you have an internal movie clip -- internal to
the parent SWF -- whose instance name is myClipA, the loaded SWF should be
able to access myClipA by simply referring to ...
... assuming that myClipA resides in the parent clip's main timeline. If
not -- say, if myClipA was nested inside a clip with the instance name
myContainerA, that absolute path would be ...
... and again, this path wouldn't mean anything to the loaded SWF on its
own: that path doesn't exist in *that* SWFs hierarchy until it is loaded
into the parent, which *does* have that hierarchy.
Put yourself in the point of view of that loaded SWF and think through
what the path is to the intended recipient of your message.
So far, so good.
The word "this" is context dependent. When the word "this" is scoped to
a particular movie clip, "this" is synonymous with that clip; when "this"
appears in a frame script, "this" is synonymous with *that* object; i.e.,
the timeline. For example, "this" in a frame script of the main timeline
refers to _root.
So when your Behavior tells "this" to gotoAndStop(), the
MovieClip.gotoAndStop() method, which is what is triggered, applies to the
movie clip to which your Behavior is applied. What you want to do is
provide the correct path to the *other* movie clip, as described above.
Unfortunately, the Behaviors only go so far. They work in the expected
garden variety scenarios, but as soon as you step out of the box, so to
speak, they don't give you the wiggle room you may need to path to a given
object correctly. I recommend you applie a Behavior, then select that clip
and open the Actions panel to see exactly what ActionScript the Behavior
applied (all Behaviors do is write ActionScript for you -- you can do
everything they do, plus more).
Let me know if my discussion of paths makes sense to you. If not, we
can keep hacking away at your goal until you achieve it.
stiller (at) quip (dot) net
"Luck is the residue of good design."