1 Reply Latest reply on Jun 28, 2006 6:47 PM by Newsgroup_User

    From Player 6 to 8

      The next code works fine with Flash Player 6 and Action Script 1 but I'm trying to get it work on Flash Player 8 and Action Script 2.

      Any help, thanks in advance.


      onClipEvent (load) {
      accel1 = 0.8;
      rate1 = 0.1;
      trace(_x);
      _root.xkoord1 = 0;
      }
      onClipEvent (enterFrame) {
      x = x*accel1+(_root.xkoord1-_x)*rate1;
      _x = _x+x;
      if (Math.abs(_root.xkoord1-_x)<1) {
      _x = _root.xkoord1;
      }
      }
        • 1. Re: From Player 6 to 8
          Level 7
          Initialize x in onLoad

          onClipEvent (load) {
          accel1 = 0.8;
          rate1 = 0.1;
          trace(_x);
          _root.xkoord1 = 0;
          x = 0
          }


          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "Euclides" <webforumsuser@macromedia.com> wrote in message
          news:e7unk6$4kg$1@forums.macromedia.com...
          > The next code works fine with Flash Player 6 and Action Script 1 but I'm
          > trying
          > to get it work on Flash Player 8 and Action Script 2.
          >
          > Any help, thanks in advance.
          >
          >
          > onClipEvent (load) {
          > accel1 = 0.8;
          > rate1 = 0.1;
          > trace(_x);
          > _root.xkoord1 = 0;
          > }
          > onClipEvent (enterFrame) {
          > x = x*accel1+(_root.xkoord1-_x)*rate1;
          > _x = _x+x;
          > if (Math.abs(_root.xkoord1-_x)<1) {
          > _x = _root.xkoord1;
          > }
          > }
          >