5 Replies Latest reply on Oct 9, 2009 5:49 AM by kglad

    Today's Flash Issue/Adventure

    Yakamazi_nev

      this["block_"+i].onRelease = function () {

      this.peel_mc.gotoAndPlay ("Open");

      this.no_txt._visible = false;

      _root["number"+i+"_mc"]._visible = false;

      /*_root.number8_mc._visible = false;*/

      this.base_mc._alpha = 50;

      this.enabled = false;

      }

       

      here is some lovely code. I've even coloured it in to make it look a little more edible.

      Everything was working great.. it still does, bar one line in particular.

      The commented out line works fine on its own.

      The line above it however does not.

      They are intended to do the same thing... they were intended to be the same line.. just a bit easier to handle as different 'number movie clips' are supposed to do different things.

      Once i've got the uncommented line to work i intend to delete the commented out line.

       

      Hope this is making sense so far.

       

      The main question is... am i doing something wrong to make the uncommented line not work?

      I get all sorts of errors by adding extra dots, and _parents and stuff, and now i've come to the conclusion that i cant work this out.

       

      If you can see where i'm going wrong with this line, please let me know

       

      Cheers B

        • 1. Re: Today's Flash Issue/Adventure
          kglad Adobe Community Professional & MVP

          i does not have the same value when you release your button as when that release method was created.

           

          to remedy use:

           

          this["block_"+i].ivar =i;

           

           

          this["block_"+i].onRelease = function () {

          this.peel_mc.gotoAndPlay ("Open");

          this.no_txt._visible = false;

          _root["number"+this.ivar+"_mc"]._visible = false;

          /*_root.number8_mc._visible = false;*/

          this.base_mc._alpha = 50;

          this.enabled = false;

          }

           

          • 2. Re: Today's Flash Issue/Adventure
            Yakamazi_nev Level 1

            Cheers for your help.. i'm not sure what's happening here so heres a big section of what i'm doing.

             

            for(i=1; i<=24; i++){

            if ((i) == (dat)) {

             

             

            this["number"+i+"_mc"]._visible = true;

            this["number"+i+"_mc"]._alpha = 50;

             

            this["block_"+i].no_txt.htmlText = (i);

            this["block_"+i].onRelease = function () {

            this.peel_mc.gotoAndPlay ("Open");

            this.no_txt._visible = false;

            _root["number"+i+"_mc"]._visible = false;

            /*_root.number8_mc._visible = false;*/

            this.base_mc._alpha = 50;

            this.enabled = false;

            }

            this["block_"+i].onRollOver = function () {

            this.peel_mc.gotoAndPlay ("Over");

            this.base_mc._alpha = 80;

            }

            this["block_"+i].onRollOut = function () {

            this.peel_mc.gotoAndPlay ("Out");

            this.base_mc._alpha = 100;

            }

             

            } else blah blah blah {

             

            the i var is used all over the place...

            i'm trying to create something that makes 'number1_mc, number2_mc...all the way through... number24_mc' go invisible.

            the current _root["number"+i+"_mc"]._visible = false; isn't working in this case..

             

            dat' is the day as a number. eg 12 would be the 12th of a month.

             

            Cheers again

             

            B

            • 3. Re: Today's Flash Issue/Adventure
              kglad Adobe Community Professional & MVP

              use the code i showed above:

               


               

               

              for(i=1; i<=24; i++){

              if ((i) == (dat)) {

              this["block_"+i].ivar = i;

               

               

              this["number"+i+"_mc"]._visible = true;

              this["number"+i+"_mc"]._alpha = 50;

               

              this["block_"+i].no_txt.htmlText = (i);

              this["block_"+i].onRelease = function () {

              this.peel_mc.gotoAndPlay ("Open");

              this.no_txt._visible = false;

              _root["number"+this.ivar+"_mc"]._visible = false;

              /*_root.number8_mc._visible = false;*/

              this.base_mc._alpha = 50;

              this.enabled = false;

              }

              this["block_"+i].onRollOver = function () {

              this.peel_mc.gotoAndPlay ("Over");

              this.base_mc._alpha = 80;

              }

              this["block_"+i].onRollOut = function () {

              this.peel_mc.gotoAndPlay ("Out");

              this.base_mc._alpha = 100;

              }

               

              } else blah blah blah {

               


              • 4. Re: Today's Flash Issue/Adventure
                Yakamazi_nev Level 1

                Thanks for that mate, it works perfect.

                 

                B

                • 5. Re: Today's Flash Issue/Adventure
                  kglad Adobe Community Professional & MVP

                  you're welcome.