> Craig,
>
> Yes, I would use a completely different approach than mucking with
> the scriptInstanceList.  If you have written your own behavior that
> handles clicking on each answer, and you have a way of talking to all
> answer sprites, then here's what I would do.
>
> In the answer behavior, add a property called something like,
> pAvailable.  When the user can answer the question, pAvailable should
> be set to TRUE.  When the user selects one answer, you should call a
> handler in the behavior attached to all answers that sets pAvailable
> to FALSE

Irv,

I originally considered using a flag to turn user interaction on and off,
but unfortunately, given the rest of the functions (that I haven't
outlined), it does get a little messy.  Having said that, I am going to
rewrite it in a very similar manner to what you proposed.  Thanks for the
input.

Couple of things to note about why using the scriptInstanceList didn't work
for me.  Just curious if anyone has encountered similar findings.

When I created a script as such:
script1 = script("myScript").new("right","wrong")
sprite(x).scriptInstanceList.add(script1)

It seemed to ignore the parameters that I fed it.  When it ripped through
the code AFTER clearing the scriptInstanceList and then reapplying
behaviours, it couldn't find these values anymore.  (They were initiated
with a getPropertyDescriptionList on the original behaviour).

Also, I had a rollover behaviour that was based on:
sprite(me.spriteNum).member =  x

Again, once I stripped behaviours from the sprite and then reapplied them, I
got an error on mouseEnter.  If I changed the code to this:
sprite(the currentSpriteNum).member =  x

It worked!  Unfortunately, too many "me" references down the line to make
this a feasible fix.  Is it just getting confused between the initial
instance of the behaviour and the reapplied instance??  Got me.  Thoughts?

Thanks also to Andr�e and Howdy for their responses.  And Irv, kudos on the
e-book.  Great OOP reference!

Cheers,
-_Craig




[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