8 Replies Latest reply on Feb 27, 2011 6:37 PM by jrk

    animation jerky only online

    jrk Level 1

      I have an interactive graph that works fine in Flash but jerks along when swf is online.

      The graph is at

      http://www.johnkyrk.com/oxygengraph.html

       

      I will gladly send the original file to anyone. I would appreciate your help.

        • 1. Re: animation jerky only online
          Ned Murphy Adobe Community Professional & MVP

          In what way is it jerky?

          • 2. Re: animation jerky only online
            jrk Level 1

            Can you see it on the web? Sliding the triangle left and right makes the graph change only in leaps, not a continuous smooth motion as it does offline.

            • 3. Re: animation jerky only online
              Ned Murphy Adobe Community Professional & MVP

              Yes, I could see it on the web, but since it does nothing on its own, with nothing in motion and no explanation it could be anyone's guess what you meant.

               

              What are you using to control the animation?

              • 4. Re: animation jerky only online
                jrk Level 1

                Sorry, no caption yet.

                The pointy triangle on the x-axis slides horizontally while the changing numbers represent years ago. On my computer, the bright portion of the graph moves right along with the triangle. Online, the graph changes only every 16,000,000 years.
                I could send you the file. CS3. Same result with CS5.

                • 5. Re: animation jerky only online
                  Ned Murphy Adobe Community Professional & MVP

                  That doesn't tell anything about how you control the animation you expect to see.  What code/controls have you implemented for this?

                  • 6. Re: animation jerky only online
                    jrk Level 1

                    The red triangle is a MC with this code:

                    Frame 1:

                    min = 0;

                    max = 4;

                    setProperty(this, _x, (450));  //starting position of needle

                    // if you want exactly N digits after the decimal you can use numTruncateFill():

                    _global.numTruncateFill = function(num, N) {

                    tempnum = num;

                    powerTen = 1;

                    for (ivar=1; ivar<=N; ivar++) {

                    tempnum *= 100;

                    powerTen *= 10;

                    if (num == Math.round(tempnum)/powerTen) {

                    break;

                    }

                    }

                    decimalPart = (num-Math.floor(num))*powerTen;

                    decimalPart = (Math.round(decimalPart)*1000)/1000;//corrects rounding problem

                    if (ivar<2) {

                    for (jvar=N-ivar; jvar>0; jvar--) {

                    decimalPart += "0";

                    }

                    return Math.floor(num);

                    } else {

                    return Math.round(tempnum)/powerTen;

                    }

                    };

                    ----------
                    Frame 2:
                    X = getProperty(this, _x);
                    _root.graph.gotoAndStop(X);
                    pHval = Number(((X/400)*(max-min)))+Number(min);
                    //trace(pHval);
                    pHval = Math.round(pHval*100)/100*(4/10);
                    //trace(pHval);
                    pHval = Math.round(pHval*100);
                    //trace(pHval);
                    pHval = 2*(200-pHval);
                    //trace(pHval);
                    _root.pHbox = numTruncateFill(pHval, 0);
                    ----------
                    Frame 3:
                    gotoAndPlay(2);
                    ----------------------------------
                    "Hbox" is the first three digits of the year number below the graph.
                    You can see that this code is a modification from someone, I think Kglad. I don't understand much of it.

                    • 7. Re: animation jerky only online
                      Ned Murphy Adobe Community Professional & MVP

                      What you might try is to put a dynamic textfield on the _root timeline and see if the X value follows the relocation of the pointer or if it also gets stuck like the graph.  Give the textfield an instance name ("tf" for example) and add the line of code into frame 2 that is shown at the bottom below

                       

                      X = getProperty(this, _x);           // the pointer _x position (?)
                      _root.graph.gotoAndStop(X);      // the graph frame to go to
                      _root.tf.text = X; // add this line and the textfield

                       

                       

                      Because you appear to be working with AS1 code, I don't know that I will be of much help resolving this.  There appears to be quite a bit of complicated calculation going on that I don't want to begin to try to follow, but based on what I see, the two lines above are the key to making the graph follow the pointer.  I just won't be able to determine why one doesn't result in the other following. (these forums really need fixin)
                      • 8. Re: animation jerky only online
                        jrk Level 1

                        Thanks for the suggestion.

                        I have posted a video on Vineo that shows the problem.

                        http://vimeo.com/20450763