ActionScript 3.0 Lesson 18: How to Create a Commission Calculator

Sun, Aug 23, 2009

ActionScript


Enter the values below and click calculate

This movie requires Flash Player 9


THE COMMISSION CALCULATOR IS NOW A HIT GADGET PROVIDING ADVERTISEMENT REVENUE CLICK HERE TO SEE!

In this 7 minutes Flash tutorial in High Definition (HD) resolution, Avraham draws a calculator on stage and adds functionality. Great examples on different text types in Flash, Static, Input and Dynamic.

DOWNLOAD THE SOURCE FLA FILE
DOWNLOAD THIS TUTORIAL TO YOUR HARD DRIVE

HERE IS THE SOURCE CODE!

//Comission Calculator
//by AVRAHAM SALTOUN
// solutions at say-web dot com
// FREE TO USE AND DISTRIBUTE

myButton_btn.addEventListener(MouseEvent.CLICK, FindComission);
// This will set the compiler
// waiting for a mouse click
// on our button

function FindComission (event:MouseEvent):void
{
// Let’s find out what is on our screen!
var myAmount:Number = Number(Amount_txt.text);
// This will find out what is on the Amount Box
// and convert it to a value

var myRate:Number= Number(Rate_txt.text)/100;
// Since we are looking for a percentage
// we are dividing the value by 100

var myComission:Number = myAmount* myRate;

// Now let’s put the result
// in the Dynamic Text Box
// The Value has to become a string

Total_txt.text = String(myComission);

//Thanks for Watching!!

Related Articles:

, , , , , , , , , , , , , , , ,

Leave a Reply

Security Code:

AVA Trading Forex
WIX create a FREE website.
Try ACT! 2010 Today
Accept Credit Cards
UseNeXT Fast Downloads
For Free Stuff Click Here

Get Paid for Filling Surveys


Go Daddy $7.49.com sale 125x125 Huddle Collaboration
oDesk Certified Action Script Programmer oDesk Certified Adobe Flash CS3 Designer oDesk Certified Adobe Photoshop 6.0 Designer

Compare Web Hosting Services and Prices

web hosting - Web Hosting guide to popular hosts.

Twitter Followers