PDA

View Full Version : [AS3] Can't import UIComponent in Flash CS4?


CarlF
11-02-2011, 04:57 PM
So I add this line to my .FLA file in the first frame's script:

import mx.core.UIComponent;

I receive this error:

1093: Syntax error.

in UIComponent.as line 54. Double click on that in the Compiler Errors panel and I see:

#include "../core/ComponentVersion.as"

OK, the syntax error is likely in ComponentVersion.as ... except it really, really shoud not be. And if I load that file into the Flash editor and syntax check it has no errors. However, if I copy the sole non-comment line of that file (static var version:String = "2.0.2.127"; ) into UIComponent in place of the #include, it works????

Now I get this error:

5007: An ActionScript file must have at least one externally visible definition.

Excuse me? This is a class definition file suppled with Flash!

Any clues would be gratefully received.

I'm using Flash CS4 (10.0.2).

CarlF
11-03-2011, 12:19 PM
As explained to me elsewhere: problem was that I was importing Flex, not Flash, classes. Using fl.core.UIComponent worked fine.