Why not simply:

function getTextFromField ( txtfield )
{
    return txtfield.text ;
}

Or just peek in the manual where you can find that every textfield has a
.text property (amongst other properties) so you can simply retrieve it with
textfieldinstance.text. A special function seems way over the top unless one
has nothing better to do ;)


A textfields value is by default a string (text == string returns true), so
why want to convert it. 

John


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Laurent
CUCHET
Sent: Saturday, October 07, 2006 11:36
To: Flashcoders mailing list
Subject: [Flashcoders] >> function and convert String


I would like to take textfield value.

How can I convert string ?

function sqr(x) {
    var tx = "_level0.rec"+x;
    var c1 = tx+"1.text";
    trace(c1); // give
}
Sqr(1); // Give string ³_level0.rec1.text² not the textfield value

Thank You
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to