views:

1089

answers:

4

I searched it for while but didn't find anything like printf in Action Script.

That makes it a little difficult to generate formated strings.

A: 

The only function I know that prints to a standard output is trace() (debug purposes only) , which can take virtually any type of variable.

I might not have understood your question, though.

Isaac Clarke
Actually, I mean something like "sprinf". I don't need to send text to console. I need to generate formatted strings.
ablmf
What for ?On a TextField ?Typing is very limited in AS3 (Number, int, String, basically), I think you may want to give us more details about what you want to do.
Isaac Clarke
+4  A: 

take a look at this --> http://www.stimuli.com.br/trane/2009/feb/21/printf-as3/

vitaLee
Also http://code.google.com/p/printf-as3/
Michael Brewer-Davis
+1  A: 

There is the Formatter classes that you could use or create custom formatters.

http://livedocs.adobe.com/flex/3/html/help.html?content=createformatters_2.html

Beverly Guillermo
+2  A: 

think you might be looking for StringUtil.substitute()

take a look here: https://www.adobe.com/livedocs/flex/2/langref/mx/utils/StringUtil.html#substitute()

Acatl Pacheco