[Top] [All Lists]

Re: Behavior keeps dying...

Subject: Re: Behavior keeps dying...
From: "Mark A. Boyd"
Date: Sun, 13 Apr 2008 17:48:04 +0000 UTC
Newsgroups: macromedia.director.lingo
"Darrel Hoffman" <[email protected]> posted in macromedia.director.lingo:

> on endSprite me
>   sprite(me.spriteNum).visible = TRUE
> end
> Does it matter that this happens in another behavior than the script
> that does the juicy bits?  

Nope. That should be just as good, though you might want to play with the 
order of behaviors as attached to the sprite.

Pure guesswork here, but maybe Director still has problems with .visible if 
it's toggled n times in a session?

> As for using the visible property, I know of
> the alternatives, but I don't like 'em.  Setting blend to zero is
> useless, as it doesn't stop script from running on mouse events.  Moving
> them off-stage works, but then you have to put in extra code to keep
> track of whether it's been moved or not or you end up moving it
> off-stage twice, or add a property telling it where its homeLoc is, etc.
>  The visible property works on one line of code, and it's nice and
> simple, provided you remember to make turn visible again on endSprite. 
> (I can't tell you how much I'd pay if the next version of Director made
> the visible property sprite-specific instead of channel-specific.  If
> they released an 11.5 patch that did just that, I'd buy it on the spot.)
>  Incidentally, I'm still using MX2004, in case that matters at all. 

Yep. I opted for the off-stage method many moons ago. Slightly more code, but 
it's proven reliable for me.

Where to go from here?

Can you observe a pattern occuring when it begins to fail? ie: certain sprite 
channels are visible/not visible?

Perhaps you can create a simple test movie with just your menu system and 
some minimal navigation if that's what your real project does.

That might help eliminate some possible causes. If it still happens in the 
test movie, see if converting to an off-stage method cures it. 

If not, then I may have led you down the wrong path altogether and something 
else is likely the cause.

If you're open to the off-stage method, I still have my ancient D7 example 
(using graphics for the menus) on my site that you might use as a quick 
starting point: It uses an even 
older version of my D7 "MAB beginOffStageGrouped" behavior shown (perhaps a 
bit confusingly) here:

It's old, but I still use that behavior in every nearly every Director 
project. Not so often for menus, but for artsy dialog boxes when the client 
doesn't want the OS widgets.

(I still get hits on those pages. Maybe it's past time for me to upload the 
D8+ versions of those behaviors.)

For more recent code, I seem to recall seeing some better written scripts 
posted on the DOUG site some years ago. Sorry I don't have the links avail, 
but they should be easy enough to find.

Mark A. Boyd
Keep-On-Learnin' :)

<Prev in Thread] Current Thread [Next in Thread>