Your Ad Here

December 20, 2009

Adding Function

Name : Adding Function in Macromedia Flash
Category: Intermediate

In Flash many functions can be performed by using Action script. We can make a simple calculator in Flash. Here we are going to create a simple program in which two numbers will be added.

1- First open up Macromedia Flash and create a new file.

2- Create a text field in the Properties select the type as Input text and name it as “A1”.







3- Make sure the text is still selected. In the Properties select the button “Show border around text”.







4- Make another field with same attributes (text type, border) and name it as “A2”.


5- Make another filed and select type as Dynamic text, also select the border function. Name it as “Sum”.

6- Make a button and write action as follows:

on (press) {
Sum.text = Number(A1.text)+Number(A2.text);
}

7- Arrange the elements, like this one :











8- All done, now test the movie by pressing Ctrl+Enter.

No comments:

Post a Comment

Please use sensible language.....!