Here, the trace statements will evaluate the variables and equations, and will display their values. Trace("The total is: " + price * quantity) Next, add some trace statements to verify that Flash is able to access the values assigned to the variables: This is pretty much the same thing, except we have fewer lines of code. Here, each variable is declared and assigned a value in one statement. Let's do that.ĭelete the lines of code that we've already typed and replace them with this: If you want, you can also combine the variable declaration and the value assignment in one statement. ![]() ![]() You also don't need to declare the data type again. The var keyword is used to declare or create the variable. When assigning a value to a variable, there is no need to use the var keyword again since we've already done that at the beginning.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |