Copy link to clipboard
Copied
Hello, I wouldn't post here if I wasn't desperate to fix this, I've tried everything I can think of. Here's what I'm using:
Flash Builder 4
Flex 4 SDK 4.0.0.14159
I have a pretty simple isometric game with moving items and characters.
Here's the error I'm getting:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.flash::UIMovieClip/addFocusEventListeners()
at mx.flash::UIMovieClip/focusInHandler()
at flash.display::Stage/set focus()
at mx.flash::UIMovieClip/setFocus()
at mx.managers::FocusManager/activateHandler()
So, the error is not occurring in my code, but in the UIMovieClip class, so I can't debug it. I also do not have a way to reliably reproduce it. It seems to happen when I click outside of the flash window, like on another browser tab, taking focus out of the window, but it doesn't always happen, and I can't make it happen, it just pops up sometimes. I've found this blog post that suggests that the solution for this problem is to remove focus from any UIMovieClip before you remove it from the display list:
http://captaincode.wordpress.com/200...kit-for-flash/
I've tried going through my entire application, and before I remove anything from the stage using removeChild(), I run a function to move the focus manager off of it and onto something else, and this error still occurs. This guy points to this bug as the culprit:
https://bugs.adobe.com/jira/browse/SDK-24015
but the jira says that this bug is fixed in 4.0.0.12756, and I'm using a later build than that.
I also found this forum post:
http://forums.adobe.com/thread/465181,
Where this guy solved a similar problem by targeting flash player 10, which I'm doing.
I have lots of UIMovieClip flash components created in Adobe Flash CS3 and using the flex component kit for flash.
Does anyone have any idea what is causing this error or how to get rid of it?
Copy link to clipboard
Copied
Which Flex SDK are you targeting in your project?
wow, sorry, I need to read a little more carefully. When you are compiling your assets in flash, are you compiling them against MX or spark? (i.e. CS5 or CS4, if CS4, which version of the component kit?)
Copy link to clipboard
Copied
I'm using Adobe Flash CS4, with Flex Component Kit 1.1.2. I've looked for an update to the component kit, and I can't find it. If there's a more recent version, I would love to know where to get it.
However, doing this first thing in my application seems to have done the trick:
focusManager.deactivate();
but can't say for certain, because I don't have a reliable way to reproduce the error. Would love to know if anyone else has run into this error and can reproduce it reliably or knows anything about it.
Copy link to clipboard
Copied
If you go here: http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins, at the very bottom of the page it lists the newest component kits. One for Flex 3 projects, and one for Flex 4.
Have you tried the reproduction steps listed in the bug on this behavior? (make sure to note that there is a large correction half way through the comments.) That worked reliably for us to reproduce it every time.