flash 8 button actionscript help nutrition chart?

will_71892

New member
Joined
Jul 20, 2008
Messages
5
Reaction score
0
Points
1
im pretty new to flash 8, and i am trying to make like a calorie chart thing so that when i click on the right picture (apple, etc.) it will add like 80 calories 5 total fats.... etc. and i will have a main chart that it keeps adding onto. so that when im done clicking on all the stuff i ate, it will give me my totals. i do not think this should be too hard, but i am new and dont know alot about actionscript.

so i was wondering, i have a dynamic text box which is hwere im guessing the calories numbers, sodium number, etc, are gonna be displayed. and obviously the picture is going to be a button. but i need to know actionscript for "if button on release, then add 80 to global.calories or something like that, and then set the dynamic textbox variable to global.calories??? something like that. any help will be appreciated. thanks
 
You're along the right lines... this is what you need.

Dynamic text box -> Var = "calories"

On the frame enter the following AS:
calories = 0;

On the button enter the following AS:
on(release){
_root.calories += 1;
}

Have fun! =]
 
You're along the right lines... this is what you need.

Dynamic text box -> Var = "calories"

On the frame enter the following AS:
calories = 0;

On the button enter the following AS:
on(release){
_root.calories += 1;
}

Have fun! =]
 
Back
Top