2 Replies Latest reply on Jul 28, 2006 6:31 AM by Newsgroup_User

    Player 8 help

    Level 7
      Is there a way for someone to help me make this code work in Flash
      Player 8 (Actionscrpt 2:

      largodemo = 25;
      myString = this._name;
      temp1 = "";
      for (n=0; n<largodemo; n++) {
      temp1 += chr(random(42)+48);
      }
      temp2 = this.myString.substr(0, i);
      this.eltexto = temp2+temp1.substring(i, largodemo);
      i++;
      if (i<=largodemo) {
      gotoAndPlay(1);
      } else {
      stop();
      }


      This code was made for Player 6 in AS 1.0

      thanks in advanced
        • 1. Player 8 help
          Craig Grummitt Level 3
          wow that's a little confusing. To begin with you need to add some comments and intuitive variable names. or even just a description of what the intention of the code is...

          however, i believe your problem may be initiating variables. in AS 2.0 you can't just start incrementing a variable that hasn't been initiated(like you could in AS 1.0). so begin your code with:

          i=0;
          • 2. Re: Player 8 help
            Level 7
            You really cannot create a reliable Flash 8 AS 2.0 code from older versions
            unless you review all the issues of code deprecation and obsolecence.

            You can attempt to set your Publish Settings AS to 1.0 however and still use
            the Flash 8 IDE.

            But to go to 2.0 you want to stop using deprecated AS items, although they
            may work, it is not a reliable policy:

            http://livedocs.macromedia.com/flash/8/main/00002920.html

            Example chr is deprecated and should use String.fromCharCode(). Since Flash
            Player 5!

            http://livedocs.macromedia.com/flash/8/main/00002922.html

            If you have any Flash 4 elements in your code they have to go:

            http://livedocs.macromedia.com/flash/8/main/00001690.html

            --
            Lon Hosford
            www.lonhosford.com
            Flash, Actionscript and Flash Media Server examples:
            http://flashexamples.hosfordusa.com
            May many happy bits flow your way!
            "The Bliss Factor" <reggie@redheadcompanies.com> wrote in message
            news:ea85lp$por$1@forums.macromedia.com...
            > Is there a way for someone to help me make this code work in Flash Player
            > 8 (Actionscrpt 2:
            >
            > largodemo = 25;
            > myString = this._name;
            > temp1 = "";
            > for (n=0; n<largodemo; n++) {
            > temp1 += chr(random(42)+48);
            > }
            > temp2 = this.myString.substr(0, i);
            > this.eltexto = temp2+temp1.substring(i, largodemo);
            > i++;
            > if (i<=largodemo) {
            > gotoAndPlay(1);
            > } else {
            > stop();
            > }
            >
            >
            > This code was made for Player 6 in AS 1.0
            >
            > thanks in advanced