0

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.swf (466 bytes)
Rajeev
  • 44,985
  • 76
  • 186
  • 285

1 Answers1

0

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?

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • I meant that the path where mxmlc resides is included in the bash file .please see the edited question – Rajeev Dec 06 '10 at 17:18
  • @Rajeev We are moving beyond my Linux experience here. The bat file didn't help me solve your problem. Even if mxmlc is known, you still need to tell mxmlc where to find the Flex code or compiled SWCs. Do that using the library-path command line argument. – JeffryHouser Dec 06 '10 at 20:05