0

In the Below action script file i get an error saying cannot import mx.controls.Label,how is this to be resolved

  package {
    import flash.display.Sprite;
    import mx.controls.Label;

    public class cld extends Sprite
    {
        public function cld()
        {
            var myLabel:Label = new Label();
            myLabel.text = "hello";
            addChild(myLabel);
        }

    }

}
Rajeev
  • 44,985
  • 76
  • 186
  • 285
  • How are you compiling your app? Command line? With Flex/Flash builder? With some other tool? Where/When do you get the error? In the Flash Builder Console? AT Compile Time? – JeffryHouser Dec 03 '10 at 13:19
  • I am compiling it through command line – Rajeev Dec 06 '10 at 10:14

1 Answers1

1

Make sure it is Flex project and that in project properties->Flex Build Path->Library Path you import the framework.

Maurycy
  • 1,324
  • 1
  • 11
  • 33
  • He never said he was using Flash Builder. If it was a Flex project, he shouldn't have to add the Flex framework info himself. – JeffryHouser Dec 03 '10 at 13:18
  • I realize that, but if it was AS project, or if he messed with the settings (or just some plain ol' bug) that thing could've been unset. – Maurycy Dec 03 '10 at 20:09