Skip to main content
Participant
February 12, 2007
Question

Is it possible to create a text field that will show in Flex project

  • February 12, 2007
  • 1 reply
  • 16310 views
I am trying to built a custom class and wonder if it's possible to create a text field that will show in Flex project

for example, simple script like the one below, will create a text field in Action script project, but if I want the text to be displayed in Flex project what do I do? I am not sure if it's even possible...

PS
I can't use the compile swf file since the info is being pushed dynamically and I want to be able to move the message on the screen.

package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.text.TextField;

public class text extends MovieClip
{
public function text()
{
var field:TextField = new TextField();
addChild(field);
field.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi tortor purus, aliquet a, ornare ac, suscipit a, est.";

}
}
}
    This topic has been closed for replies.

    1 reply

    Participating Frequently
    February 14, 2007
    Clarify what you mean by "show".

    If you mean show from Flex builder design mode, etc, then you need to ask in that forum.
    Known Participant
    February 14, 2007
    HI!,

    I think you should separate programming for AS3 and for FLEX, this is beacuse they both use different class packages. If you want your classes to be FLEX compatible you need to extend them from Flex Objects and not from AS3 Objects.

    In sum, if you want your class to be processed by let's say the application object then you need to extend it from mx.core.UIObject.

    This is because there are lots of methods that FLEX uses to place your class on the screen that are not used by normal AS3 applications.