Simple Flash Calculator in Flash 8
You need you movie clip changed color? Piece of cake! This tutorial will show you how to change movie color using simple actions script technique. If you experience some difficulties while reading this tutorial it is recommended to read all the previous tutorials on http://www.metamorphozis.com written by me as some aspects might be discussed earlier.

1. Launch Flash MX 2004

2. Create new Flash file. Click File > New…
Screenshot

3. Select Flash Document in a new window
Screenshot

4. Using "Rectangle Tool" draw a background for text field.
Screenshot

Screenshot<

5. Select the first frame of the "Layer 1", right click and select "Copy Frames"
Screenshot

6. Then select next empty frame in the same layer, right click and select "Paste Fames"
Screenshot

7. 7. Repeat steps "5" and "6". You should get something like this:
Screenshot

8. Create new layer
Screenshot

9. Using "Text Tool" create in the new layer text field. The field should be exact size as the background shape. Select "Input Text".
Screenshot

10. 10. Type "int1" in the "Var:" field
Screenshot

11. Now repeat steps "5" and "6" but for the second layer.
Screenshot

12. Select text field in the second frame and change "Var:" field to "int2"
Screenshot

13. Select text field in the second frame and change "Var:" field to "total". Change "Input Text" to "Dynamic Text"
Screenshot

14. Now we need buttons to control the movie. Create new layer. With the "Rectangle Tool" draw a shape, right click and select "Convert to Symbol..."
Screenshot

15. Select "Button" in the popup window.
Screenshot

16. Double click the button. Right click on the "Hit" frame and select "Insert Frame"
Screenshot

17. Return to the first scene. Repeat steps "5" and "6" for third layer.
Select the first frame of the third layer and with the "Text Tool" add a label for first button "Enter First Value"
Screenshot

18. Add label for second frame: Enter Second Value and for the third frame: Click Here to Start

19. Now we need to add some Action script to make it work. Create new layer. Right click the second frame and select "Insert Blank Keyframe".
Screenshot

20. Repeat last step for third frame. Now select the first blank frame in the "Layer 4" Open "Action" panel and add following code:
var a = 0;
var b = 0;
var c = 0;
int1 = 0;
int2 = 0;
stop();
Screenshot

21. Select second frame and enter Action script:
stop();
Screenshot

22. Select third frame and add coding:
stop();
onEnterFrame
{
total = Number(a) + Number(c);
}
Screenshot

23. Select button in the first frame of the “Layer 3” and add action script:
on(press)
{
a = int1;
gotoAndPlay(2);
}
Screenshot

24. Select second button and add coding:
on(press)
{
c = int2;
gotoAndPlay(3);
}
Screenshot

25. Select button in the third frame and add some code:
on (press)
{
gotoAndPlay(1);
}
Screenshot

26. Now we need to add some Action script to make it work. Create new layer. Right click the second frame and select "Insert Blank Keyframe".

Click here to download source fla file.

About the Author: Oleg Lazarenko
Production manager of Metamorphosis Design
Flash Templates,Custom design, Website Templates,
Web design Articles and Tutorials.

You may reprint this tutorial for free as long as the content, About the Author sections and all links remain unchanged.