|
|
Search Tutorials
The Variable Value (cont.) While most of these types are pretty self-explanitory, you should always keep in mind that they are different to each other and require different treatment in actionscripting. A number is simply any number and a string is a programmers way of describing text. Note that in the examples above, I've used the number 12 in the string example. Numbers are actually strings when enclosed by the quotation marks.
At this point it is probably a good time to mention that Flash 5 will automatically convert data types when an expression requires it. For example when concatenating a string and a number, the number is converted to a string then added on to the end of the string. Here's an example: "The number " + 5 + " is now a string"evaluates to... "The number 5 is now a string" Boolean is the type used for action that contain conditions like the If statement or the Loop statement. When using the boolean type something can be either True or False. Some programmers choose not to use these words but instead use the number 0 to indicate False and any non-zero number to denote True (usually 1). Nothing is simply the lack of any text (string). In flash many use it to check when the last variable has been processed in a loop function or to see if the last variable in a text file has been loaded. (note: the ... means other codes has been left out of the example)
do {
if ("button" + n == "") {
eof = 1;
}
} while (eof < 1);
|
||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||
|