8 Replies Latest reply on Dec 9, 2013 3:44 PM by CloudLisaT

    Error message with Action Script 2.0 file

    CloudLisaT

      Hi,

       

      I am trying to edit an old flash file that uses Action Script 2.0. I am using CS6 and keep getting the following error message after publishing:

      Scene 1, Layer 'AS', Frame 1, Line 5, Column 291067: Implicit coercion of a value of type int to an unrelated type String.

       

      Can you suggest any fixes or workarounds? I also have Flash 4.0. Can i downsave the file? If so, how?

       

      Thanks!

        • 1. Re: Error message with Action Script 2.0 file
          kglad Adobe Community Professional & MVP

          what's line 5 in the as layer?

           

          and you can downsave to flash cs5 or cs 5.5, but no further.

          1 person found this helpful
          • 2. Re: Error message with Action Script 2.0 file
            fB3 Level 2

            It means you are trying to compare a int to a string.
            //this is an int myValue1 = 10;
            //this is a string myValue2 = "10";
            Do something like this...
            if ( myValue1 == parseFloat(myValue2 )
            {   
                //do something.
            }
            HTH

            • 3. Re: Error message with Action Script 2.0 file
              CloudLisaT Level 1

              Here's line 5 and 6 in that layer:

               

              TransitExpensesTotal.text = 0;

              total.text = 0;

               

              Here's the whole thing:

               

              //Set the Transit Benefit Limit here:

              var transitBenefitLimit:Number = 130;

              var FICAPercent:Number = 0.0765;

               

               

              TransitExpensesTotal.text = 0;

              total.text = 0;

               

               

              this.onEnterFrame=function(){

                        BenefitLimit.text = "$"+transitBenefitLimit;

                        TransitExpenses();

                        SavingsTotal();

              }

               

               

              function SavingsTotal() {

                        var n1:Number = slider1.ratio;

                        var n2:Number = slider2.ratio;

                        total.text = "$"+Math.round((n1*12)*(n2*.01))+"*";

              }

               

               

              function TransitExpenses() {

                        var n1:Number = slider1.ratio;

                        var n2:Number = slider2.ratio;

                        TransitExpensesTotal.text = "$"+Math.round(12*n1);

              }

              • 4. Re: Error message with Action Script 2.0 file
                CloudLisaT Level 1

                If I can save down to 5.5, can I still find a trial of Flash 5.5 so that I can work on this Actionscript 2.0?

                • 5. Re: Error message with Action Script 2.0 file
                  kglad Adobe Community Professional & MVP

                  textfield's can only accept strings.  so, use:

                   

                   

                   

                  //Set the Transit Benefit Limit here:

                  var transitBenefitLimit:Number = 130;

                  var FICAPercent:Number = 0.0765;

                   

                   

                  TransitExpensesTotal.text = "0";

                  total.text = "0";

                   

                   

                  this.onEnterFrame=function(){

                            BenefitLimit.text = "$"+transitBenefitLimit;

                            TransitExpenses();

                            SavingsTotal();

                  }

                   

                   

                  function SavingsTotal() {

                            var n1:Number = slider1.ratio;

                            var n2:Number = slider2.ratio;

                            total.text = "$"+Math.round((n1*12)*(n2*.01))+"*";

                  }

                   

                   

                  function TransitExpenses() {

                            var n1:Number = slider1.ratio;

                            var n2:Number = slider2.ratio;

                            TransitExpensesTotal.text = "$"+Math.round(12*n1);

                  }

                  • 6. Re: Error message with Action Script 2.0 file
                    kglad Adobe Community Professional & MVP

                    you can find a trial of flash 5.5 but it will expire in 30 days and you cannot purchase a license for it.

                     

                    if you follow all 7 steps, you can download a trial via one of the links on this page using a browser that accepts cookies:  http://prodesigntools.com/adobe-cs5-5-direct-download-links.html

                     

                    and activate with your serial number.

                     

                    if you have a download problem, you didn't follow all 7 steps.  typically, failure to meticulously follow steps 1,2 and/or 3 is the problem, but your browser must also allow cookies so that's (a restrictive browser setting) another potential source of problems.

                    1 person found this helpful
                    • 7. Re: Error message with Action Script 2.0 file
                      CloudLisaT Level 1

                      Thank you. I think that did fix the original two errors. But now upon test of the file, I get some new errors:

                       

                      Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 31120: Access of undefined property ratio.
                      Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 201180: Call to a possibly undefined method number.
                      Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 7, Column 271120: Access of undefined property _root.
                      Symbol 'MoneySlider', Layer 'AS', Frame 1, Line 9, Column 271120: Access of undefined property ratio.

                       

                      And on the MoneySlide layer in Actions:

                       

                      this.ratio = 0;

                      this.loadBar._width = 0;

                      this.dragger.ratio.text= "$0";

                      dragger.onPress=function(){

                                this.startDrag(true,0,0,line._width,0);

                                this.onEnterFrame=function(){

                                          ratio=Math.round(number(_root.transitBenefitLimit/100)*(this._x/(line._width/10 0)));

                                          loadBar._width = Math.round(this._x);

                                          dragger.ratio.text= "$"+ratio;

                                }

                      }

                      dragger.onRelease=dragger.onReleaseOutside=stopDrag;

                      • 8. Re: Error message with Action Script 2.0 file
                        CloudLisaT Level 1

                        I appreciate the help! I was given this file to update but usually only switch out graphics and such.