A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help with Code Flash [8]

  1. #1
    Junior Member
    Join Date
    Aug 2007
    Location
    Mid-South
    Posts
    21

    Question Help with Code Flash [8]

    I have a location box, and the states can only be NY, TN or FL.

    I want the code to recognize when the state NY is entered into the location box, a percentage gets added to that state.

    Instead of making 3 buttons with 3 codes attached, I would simply like an input field & some code.

    I thought to use:
    onInput.NY.(Number(subtotal))*(0.045);

    Can anyone help me with this??


    Thanks!!

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try using the onChanged event handler -
    Code:
    // on stage
    // input textfield - instance name - inpTxt
    // dynamic textfield - instance name - dynTxt
    
    var subtotal:Number = 10;
    
    inpTxt.onChanged = function(){
    inpTxt.text = inpTxt.text.toUpperCase(); 
    if(inpTxt.text == "NY"){ dynTxt.text = subtotal*0.045; }
    if(inpTxt.text == "TN"){ dynTxt.text = subtotal*0.065; }
    };

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