von Daniel am 22.Dezember 96 um 15:21:24:
zu: actorList manager von Daniel am 22.Dezember 96 um 15:17:47:
Exactly. Something like...
Make an object. Call it objectEventManager or something and add it to the
actorList. Have that object manage clicks, rolls etc... for all GUI
objects. Any GUI object can have properties that tell the
objectEventManager what kind of events it wants to receive and these are
set when the object is created and can be changed at runtime if needed.
Every GUI object registers itself with the objectEventManager when it is
created so it can receive events.
Roll messages are sent by the objectEventManager to any object requesting
them on every stepFrame. The objectEventManager determines what object/s
is being rolled over and send a roll message to the object. With the change
in functionality of the rollOver()in D5, this is pretty speedy.
Click messages are a little different. First a mouseDown handler in a movie
script notifies the objectEventManager that there was a click. (can't test
for a mouseDown from within a parent script) Then the objectEventManager
determines which object/s should receive click messages and sends them.
This kind of approach sets up a pretty good click and roll dispatch
mechanism. You can then work in some code for setting button states
according to what's happening and even some cursor behavior if you want. If
you can get something like this working you can save a lot of time on
certain projects.
The important thing is to keep the GUI objects out of the event mechanism.
The GUI objects (buttons, dials, sliders, etc...) just sit there and wait
to be told what to do. They have methods that allow them to respond
accordingly.
D. Plänitz