View Full Version : display component using actionscript
shmoo525
01-12-2008, 06:33 PM
Can anyone explain the exact procedure for displaying a 2.0 component on the stage? I'm trying to create and display a TextArea component, but it's not actually showing up (although the text that I load inside it IS showing up).
Also I'm not really sure how to format the text inside it.
Thanks :)
xxneon
01-12-2008, 06:39 PM
you need to have it in your library.. you dont need it on the stage though..
shmoo525
01-12-2008, 07:25 PM
Yep, it's in my library. Here's the code I have so far:
form.createClassObject(mx.controls.TextArea, "myTextArea", 0);
myTextArea.setSize(200, 100);
myTextArea.multiline = true;
myTextArea.html = true;
myTextArea.editable = true;
myTextArea.wordWrap = true;
myTextArea.enabled = true;
myTextArea.visible = true;
myTextArea._x = 45;
myTextArea._y = 208;
myTextArea.vScrollPolicy = "off";
myTextArea.hScrollPolicy = "off";
myTextArea.restrict = "a-z A-Z0-9";
myTextArea.text = "testing";
EDIT:
Well, it looks like I just had a typo of "form" elsewhere in my code, duh :) It works fine now. Although, I'm still not sure of the difference between createClassObject and createObject. The livedocs are kind of confusing...
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.