Skip to main content
Participant
October 14, 2010
Question

Any way to disable quiz click boxes from a parent SWF?

  • October 14, 2010
  • 1 reply
  • 516 views

We've got a parent SWF that serves as a navigational shell, allowing users to move between different Captivate slides which are essentially embedded SWFs. Some of these SWFs are Captivate hot spot quizzes. We've run into a fairly significant issue - when a Captivate slide has a click box, it sets up an event listener for that box. Unfortunately, when a user moves off of that SWF, the event listener is still in place (note: we're not actually unloading the SWF, we're simply hiding it and showing the next SWF). Once a user clicks into the new SWF, the following exception gets thrown:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at captivate.veela_as3::rdClickHandler/CheckSpriteClick()

at captivate.veela_as3::rdClickHandler/CheckAllClicksDown()

at captivate.veela_as3::rdClickHandler/onMousePress()

We've narrowed this down to the click boxes and the event listeners associated with them. I need to know if there's some way that our parent SWF can call into the Captivate quiz SWF in order to disable those click boxes once the user moves off of the SWF. I know that we can disable them from within the quiz itself using an advanced action, but I'm just not sure if the same can be done from an external SWF (ideally, we would just call an advanced action from the parent SWF - I have no idea if this is possible).
Any help would be much appreciated.
- Terence

This topic has been closed for replies.

1 reply

zreichenbachcarr
Inspiring
October 14, 2010

First question, why are you simply hiding and not unloading them?

If you can hide, I am assuming through a visible false or alpha = 0; then it seems like you would have the ability to relocate them as well, and since the loaded swf is housing its own buttons and hit areas they would move with their parent...

So a cheap fix if you can access the objects would be to move them out of view, like to

.x = -5000

.y = -5000

That might work...and might be the easiest way to "Re-add them to the stage without losing info, I am assuming the hide and not unload is for keeping score or something?

You could then move them back to 0,0 if you needed them again...

might help you