A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: variable handling

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    25

    Angry

    Hi guys,
    I have this problem I hope somebody can help me, Before i tell u my problem let me explain my

    project a little. I am creating a small feed back presentation where the user enters information about

    his company and based on the formulas flash calculates & gives him the desired output.

    In the first frame i have included null values for the text field variables where the user will feed in

    the desired data and based on the data filled in flash will calculate a certain output. All the formulas

    are placed in an external .as file which i have puled into flash using the include script.

    My problem-Incase i enter all the values myself in the first frame of the action script then everything

    is fine it calculates everything all right.
    But if i leave the values as null the i enter the same values in the text field it does not do the

    calculation it just displays as two chracters joined together. Butb when i trace the values entered it

    shows all the right values entered.

    Ex- I ask two question

    1) How many hourly employees? 20


    2) How many salaried employees ? 30

    Now if i myself feed in these values in the action script where i have left a null enter

    var total = 0;
    var num = 0;
    hourlyemployees = 0;
    salariedemployees = 0; (null entry)

    var total = 0;
    var num = 0;
    hourlyemployees = 20;
    salariedemployees = 30; ( i filled it in the script)

    The formula is written to add it the ans come write =50

    But if i enter the values in the text field the ans = 2030

    I have traced the values enter and they shoew write but the calculation does the it just puts the two

    values together.


    Please help with this problem another other clarification on this i am willin

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    237
    not a big problem

    just calculate

    total=Number(hourlyemployees)+Number(salariedemplo yees)




    milind

  3. #3
    Junior Member
    Join Date
    Dec 2000
    Posts
    25
    Hey Millend,

    Thanks a lot, I have been cracking my head for almost a day.

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