Cannot import mx packages
In the Below action script file there is an error saying cannot import mx.controls.Label, I am compiling this through command line on,linux and the environment variable path is set where flex is installed ,how to resolve this
package {
import mx.controls.Label;
public class Test
{
public function Test()
{
Alert.show("Test");
}
}
}
Edit:
[root@localhost tmp]# mxmlc Test.as
Loading configuration file /opt/flex/frameworks/flex-config.xml
/tmp/Test.as: Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.
/tmp/Test.s开发者_高级运维wf (466 bytes)
I'm pretty sure you need to add the Flex source (or SWC) to the library path of your command line argument. Look at the library-path command line argument.
I'm not entirely sure what you mean when you say "the environment variable path is set where flex is installed". What environment variable? How is it used? Perhaps you'll want to show us the command line you are using and/or the batch file?
精彩评论