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

Q&A

Q1:What if I have a variable named the same thing as a movie clip? How do I differentiate between them in my code?
A1: You can't. For example, if you have a movie clip instance at the root level named mine and you create a variable at the root level named mine, you will not be able to access that movie clip instance. Always use different names for movie clip instances and variables.
Q2:If I have a movie clip that uses all sorts of colors, how does setting the Color object of the movie clip affect it?
A2: It changes each color depending on how it relates to the Color object. It is difficult to predict unless you are very good with colors. However, you can test the changes by choosing Advanced color in the Properties panel and then clicking the Settings button. You can then adjust the numbers and see the changes live.
Q3:If I can't trust the user's computer time, how can I get a time that I trust?
A3: Only server time is trustworthy, and then only if you trust your server. In most cases, for instance, in an e-commerce application, you don't need to trust the time on the client's machine because the server will apply its own time when the transaction is made. However, you can always set up your server to pass the time to the Flash movie via one of the external data methods discussed in Hour 10, “Creating and Controlling Text.”
Q4:Can arrays store items of different types? Can an array contain numbers and strings?
A4: Yes, an array can store data of mixed types. For instance, suppose that you had an array that stored mouse location and clicks. Most of the elements might be x and y locations, but some might be the string “click” to signify that a click was made at that point. You just have to make sure that the code that reads the array can handle what comes.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint