Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Answered Question

 
M$1 January 03, 2009 01:53 AM

FLASH AS3: How do I convert an object to a string?

I have created a group of radio buttons. Each button has a different '.value'.

I want to copy the selected .value (held in group.selectedData) into another variable. I have:

var myvar:String;
trace (ARadioButton.group.selectedData);
myvar=ARadioButton.group.selectedData;

but I get the error 1118: Implicit coercion of a value with static type Object to a possibly unrelated type String.

The trace outputs the string as expected.

Thanks!
Interesting Question?  Yes (0)   No (0)   
RSS
 
 

Best Answer  Chosen by Asker

 
January 03, 2009 03:26 AM
yeah I ran into that inconsistency too. I guess trace calls toString() for you if it needs to or something. which is not normally how those things work.

use .toString();
Source(s):
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Object.html

Asker's Rating:
• Thanks. I think I tried tostring(); and got an error.


Helpful Answer?  (0)   (0)    Tip ilaksh for this answer
Permalink | Report
   Reply  
 
 

Answer this Question

How tips and payments work

This question has already been resolved. You may add an answer to it but you will not be eligible to win best answer or any associated tips.

Related Questions

No questions found.

Ask a Question


140 characters left
Top of Page
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • cfinke
    cfinke
    2nd Degree Black Belt
    28763 Points
    M$29.75 Earned
  • bunnyphuph...
    bunnyphuph...
    2nd Degree Black Belt
    21860 Points
    M$774.74 Earned
  • opher
    opher
    Purple Belt with a Brown Tip
    6470 Points
    M$246.24 Earned
   See All
 

Most Popular Tags

mahalo(1824)
music(516)
iphone(490)
google(397)
online(378)
food(349)
money(298)
beer(294)
movies(288)
apple(262)
aotd(235)
free(233)
video(231)
health(231)
dog(219)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.