Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-31-2010, 09:20 PM   #1
yogidishman
Registered User
 
Join Date: Jun 2009
Posts: 41
Default add dynamic text message to stage

Please help this newby.

I'm having trouble adding a text message dynamically on stage using as3.
I have an animation that the user interacts with and when a variable reaches a certain value I want to display a message to the user. How can I do this ?

Here is as far as I've got.

var label:TextField = new TextField();
lable1= "here is my response message"
addChild(label1)

When I run this I get a 1067 error that reads:

Implicit coercion of a value of type STring to an unrelated flash type text:Textfield labe1="here is my response message". What am I doing wrong ??
yogidishman is offline   Reply With Quote
Old 01-31-2010, 09:21 PM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

You probably need to do this...
ActionScript Code:
lable1.text = "here is my response message"
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 01-31-2010, 10:02 PM   #3
snickelfritz
Senior Member
 
Join Date: Jun 2008
Posts: 1,206
Default

Here's a specific solution to what you're trying to do.
ActionScript Code:
var label:TextField = new TextField(); var lable1:String = "here is my response message" addChild(label); label.text = String(label1);
snickelfritz is offline   Reply With Quote
Old 01-31-2010, 10:11 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Oh... I convieniently missed '1' in label1... I thought that label1 was the textField instance name... I need better glasses...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:23 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.