I have only noticed this happening when I didn't add the behavior to the scene graph. What I do is attach a node "BehaviorNode" to the root of the scene graph and in my world management code any new behaviors are added to this node with a default bounds (so they always activate).
One thing to watch for (that I used to forget all the time) is that within your behavior you have to reactivate the event or it will fire exactly once time.
> -----Original Message-----
> From: Kasparian, Raffi J. [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 14, 2001 10:45 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] Behavior.setEnable(True)
>
>
> Hi Adrian (and Sun Programmers),
>
> I just discovered (for myself) that Behavior.setEnable( true
> ) doesn't work.
> Doing a search of this groups archives turned up your
> (Adrian's) posts. I'm
> amazed that no one answered them -- at least not on the list.
> setEnable()
> only works if you want to disable a behavior. After that your
> behavior is
> junk until you can cause it to wakeup again. Since you can only call
> wakeupOn() from processStimulus and initialize and we are forbidden as
> programmers to call those two methods, the only thing I have
> discovered that
> works is to trigger the initialize method by detaching the
> behavior from the
> scenegraph and then reattaching it. I suspect using a Switch
> might be more
> efficient but I haven't tried it yet.
>
> Please Sun Programmers, if there is a reason setEnable( true ) is so
> crippled would you please explain? Does it have any use
> except for changing
> a flag in Behavior? The name "setEnable" and the javadoc "Enables or
> disables this Behavior" sets up the reasonable expectation
> that the Behavior
> will start functioning again when you pass it "true". If you have no
> intention of doing this maybe it should be renamed to
> "waste_a_line_of_code(
> boolean state )".
>
> Sorry, I don't mean to be too snide, but I dimly recall this
> being an issue
> years ago and I am disappointed that Sun has not addressed
> it. Not even by
> providing less misleading documentation.
>
>
> -----Original Message-----
> From: Adrian Meekings [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 11, 2001 10:28 PM
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Behavior.setEnable(True)
>
>
> Hello again
> as a "work-around" to my last question on this...
>
> What would be the main reasons for a behavior NOT to be
> re-enabled using
> setEnable(True);
>
> Kind Regards
> Adrian
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff JAVA3D-INTEREST". For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff JAVA3D-INTEREST". For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
