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);
        }

    }

}
2
  • 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? Commented Dec 3, 2010 at 13:19
  • I am compiling it through command line Commented Dec 6, 2010 at 10:14

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.