Flash: fl.managers:FocusManager could not be found FIX October 26, 2008
Got these compiler errors compiling a document level script only movie, that didn't use any components. That had an import statement like
-
-
import fl.managers.FocusManager;
-
var fm : FocusManager;
-
fm = new FocusManager(view);
-
fm.activate();
-
You would think that would work, however when compiling it gives these errors:
1046:Type was not found or was not a compile-time constant: FocusManager
1180:Call to a possibly undefined method FocusManager
1172: Definition fl.managers:FocusManager could not be found
The last is the key to solving it, it means that despite the import request, the compiler can't find anything else to go with it. Meaning that it's not actually there!
Solution
The solution is easy. Take any interactive component (Label, Button are smallest), from the components library, drag it to the stage, then delete it from the stage. At this point the library will have a bunch of stuff for that particularly component, hidden within (likely the CompiledClip, "ComponentShim") is the appropriate magic to get FocusManager. Then recompile..should be fine.

3 responses to 'Flash: fl.managers:FocusManager could not be found FIX'
[...] Flash: fl.managers:FocusManager could not be found FIX Got these compiler errors compiling a document level script only movie, that didn't use any components. That had an import statement like import fl.managers.FocusManager; var fm : FocusManager; fm = new FocusManager(view); fm.activate() … [...]
omg that’s retarded! What an unlikely workaround, but thanks so much for providing the fix.
Never knew about this problem but today met it. It’s not fair I think. And it made me very upset. I’ve already completed developing an online mp3 player. There are so many shapes and so on…. functions, objects, buttons… and all of them are just 10 KB, because there is no even one thing in the library of fla file… even one… Now I have to add some Button that makes my swf to increase up to 24 KB?!
That’s not good… that’s silly… I prefer not to use FocusManager
I don’t mean, what you say is silly. If you say, this is the solution, ok, this is the solution. But why didn’t the developers of Flash think about this? Weird….
However, thanks for the information.
Add a Comment: