Hi -
I’ve got a mouse event that I need to call from a function within the mouse event function, but I’m getting an error. Here’s the code I’m using:
[FONT=courier new]function onTrButtonClick(me:MouseEvent):void[/FONT]
[FONT=courier new]{[/FONT]
[FONT=courier new]trace ("Do something");[/FONT]
[FONT=courier new]//more stuff in here[/FONT]
[FONT=courier new]//function for back button click[/FONT]
[FONT=courier new]//NOTE: back button only gets built during this function, so i can't move this outside onTrButtonclick[/FONT]
[FONT=courier new]function onbackButtonClick(me:MouseEvent):void[/FONT]
[FONT=courier new]{[/FONT]
[FONT=courier new]trace("back button clicked")[/FONT]
[FONT=courier new]onTrButtonClick(null);[/FONT]
[FONT=courier new]}[/FONT]
[FONT=courier new]}[/FONT]
This is returning the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at troubleshooting_fla::MainTimeline/onTrButtonClick()
at Function/<anonymous>()
What am I doing wrong?
Thanks!
Miriam