Hello all,
I’m trying to create TextArea component in an external .as file. For starters I’ve copy the code directly from the Adobe AS3 reference page
import fl.controls.TextArea;
var aTa:TextArea = new TextArea();
aTa.move(100,100);
aTa.setSize(200, 200);
aTa.condenseWhite = true;
aTa.htmlText = '<b>Lorem ipsum dolor</b> sit amet, consectetuer adipiscing elit. <u>Vivamus quis nisl vel tortor nonummy vulputate.</u> Quisque sit amet eros sed purus euismod tempor. Morbi tempor. <font color="#FF0000">Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.</font> Curabitur diam. Suspendisse at purus in ipsum volutpat viverra. Nulla pellentesque libero id libero.';
addChild(aTa);
I just keep getting this error when it runs from a .as file.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.controls::TextArea/drawLayout()
at fl.controls::TextArea/draw()
at fl.core::UIComponent/callLaterDispatcher()
But if I put the same code in the timeline of a new file it seems to work fine.
Is there any class I still need to import when running this from a .as file? Thanks for your help