How to create a simple script for adding two numbers using flash script?



Answer:
place this in the first frame of the first scene of the file.

global.fadd = function(x, y)
{
var temp = x + y;
return temp;
}


then you can call the function anywhere in the movie and even in movie clips use (the wahtever part can be replace with anything)

whatever = fadd(18, 50);

or put in two variables again they can be numbered whatever you like
whatever = fadd(sa, sb);


check out this site it has all you will ever need to learn flash
http://www.flashkit.com
1000's of open source file that you can edit and use.
100's of tutorials
A brilliant forum fully of professional flash website designers and coders.
It also has load of fonts and images that you can use in your work.
And all that for free.


for lots of other useful maths function you can use you can download my open source movie from flashkit. link below
http://www.flashkit.com/movies/scripting. Other Questions and Answers:
  • Supervisor or Friend?
  • is this happens normally?
  • Should I change jobs at age 50 ??
  • What's the difference between an attorney and a lawyer?
  • Insurance Sales Career with AAA?
  • Job interview Question?
  • How many hours do you spend wasting time on the net per work day?
  • How do you research about a potential employer?