Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Data Type Conversions

In many cases in ActionScript development, a value needs to be used in a way that its data type will not permit. For example, numbers that are typed into an input field are recognized as strings. To perform math with a number that is considered a String, you have to retype it, or convert it to a Number.

In ActionScript there are String and Number classes, which allow you to work with strings and numbers. These classes have a few built-in methods for recasting and converting data types. String() and toString() are methods of the Number class. Number() is a method of the String class.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial