2 Replies Latest reply on Sep 15, 2006 8:04 AM by b_rand

    Browser needs refresh for animation to work

    b_rand
      I have created a Flash site with animations at startup as well as a preloader.

      During delopment, testing works fine (ctrl+Enter or F12). However, when uploading and testing it from the server, the initial load of the site shows no animation - no pre-loader or initial animation. Then, if the browser is refreshed, the site works fine.

      I am sure that this is something simple, so I apologize for the dumb question, but any help would be appreciated.

      -Brian
        • 1. Re: Browser needs refresh for animation to work
          Level 7
          It sounds like scripting problem. . you are most likely jumping ahead in the
          movie to frames that are not yet loaded. probably a problem in your
          preloader code. After you refresh, the SWF is coming fully loaded form the
          cache, so you don't get the problem.
          --
          Jeckyl


          • 2. Re: Browser needs refresh for animation to work
            b_rand Level 1
            I wonder if that is the problem too, but I can't find that in my code. Here is the code on the main timeline first frame.

            stop();

            var root_mc:MovieClip = this;
            var total_bytes:Number = 0;

            preLoader_mc.onLoad = function() {
            total_bytes = root_mc.getBytesTotal();
            }

            preLoader_mc.onEnterFrame = function() {
            var bytes_loaded:Number = 0;
            var percent_complete:Number = 0;
            bytes_loaded = root_mc.getBytesLoaded();
            percent_complete = int(bytes_loaded/total_bytes*100);
            preLoader_mc.gotoAndStop(percent_complete);
            if (bytes_loaded == total_bytes) {
            root_mc.gotoAndPlay('animateInit');
            delete preLoader_mc.onEnterFrame;
            }
            }

            if I comment out the statement :

            root_mc.gotoAndPlay('animateInit');

            Then the playback simply stops - as expected.

            Any other ideas?

            Thanks

            -Brian