4 Replies Latest reply on Nov 30, 2006 5:12 AM by Newsgroup_User

    Update to AS2 ?

    Tony Heagren Level 1
      Hi All,

      I've been using a nice effect in AS1 to slide things around - this won't work with player 8 which I want to use
      for the filters etc.,

      Can anyone teach me how to write this in AS2 ?

      onClipEvent (load) {
      POZ = new Array("0", "-750", "-1500", "-2250", "-3000", "-3750", "-4250");
      }
      onClipEvent (enterFrame) {
      r += (rot-r)/5;
      rectan._x = r;
      }
        • 1. Update to AS2 ?
          shikozel Level 1
          from quick look it should work as AS2 too. I dont see you using the POZ variable anywhere. maybe thats the problem.but try that:

          onClipEvent (load) {
          var POZ:Array;
          POZ = ["0", "-750", "-1500", "-2250", "-3000", "-3750", "-4250"];
          }
          onClipEvent (enterFrame) {
          r += (rot-r)/5;
          rectan._x = r;
          }
          • 2. Re: Update to AS2 ?
            Tony Heagren Level 1
            Thanks....
            i should have mentioned that the button actions is:

            on (release) {
            rot = POZ[0];
            }
            • 3. Re: Update to AS2 ?
              Level 7
              This is a FP8 vs FP7 issue, rather than AS2 vs AS1. The problem is that you
              haven't instantiated your variable 'r' anywhere:

              onClipEvent (load) {
              r = this._rotation;
              POZ = new Array("0", "-750", "-1500", "-2250", "-3000", "-3750", "-4250");
              }




              --
              -------------------------------
              Remove '_spamkiller_' to mail
              -------------------------------


              • 4. Re: Update to AS2 ?
                Level 7
                > The problem is that you
                > haven't instantiated your variable 'r' anywhere:

                OOPS. Sorry. You haven't instantiated 'rot' either, and now I look more
                carefully, r is based on rectan._x, not a rotation. So, that should
                probably be:

                onClipEvent (load) {
                r = rectan._x;
                POZ = new Array("0", "-750", "-1500", "-2250", "-3000", "-3750", "-4250");
                }

                But I have no idea what the value of 'rot' should be


                --
                -------------------------------
                Remove '_spamkiller_' to mail
                -------------------------------