Skip to main content
Inspiring
December 17, 2014
Question

Coding for addition using if / and statements

  • December 17, 2014
  • 1 reply
  • 258 views

I have to create an app out of a Flash project the project is simple. Its like a book with each page having a set of buttons ( 3 buttons per page)

each button is actually an answer which there are three choices. AS the viewer chooses one answer from each page I need the correct answers coded so when they ad up to 1000 or whatever number and OVER that will trigger a new page with certain info. If the total is UNDER 1000 then that will trigger a different page to open.

Was wondering how I go about coding this?

any help?

R

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 17, 2014

Have each of your buttons add its value to a number variable and use the number variable to detemine whether 1000 is reached or not.

Inspiring
December 17, 2014

thanks for that but how do I code I believe its an integer?

so if 3 buttons on one page do I code each button on each page or create a variable for each page as the total of the variable must be calculated at the end of the book, follow?

Ned Murphy
Legend
December 17, 2014

var totalValue:int = 0;

There are too many details you have left out for me to determine what you need to do, but you should be able to reason it out based on the question you just asked.   If the variable needs to be used at the end then create one variable and share it for each page so that at the end it represents the sum of all pages.

Each button needs to be coded regardless of where they are.