6.813 - Not responding to MouseEvent

3 views
Skip to first unread message

Kimberly Baldauf

unread,
Apr 5, 2010, 8:30:44 PM4/5/10
to 68...@googlegroups.com
Alright, this has been driving me nuts all weekend. I feel like I'm missing
something completely obvious, but I can't get any of my MouseEvent functions to
trigger (yes, for problem 1).

I've put them with the other board.AddEventListener calls. Are they supposed to
be added somewhere else instead or something like that?

-Kim

Nicole Bieber

unread,
Apr 5, 2010, 8:32:26 PM4/5/10
to 68...@googlegroups.com
Try this.addEventListener instead of board.AddEventListener - and not
inside the changeWatcher, just in onLoad
-n

Alex Jiang

unread,
Apr 5, 2010, 8:33:00 PM4/5/10
to 68...@googlegroups.com
You should be adding it in onLoad() but outside ChangeWatcher. Make sure
you are writing this.addEventListener since you're adding the listener
to the checkerboard.

Wolfe Styke

unread,
Apr 5, 2010, 8:36:33 PM4/5/10
to 68...@googlegroups.com
Also make sure that the function you attach looks like either:

funcName
or
function(event:MouseEvent):void { funcName(event, other vars you might want);}

If you try to attach funcName(event, other vars, etc) as the function, then funcName will be evaluated and what it returns will be assigned as the function to be called when the event happens for the listener.

~ Wolfe

--
To unsubscribe, reply using "remove me" as the subject.

Reply all
Reply to author
Forward
0 new messages