At 6:01 PM -0400 5/21/01, Rob Walch wrote:
>Maybe there is a way in Flash that I can put the names of instances into a
>variable for Director to check? Well. until someone feels like dropping some
>undoc'd tips I'll just keep thinking out loud.

In your Flash movie, put the following code into your _root timeline's
frame 1 (I use a separate layer named "global actions" to keep organized) :

function mcInstanceList (rootNode) {
  var instanceList = new Array()
  for (var anInstance in rootNode) {
    if (typeof (rootNode[anInstance]) == "movieclip" && rootNode !=
rootNode[anInstance]) {
      instanceList.push(anInstance);
    }
  }
  return instanceList;
}

Then, again in your _root, place a label out of the way (past normally used
frames) titled:

getInstanceList

and then put the following ActionScript code into that frame's timeline :

var gInstanceList = mcInstanceList(_root);

Finally, use the following code in Director (attached as a behavior to your
Flash sprite) to get a single level list of movie clip instances which are
active in the current frame of _root:

property spriteNum

on getFlashMCInstances me
  -- make the call to Flash to get and store the list
  -- of currently active movie clip instances
  (sprite spriteNum).callFrame("_root.getInstanceList")
  -- now retrieve the data
  return (sprite spriteNum).getVariable("_root.gInstanceList")
end getFlashMCInstances

When you want to know the mc instances active in the current frame of
_root, do this:

put sendAllSprites(#getFlashMCInstances)
-- 

...---===|  Terry R. Schussler  |===---...
...---===|  Chief Investigator  |===---...

on visitWebsite yourSelection
 coolSites = [ \
   #advancedSeminars : "http://www.macromediaSEMINARS.com/";, \
   #directorUniversity: "http://www.directorU.com";, \
   #freeBehaviors : "http://www.behaviors.com/";]
 gotoNetPage coolSites[yourSelection]
end visitWebsite


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to