2 Replies Latest reply on Jan 8, 2007 7:35 AM by Rothrock

    Script not working in Flash 8 trial version

    jaya_r
      Hi

      I tried this simple script in the trial version of Flash 8 which does not seem to be working. Can anyone please let me know what could possibly be the problem. When i used the same script in Flash MX 2004,it worked. However even after re-installing the trial version of Flash 8,it does not work. Basically this is what i made:

      1) input text field with a variable name of :inputNum
      2)dynamic text field with a variable name of :outputBool
      3)made a button with an instance name : enter_btn
      4)put this code in the actions layer:

      enter_btn.onRelease=function(){
      outputBool=(inputNum<100);
      };
      var inputNum:Number=0;
      var outputBool:Boolean=true;

      At the outset, it shows 0 in the 'inputNum' and the true in the 'outputBool'.However when i enter any number in the inputNum it shows 'undefined' in the outputBool. Why is that so? Would really appreciate an answer.

      Thanks
      Jayashree
        • 1. Re: Script not working in Flash 8 trial version
          Level 7
          unless you uncheck "autokerning" in property inspector, your textfields
          auto-activate html mode, so your number is wrapped in html tags.

          really weird!


          jaya_r schrieb:
          > Hi
          >
          > I tried this simple script in the trial version of Flash 8 which does not
          > seem to be working. Can anyone please let me know what could possibly be the
          > problem. When i used the same script in Flash MX 2004,it worked. However even
          > after re-installing the trial version of Flash 8,it does not work. Basically
          > this is what i made:
          >
          > 1) input text field with a variable name of :inputNum
          > 2)dynamic text field with a variable name of :outputBool
          > 3)made a button with an instance name : enter_btn
          > 4)put this code in the actions layer:
          >
          > enter_btn.onRelease=function(){
          > outputBool=(inputNum<100);
          > };
          > var inputNum:Number=0;
          > var outputBool:Boolean=true;
          >
          > At the outset, it shows 0 in the 'inputNum' and the true in the
          > 'outputBool'.However when i enter any number in the inputNum it shows
          > 'undefined' in the outputBool. Why is that so? Would really appreciate an
          > answer.
          >
          > Thanks
          > Jayashree
          >
          • 2. Re: Script not working in Flash 8 trial version
            Rothrock Level 5
            While you can use the var in textfields it really is a style that is on its way out. It is better to give your textfield instance names and use the text property of a textfield.

            If you want to stay with this approach Perry is probably correct and you should be able to do this:

            outputBool=(Number(inputNum)<100);

            or

            outputBool=(parseInt(inputNum)<100);