Jump to content


Photo
- - - - -

Simple calculator


  • Please log in to reply
1 reply to this topic

#1 fedekiller

fedekiller

    Young Padawan

  • Members
  • Pip
  • 18 posts

Posted 17 June 2005 - 01:24 PM

1. make a new document
2. make 2 "text input" and one "dinamic text"
3. instancenames:
a) first_txt
:) second_txt
c) result
4. make 4 buttons ( +, -, *, / )
5. put this code in the "+" button:

on (release) {
_root.result.text = (_root.first_txt.text)-(_root.second_txt.text)*-1
}

red=this is important
In this case the .text are ver important cuz we want to know the content, no the box.

put this code in the "-" button:

on (release) {
_root.result.text = (_root.first_txt.text)-(_root.second_txt.text);
}


this in the "/" button:

on (release) {
_root.result.text = (_root.first_txt.text)/(_root.second_txt.text);
}


and this in the "*" button:

on (release) {
_root.result.text = (_root.first_txt.text)*(_root.second_txt.text);
}


and you finish ^^

example download link: here

#2 Donna

Donna

    Retired P2L Queen!

  • P2L Staff
  • PipPipPipPip
  • 12,330 posts
  • Gender:Female
  • Location:B.C Canada

Posted 17 June 2005 - 02:03 PM

Just a suggestion to add a final swf effect to this and also some images and more explanation into the tutorial.

Example Of what I mean:

http://www.flashkit....o-816/index.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users