Matt,

Sounds like you've the right idea here.  The main thing I could add 
would be that a good approach would be to create 25 objects (one for 
each of your flash-thingies), then put the 25 object references into 
a list.  The only question would be where would you keep the  list of 
object references.  There seem to be two logical choices:  keep the 
list in a global, or keep the list in a single behavior attached to 
the sprite where you have your flash member.  If you use a global 
then you can send messages by using the name of the global, if you 
use a behavior, then you can send a message to it by using 
sendSprite.  The basic idea would be to have a flashthingy parent 
script that has all the data and algorithms for a single flashthingy. 
Then, have a "manager" object (this is either the global or a 
behavior attached to the sprite) that maintains the list of 
flashthingies:

pListOfFlashThingies

on beginSprite me  (or on new me)
   pListOfFlashThingies = []
   repeat with i = 1 to 25
       aFlashThingieObjectReference = new(script "FlashThingies", <any params>)
       append(pListOfFlashThingies, aFlashThingieObjectReference)
    end repeat
    ...
end


Now, I don'r really understand what your path finder code does, but 
if you have the above, then you can send a message to a specific 
flashThingy object (number "i") by doing this:


    thisObjectReference = pListOfFlashThingies[i]  -- pull out the 
proper object reference
    SomeHandlerName.thisObjectReference(any optional parameters)

Hope this helps,

Irv

PS:  If you  do the above (or something like it), you will need some 
"cleanup" routine that allows the pListOfFlashThingies to be emptied. 
Otherwise, the FlashThingie objects will never go away.


At 4:19 PM -0500 2/16/02, Matthew DeSimone wrote:
>For some reason in  5 years of director development, I've never worked
>seriously with Parent/Child scripting.  Now I'm dumped into the middle
>of it, and desperately need some help here.
>
>I have a flash movie which has 25 moving objects on the screen, as well
>as a number of obstacles.  These objects react to a mouse click in flash
>to set their new destination.  However, due to the amount of processing
>needed to find the shortest available route, I want to offload the
>pathfinding scripts to director.
>
>Now, in order to find the shortest route possible, I need to keep track
>of several arrays specific to each flash "sprite".  I believe the
>easiest way to do this is to make a new child instance each time my
>pathfinding handler is called.  However, I have nothing to "attach"
>these children to.
>
>I guess my main question is, is it possible to have abstract children
>off a parent script, where the children exist simply as invocations of a
>script, and not invocations of a script which are attached to a specific
>director sprite?
>
>I know that may seem convulted, so if anything needs clarification, let
>me know.
>


-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/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