Ninjas4Hire Updates Monday, Wednesday, and Friday. Chat most active 9pm est.

19Apr/101

Creating A Flash Calculator

As stated in our introduction to Flash, you can create all kinds of things. The most prominent being Flash games, which are a good portion of the internet. By creating basic things in Flash, we can further our knowledge, and bring ourselves one step closer to that glorious first game. Creating a calculator is simple, and crude, but the skills used are imperative later in Flash.

Creating your calculator:

  1. Create the shape using the rectangle tool (R)
  2. Add your text with the Text Tool (T)
    • Number One
    • Number Two
    • Total
  3. Draw input fields
    • With the text tool still selected choose 'Input Text' from properties
    • Turn Show Border Around Text on
    • Change your font to Arial, size 18
    • Draw your fields next to 'Number One' and 'Number Two'
  4. Add variables
    • Select the 'Number One' input field
    • In properties set the variable, under options to 'numberone'
    • Do the same for the 'Number One' input field
  5. Draw the dynamic input field
    • With the text tool selected, change it from Input Text to Dynamic Text
    • Draw a dynamic field next to 'Total'
    • Enter 'total' as the variable

Making it a Calculator:

  1. Create a plus button
    • Insert>New Symbol
    • Create a plus button
    • Add it to the stage
  2. Create a subtract button
  3. Add functions to the buttons
    • Select the plus button and open the Actions Editor (F9)
    • "On (release) {
      total = Number(numberone) + Number(numbertwo);
      }"
    • Repeat for the subtract button, substitution - for +
  4. Test your calculator Ctrl+Enter


If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get Flash Player from Adobe.

Related Posts

Tagged as: Leave a comment
Comments (1) Trackbacks (0)
  1. dang nice info bro.

    Like or Dislike: Thumb up 0 Thumb down 0


Leave a comment


No trackbacks yet.