How to Learn Flash Code

How to Learn Flash Code thumbnail
http://img.xatakamovil.com/2008/10/adobe_flash.jpg

The language used to program operations in Flash is called ActionScript. This language shares many of the qualities as other programming platforms. Successfully learning to program ActionScript requires the ability to manipulate its basic structure and environment. The basics of ActionScript include using the output window, variables, comparisons, mathematical operators, and logical conditions.
Copy the codes in the following steps, substituting your own values and variables.

Things You'll Need

  • Familiarity with basic Flash environment
Show More

Instructions

    • 1

      Learn how to use the output window in your programming. The output window is a convenient tool that allows programmers to test the output of their programs during the development process. It is analogous to testing applications in the Windows or Unix shell. The output window is called by using the trace() command and then going to Test Movies ->Send->Output. The code
      trace("trace test!")
      prints the text "trace test!" to the output window.

    • 2

      Learn how to utilize global and local variables. Variables are used as placeholders for alphanumerical data. In ActionScript you can declare a global or a local variable. The global variable is available to the entire program while a local variable is used only in a specific operation. To declare a global variable write the name of the variable and the value. "balance = 100," assigns the value of 100 to the variable "balance." To declare a local variable write "var" and then the name of the variable, "var balance = 500" assigns the value of 500 to the local variable name "balance."

    • 3

      Learn how to use comparisons. Comparisons can be used to compare two or more values and utilize the following symbols; <(less than), >(greater than), =(equal to), !=(not equal to), >=(greater than or equal to),<=(less than or equal to). To use comparisons declare a variable and declare a second one with a comparative relationship. balance_matt = 120, balance_mary > balance_matt. This states that balance_mary will always be greater than balance_matt.

    • 4

      Learn to use mathematical operators. These operators work by using the following symbols; + (add), - (subtract), / (divide), * (multiply). To divide you simply declare a variable that carries out a division operation. divide = 4/2 (result is 2). The same structure follows for the other operators: sub = 5-3 (result is 2), mult = 4*5 (result is 20) and so on.

    • 5

      Learn to use logical conditions. To use logical conditions you must construct a cause and effect relationship through if/then statements. To do this in Flash your script must contain the if statement and the instruction. The following code prints a statement to the output window if a condition is met.
      var balance = 1300
      if(balance >= 1200){
      trace("Matt is richer than Mary!")
      }
      Since the global variable "balance" is assigned a value of 1300 the sentence will be printed to the output window.

Tips & Warnings

  • Once you learn the basics you will be able to develop more advanced scripts which incorporate other structures such as functions and for/while loops. ActionScript is not a very strict language. You do not have to declare variable types nor is specific syntax used to indicate line truncation.

  • The output window will only display a textual readout of the program as it is meant as a testing environment. Do not expect it to display graphics.

Related Searches:

References

Comments

You May Also Like

  • How to Learn Inpatient Coding Through Distance Learning

    Inpatient medical coding is the practice of assigning codes to procedures and diagnoses related to patients in a hospital. A medical coder...

  • How to Learn ActionScript Flash

    If you enjoy playing computer games or browsing websites, but believe you could improve the animation aspects, then learning Flash ActionScript may...

  • How to Learn Flash Programming

    Flash programming has become a common means of presenting interactive media online. Mastering Adobe Flash opens up a world of possibility for...

  • How to Learn Flash & XML

    There are many useful types of Flash components you can build using XML. If you're learning Flash Web development, it makes sense...

  • How to Learn Flash Slideshow

    A Flash Slide Show is similar to other slide shows, like those created in Microsoft's PowerPoint, but also have elements of other...

  • Learning Flash

    Flash software creates animations sometimes called Flash movies. Sound and images can be added to Flash movies, with graphics being used to...

  • How to Learn Medical Billing and Coding

    Medical billing and coding schools advertise that you can learn how to code medical bills and earn $30,000 or more from home,...

  • How to Learn Flash Online

    Adobe Flash can be a useful web design tool, allowing you to create interactive websites with a lot of flair. Thanks to...

  • How to Learn Morse Code in Half an Hour

    Morse code is a code system that employs a series of dots and dashes that represent the letters of the alphabet. For...

  • How to Learn Morse Code

    Chances are you know some code. How about the famous distress signal S.O.S.--three dots three dashes three dots? Learning Morse code takes...

Related Ads

Featured