Quick Simple Question

19 views
Skip to first unread message

brucend75

unread,
May 31, 2011, 2:36:24 AM5/31/11
to as3-signals
A bit embarrassed, but I am having a bit of trouble wrapping my head
around a basic AS3 Signals concept.

I have created my signal class. In my transmitting object, I have
instantiated the signal and sent it.

Now, here is where I am confused.

In the receiving object, what do I need to do to get that object ready
to receive the signal object.

I am assuming that part of the code involves signal.add(myFunction),
but I am not sure how to set up the preceding code in the receiving
object. I know how to handle the signal once it is received, but not
sure where/how to hang the add listener function.

Senthil Kumaran Chinnathambi

unread,
May 31, 2011, 12:04:18 PM5/31/11
to as3-s...@googlegroups.com
Hi,

See this tutorial . It will help you.
All the best

http://johnlindquist.com/2010/01/21/as3-signals-tutorial/

brucend75

unread,
May 31, 2011, 6:23:44 PM5/31/11
to as3-signals
Thanks for the reply.

I've watched that video, and studied the excellent article at
http://www.developria.com/2010/10/an-introduction-to-as3-signals.html.

I may have missed something, but John's tutorial and the above link
all seem to show the adding of the signal listener as being called
from the sending object. I want to add the signal listener in the
receiving object.

Can I just do "this.mySignal(myFunction)" in the receiving object, or
do I need to import anything in the receiving object or do anything
else?

Sorry for being obstinate.

On May 31, 9:04 am, Senthil Kumaran Chinnathambi

kris range

unread,
Jun 1, 2011, 3:23:44 AM6/1/11
to as3-s...@googlegroups.com
Your sending class would have the signal as a public property. Then in
your responding class, you would just reference the sending class
instance and the property on it and add the listening function like
below:

sendingClassInstance.someSignal.add( myFunction );

Reply all
Reply to author
Forward
0 new messages