I'm writing this code in Flash builder and I tested the file in flash, but nothing appears in the swf file. (no text in the screen show , i don't know why) Is there any missing property in the code? Also, when I create text or movie clip with flash tools on the stage and give it an instance name, flash builder doesn't seem to recognize it in the action script code.

    import flash.display.MovieClip;
    import flash.text.TextField;

    public class mark extends MovieClip

        public function mark()

            public var d:TextField=new TextField();

            d.text="Hello world";

  • \$\begingroup\$ That looks right. Are you sure you are calling the code? put a trace statement before the text and see if that is being called. Also you should make sure that mark has been added to the stage as well. \$\endgroup\$ Aug 27, 2012 at 21:04
  • \$\begingroup\$ can you tell me why if you create movieClip in Flash ,Flash builder does not recognize it. \$\endgroup\$
    – XNA
    Aug 27, 2012 at 21:15
  • \$\begingroup\$ It does if you do it right. I don't see any of your code and really that is a separate question. \$\endgroup\$ Aug 27, 2012 at 21:23
  • 3
    \$\begingroup\$ Where is "mark" instantiated? Is mark added to the stage? Is this your main file? How is flash builder connected to flash-cs5? Make sure your project settings are correct. You aren't giving us much insight. Also the reason I think flash builder doesn't recognize your stage objects is because when you use the the instance name in your object it's expecting to be a local variable or a member. At compile time at least. But i'm not 100% sure. \$\endgroup\$
    – Sidar
    Aug 27, 2012 at 21:51

1 Answer 1


The first thing I recommend you is to always start class names with a capital letter. That way you can immediately see whether something is a class or a variable.

But that is style and shouldn't ruin your code. What actually is wrong as far as I know is the public keyword before var d:TextField. You declare that variable inside a function, and variables declared inside functions can only be accessed by code that can access the scope of that function. Declaring it as public doesn't make sense (and probably doesn't work) because the outside world doesn't even know that variable exists (and can't access it).

You'll probably solve the problem by either removing the public keyword or moving the variable declaration out of the mark( ) method.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .