createClassObject returns a reference to the object, so try:

var oNew:mx.controls.Label= tabNav.createClassObject(mx.controls.Label,"lb",getNextHighestDepth(),{_x:680, _y:0,text:"Ask Us",styleName:"asktext"});

oNew. addEventListener("click",call);

 

And beware of scope issues.  You might need to use Delegate.

 

Tracy


From: [email protected] [mailto:[email protected]] On Behalf Of shawnb457
Sent: Wednesday, September 27, 2006 10:17 AM
To: [email protected]
Subject: [flexcoders] Flex 1.5 createClassObject() adding a label error "need help"

 

I'm tring to and a label using the createClassObject();
function createAskUs(){
tabNav.createClassObject
(mx.controls.Label,"lb",getNextHighestDepth(),{_x:680, _y:0,text:"Ask
Us",styleName:"asktext"});

lb.addEventListener("click",call);

//Dumper.dump(lb);

}

But the instance name "lb" is always undefined.

Thsnk you
Shawn Brinkman

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to