A Flash Developer Resource Site

Results 1 to 20 of 47

Thread: “Collect All” To Make Professional Mobile Application in Flash Lite 1.1 Enable Device

Threaded View

  1. #8
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    EMI Calculator application:


    Here is a plan for the EMI Calculator application:


    1. Application will start by a welcome screen.
    2. Login Section.
    3. List of Vehicles with Picture.
    4. Detailed Information of the particular Vehicle which was selected from previous list.
    5. EMI plans and agreement for loan.
    6. EMI Form and Calculate Button or Soft key.
    7. Result Display Screen.
    8. Order Form and Submit Button of Soft key and re-calculate option.

    This is a dummy plan for demonstrating this example. For real application you have to consider more detail notes for every issue. But for this example and also to put steps in the real application this is enough.

    To demonstrate the function I will start first from plan number 6 and 7.

    EMI Form and Calculate Button or Soft key

    For this dummy EMI calculator the basic need is as follows:

    a. Price.
    b. Down Payment.
    c. Flat Rate of Interest.
    d. Tenure.
    e. Number of Installment
    in month is basically one month less from total tenure. But you will face in more formula in this sector in real application. This is depending upon the banks who are giving the loans. It is also vary on different countries laws and plans of loans.
    After getting the inputs we will apply the formula to calculate EMI result.

    Formula:

    EMI = (Price subtract Down Payment) divide 100 multiply Tenure add (Price subtract Down Payment) divide (Tenure multiply 12 subtract 1).
    This is the general formula of EMI calculation. This may vary for different applications.

    Apply Formula into PHP:

    Net Finance = a - b;
    Exposure = (a-b) * 100 / a;
    EMI = ((((a-b) * c) / 100) * d + (a-b)) / (d * 12-1);

    It is a better practice if you name the variables by which it will be clear to understand which variables holds what value and which one is doing what function.

    PHP:

    Actionscript Code:
    <?PHP
    $getPriceAmount=$_POST["sendPriceAmount"];
    $getDownPayment=$_POST["sendDownPayment"];
    $getFlatInterest=$_POST["sendFlatInterest"];
    $getTenure=$_POST["sendTenure"]

    $getNetFinance=$getPriceAmount - $getDownPayment;
    $Exposure=$getNetFinance * 100 / $getPriceAmount;
    $getExposure= sprintf("%01.2f",$Exposure)." %";
    $getNumberOfInstallment=$getTenure * 12-1;

    $getEMI = (((($getNetFinance * $getFlatInterest) / 100) * $getTenure + $getNetFinance) / $getNumberOfInstallment);
    $intEMI = (((($getNetFinance * $getFlatInterest) / 100) * $getTenure + $getNetFinance) / $getNumberOfInstallment);
    settype($intEMI,"integer");
    $setEMI="$intEMI.50";

    if($getEMI>$setEMI){
    $EMI=$intEMI+1;
    }else{
    $EMI=$intEMI;
    }

    echo "&netFinance=$getNetFinance&exposure=$getExposure&EMI=$EMI";
    ?>


    Save the PHP script into the www folder “EMI.php”.

    Now take EMI.fla on Flash Lite 1.1 specification, test the EMI.php from flash. to do that type the following actionScript in the first keyframe on main Timeline:

    sendPriceAmount=56000;
    sendDownPayment=6000;
    sendFlatInterest=12.5;
    sendTenure=3;
    Loadvariables("http://localhost/EMI.php",_root,"POST");


    Make three dynamic variables on stage and named the var "netFinance", "exposure" and " EMI". Test the EMI.fla and see whether it get the proper result from PHP.


    continue...


    marlopax


    Wednesday, August 19, 2009
    Last edited by marlopax; 10-13-2010 at 12:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center