Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: how to use string.fromCharCode()
From: Helen Triolo
Date: Tue, 12 Dec 2000 03:13:03 GMT

Yeah, it looks to me like the manual is wrong on this one. It should be
something like:

myString = String.fromCharCode(c1,c2,...cN) where cn = the ascii value
of a character

because

myString.fromCharCode(112,101,110,99,105,108);
trace("myString: " + myString);
newString = String.fromCharCode(112,101,110,99,105,108);
trace("newString: " + newString);

produces this output -->
myString:
newString: pencil

Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff

Andrew Shirk wrote:
>
> oh. JEEZuzz!! Now *that's* intuitive after reading
> "myString.fromCharCode(c1,c2,...cN); " in the manual!! Sheesh Macromedia.
>
> Oh well. I knew normal mode must be good for something :) thank you so
> much for the reply, helen. i was beginning to think nobody else knew either.
>
> andrew
>
> >It's a weird one. After trying a zillion things and getting no results,
> >it occurred to me to try normal mode and, voila! got it in the right
> >format and got some output. But it seems only to work as a method on
> >the String object itself (not as a method used on an object of type
> >string). The following creates variable x with value "pencil":
> >
> >x = String.fromCharCode(112,101,110,99,105,108);
> >trace("x: " + x);
> >
> >(of course, so does x="pencil", but if you want to create a string from
> >a bunch of ascii values, including non-printable characters like cr and
> >lf, then it looks like fromCharCode is the new replacement for chr).
> >

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: how to use string.fromCharCode(), Andrew Shirk
  Re: FLASH: how to use string.fromCharCod, Andrew Shirk

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]