Hi List

I've been trying to get registerScript() / sendevent() to work
recently and there seems to be a problem
when using it for events to models.

from the director online help for registerScript();

'This statement registers the messageReceived event handler found in a
movie script to be called when the model named Player receives the
custom user defined event named #message:

member("Scene").model("Player").registerScript(#message,
#messageReceived, 0)'

and from the model entry in the 3D Xtra Lingo API document;

the table for Model Object Methods indicates a return of True/False
which does return True.

I therefore assume the event:script is attached

However I am unable to send an event to the model (it all works for
the 3d member) using sendEvent()

As is stated by the release notes 8.5;

'The lingo sendEvent() will only send messages to scripts registered
via registerForEvent() . It does NOT send messages to scripts
registered via member.model(1).registerscript()'

But this begs the question how DO I send an event to a model?
Also sendEvent() does send events to scripts registered with
member(1).regitsterScript()

Futher on in the 3D Xtra Lingo API document the entry for event
handling gives some clues under sendEvent()

the entry for sendEvent() entry ends

'TBD (? To Be Done) Add support for <arg1>, <arg2>, <arg3> etc
Currently only supports <eventname> argument.'

So when is this TBD? Because at present lack of arguments is a bit
limiting ;-)

Finally the unregisterAllEvents() command includes a TBD section

'add a registeredScriptList property which lists [[#event,<script or
handler>],[#event,<script or handler>]] and allow users to remove
elements. Also, move this method to model level.'

I've had a look at the 3dbehaviours and funnily enough they don't use
any of this registerScript/event/sendevent they use there own
messaging system.

It looks like we will have to write our own systems to do this (lack
of the registeredScriptList property would have probably force this
anyway). ie you would need to create and maintain this property to be
able to delete one event:script entry (using unregisterAllEvents then
re-attaching the event:scripts you didn't want to delete.

Hope this helps people or at least saves them time as the info is
scatered about abit.

DAve

Tested on 8.5.1
------------------------------------------------------
David Burgoyne
E Proctor & Stevenson Ltd.
Phone: +44 (0)117 944 4466  Fax: +44 (0)117 942 4932
Email: [EMAIL PROTECTED]
Website: http://www.eproctors.co.uk

The contents of this e-mail / post are confidential to the addressee
and are
intended solely for the recipients use. If you are not the addressee,
you
have received this e-mail /post in error. Any disclosure, copying,
distribution
or action taken in reliance on it is prohibited and may be unlawful.

Please note that any opinions expressed in this e-mail / post are
those of the
author personally and are not necessarily those of E Proctor &
Stevenson
Ltd or its subsidiary companies, none of whom accept responsibility
for
the contents of the message.



________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
[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