7 Replies Latest reply on Nov 26, 2009 8:11 AM by kglad

    Strange Behavior after posting

    mach6ix Level 1

      Hi Everyone,

       

      I am almost finished a project for work.

       

      I found no issues when "testing" the site locally, however, now that it's been posted, i'm finding the page does not fully load although the browser status shows "done". When I refresh the page, it corrects the issue as the page is completly loaded.

       

      Attached are the first load and the refreshed load. As you will be able to see, the first is not fully populated.

       

      Any suggestions as to what could be causing the issue would be greatly appreciated.incomplete load.png

      complete load.png

      I should note, this page refers to an PHP file, to verify a users authorization level then to forward them to the point in the page's timeline they are authorized to see. The actionscript for that function is listed below.

       

      Actionscript 2

       

      var checkLog; // do you have this variable declared like this anywhere?

       

      loadVariablesNum("https://bars.bevinco.com/mike/newlogin.php", 0, "POST");

       

      this.onEnterFrame = function () //Necessary as the page will loop without it//

       

      {   
          if(_root.checkLog == 100)  // if statements are conditionals
          {
              _root.gotoAndStop("regional");
              delete this.onEnterFrame;
          }
          if(_root.checkLog == 200)
          {
              _root.gotoAndStop("partner");
              delete this.onEnterFrame;
          }
          if(_root.checkLog == 300)
          {
              _root.gotoAndStop("employee");
              delete this.onEnterFrame;
          }
          if(_root.checkLog == 999)
          {
              _root.gotoAndStop("denied");
              delete this.onEnterFrame;
          }
      }

       

      Your help is greatly appreciated.

       

      Michael

        • 1. Re: Strange Behavior after posting
          kglad Adobe Community Professional & MVP

          is checkLog returned by the php file?  are you checking to see if it matches one of your conditions?  in particular, are you checking that checkLog is a number and not a string?

          • 2. Re: Strange Behavior after posting
            mach6ix Level 1
            checkLog returned by the php file? 

             

            if you access the php file just by itself by specifying the URL, this is what the page echoes back:

             

            checkLog=100

             

             



            are you checking to see if it matches one of your conditions? 

             

            yes, the code that check is as follow:

             

            this.onEnterFrame = function () //Necessary as the page will loop without it//

             

            {   
                if(_root.checkLog == 100)  // if statements are conditionals
                {
                    _root.gotoAndStop("regional");
                    delete this.onEnterFrame;
                }
                if(_root.checkLog == 200)
                {
                    _root.gotoAndStop("partner");
                    delete this.onEnterFrame;
                }
                if(_root.checkLog == 300)
                {
                    _root.gotoAndStop("employee");
                    delete this.onEnterFrame;
                }
                if(_root.checkLog == 999)
                {
                    _root.gotoAndStop("denied");
                    delete this.onEnterFrame;
                }
            }



            in particular, are you checking that checkLog is a number and not a string?

            I'm not sure how to do that.  Any pointers would be greatly appreciated.

            • 3. Re: Strange Behavior after posting
              kglad Adobe Community Professional & MVP
              what's the following show:

               

              this.onEnterFrame = function () //Necessary as the page will loop without it//

               

              {   

               

              if(_root.checkLog!=undefined){

              trace(typeof(_root.checkLog)+" "+_root.checkLog);  // or, if you can't see online trace output use:

              traceTF.text = typeof(_root.checkLog)+" "+_root.checkLog;  // and create a traceTF textfield

              }

               

              if(_root.checkLog == 100)  // if statements are conditionals
                  {
                      _root.gotoAndStop("regional");
                      delete this.onEnterFrame;
                  }
                  if(_root.checkLog == 200)
                  {
                      _root.gotoAndStop("partner");
                      delete this.onEnterFrame;
                  }
                  if(_root.checkLog == 300)
                  {
                      _root.gotoAndStop("employee");
                      delete this.onEnterFrame;
                  }
                  if(_root.checkLog == 999)
                  {
                      _root.gotoAndStop("denied");
                      delete this.onEnterFrame;
                  }
              }



              in particular, are you checking that checkLog is a number and not a string?

              I'm not sure how to do that.  Any pointers would be greatly appreciated.

              1 person found this helpful
              • 4. Re: Strange Behavior after posting
                mach6ix Level 1

                it shows:

                 

                string 100

                 

                so I update my code to say:

                 

                    if(_root.checkLog == "100")  // if statements are conditionals
                    {
                        _root.gotoAndStop("regional");
                        delete this.onEnterFrame;
                    }
                    if(_root.checkLog == "200")
                    {
                        _root.gotoAndStop("partner");
                        delete this.onEnterFrame;
                    }
                    if(_root.checkLog =="300")
                    {
                        _root.gotoAndStop("employee");
                        delete this.onEnterFrame;
                    }

                 

                     .....

                 

                but the same issue still happens

                • 5. Re: Strange Behavior after posting
                  mach6ix Level 1

                  I question if this has less to do with my actionscript and more to do with the size of the SWF files.

                   

                  I have found that the smaller pages load with no issues however the ones with images (thus making them larger) are the issue makers.

                   

                  Is there a "recommended" size to never exceed when working with flash OR any rules of thumb to follow?

                   

                  Thanks

                  • 6. Re: Strange Behavior after posting
                    mach6ix Level 1

                    Thank you for your help K-Glad

                     

                    As it turns out, the issue was not my SWF file sizes, although I am going to continue working towards getting them to be smaller.

                     

                    The issue was that the actionscript to call the PHP file (user auth function) was placed in the first frame, along with a preloader.

                     

                    Once I shifted the AS to the 2nd frame, the issue was instantly resolved.

                     

                    Thanks again for your assistance.

                     

                    Michael

                    • 7. Re: Strange Behavior after posting
                      kglad Adobe Community Professional & MVP

                      you're welcome.