Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-15-2008, 05:22 AM   #1
dc2000
Registered User
 
Join Date: Oct 2008
Posts: 98
Default Errors when displaying TextArea

I have the following code that is supposed to display a static uneditable and non-selectable text message on a Sprite:
Code:
import fl.controls.TextArea;

var rect1:Sprite = new Sprite();

rect1.graphics.lineStyle(4);
rect1.graphics.moveTo(0, 0);
rect1.graphics.lineTo(160, 0);
rect1.graphics.lineTo(160, 50);
rect1.graphics.lineTo(0, 50);
rect1.graphics.lineTo(0, 0);

var lbl1:TextArea = new TextArea();
lbl1.x = 4;
lbl1.y = 4;
lbl1.editable = false;
lbl1.text = "Label";
rect1.addChild(lbl1);


addChild(rect1);
when that is run I get the following error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at fl.controls::TextArea/fl.controls:TextArea::drawLayout()
	at fl.controls::TextArea/fl.controls:TextArea::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/drawNow()
	at fl.controls::ScrollBar/fl.controls:ScrollBar::draw()
	at fl.controls::UIScrollBar/fl.controls:UIScrollBar::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::LabelButton/fl.controls:LabelButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/drawNow()
	at fl.controls::ScrollBar/fl.controls:ScrollBar::draw()
	at fl.controls::UIScrollBar/fl.controls:UIScrollBar::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::LabelButton/fl.controls:LabelButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChildAt()
	at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
	at fl.controls::BaseButton/fl.controls:BaseButton::draw()
	at fl.core::UIComponent/::callLaterDispatcher()
The stage also has a UIComponent button on it.

The FLA file is attached here as well.

Can someone tell me what is wrong here?
Attached Files
File Type: zip TestText.zip (274.5 KB, 100 views)
dc2000 is offline   Reply With Quote
Old 10-15-2008, 05:35 AM   #2
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 3,160
Send a message via AIM to Mazoonist
Default

In addition to importing the TextArea component, you also have to have it in your library. So drag the TextArea component from the components panel to the library (or drag one to the stage and then delete it), and the error messages will go away.
__________________
My Tutorials * My Website
Mazoonist is offline   Reply With Quote
Old 10-15-2008, 05:48 AM   #3
dc2000
Registered User
 
Join Date: Oct 2008
Posts: 98
Default

What if I use TextField instead?
dc2000 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insantiate TextArea? Groady Components 3 07-15-2009 09:02 PM
Textarea not displaying line breaks Cowgirl32 Components 0 04-02-2008 11:01 PM
textArea and img tag Gibberish Components 3 03-29-2008 10:25 AM
TextArea - onRollOver() problems aztlan2k Components 1 08-08-2006 03:56 AM
high ASCII chars in TextArea - how? spacewalk Components 1 04-26-2005 08:14 AM


All times are GMT. The time now is 03:12 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.