4 Replies Latest reply on Oct 28, 2008 11:56 AM by m_hartnett

    Help cancelling an event

    Handycam Level 1
      I have a component, mentioned in another post (attached here as well), which is canvas component with a two image components in it: one is the "object" itself, and the other is a "close" button.

      The object has a click handler which brings it to the front of the display list. The close button has a click handler which removes the whole object from the parent container's display list. Both of these handlers work fine; the problem is the debugger is throwing an error because a click on the close button is apparently trying to bring IT to the front:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at com.taunton.games::GameItem/clickedMe()[/Users/Shared/WORK/CraftStylish/Ultimate Sewing Room/flex/src/com/taunton/games/GameItem.mxml:50]

      "clickedMe" is the handler that's assigned to the main object, it doesn't make sense on the close button, hence the error. How can I prevent this?