7 Replies Latest reply on Mar 24, 2010 9:16 AM by kglad

    Why am I getting a syntax Error with this

    Blessedwolf

      play ();
      ifFrameLoaded ("content", "loader") {
          gotoAndPlay ("content", 1);
      }
      downloaded = math.floor((_root.getbytesLoaded()/_root.getbytestotal())*100) add "%";
      _root.bar.download_bar.gotoandstop(downloaded);
      bytesloaded = math.floor(_root.getbytesloaded()/1000);
      bytestotal = math.floor(_root.getbytestotal()/1000);
      _root.bar.message = bytesloaded add "Kb";
      _root.bar.message2 =  bytestotal  add "Kb";

       

      this is for a loader on an already created flash. Which I am updating. All I am doing is changing a picture that has no coding with it, and changing the publish settings. The publish setting for the original was set for flash player 5, however I need it set to flash player 8. After I change these settings and export the movie to a .swf, I get the errors.

       

      Has the action script changed that much from flash 5 to flash 8?

       

      if so Please help me find out what is wrong.

       

      I have been working on this for over a day and it is giving me a headache. any help will be useful

        • 1. Re: Why am I getting a syntax Error with this
          kglad Adobe Community Professional & MVP

          yes, actionscript changed from 5 to 8.  you should use:

           

           

           

          play ();
          ifFrameLoaded ("content", "loader") {  // this should be updated but you can probably still use it
              gotoAndPlay ("content", 1);
          }
          downloaded = Math.floor((_root.getBytesLoaded()/_root.getBytesTotal())*100) +"%";
          _root.bar.download_bar.gotoAndStop(downloaded);
          bytesloaded = Math.floor(_root.getBytesLoaded()/1000);
          bytestotal = Math.floor(_root.getBytesTotal()/1000);
          _root.bar.message = bytesloaded + "Kb";
          _root.bar.message2 =  bytestotal  + "Kb";

           

           

          1 person found this helpful
          • 2. Re: Why am I getting a syntax Error with this
            Blessedwolf Level 1

            I did the corrections however now I am getting the popup that says "A script in this movie is causing Flash Player to run slowly. if it continues to run, your computer may become unresponsive. Do you want to abort the script?"

             

            would  I have to change all the scripting besides the one I posted?

            • 3. Re: Why am I getting a syntax Error with this
              kglad Adobe Community Professional & MVP

              the code i suggested wouldn't cause that problem.  you have code elsewhere that's causing that problem.

              • 4. Re: Why am I getting a syntax Error with this
                Blessedwolf Level 1

                hmmm

                 

                 

                These are the codes I have for the flash

                 

                Theses go with a loader:

                Play();

                 

                prevFrame();

                 

                 

                 

                Actions:

                _quality="best";

                 

                black (a);

                black (b);

                black (c);

                 

                stop();

                 

                 

                also it has something called bulletclips

                 

                /////////////////////////////////////
                /////////////////////////////////////
                //////Bullet Template v2.0///////////
                //////Created:8.13.02////////////////
                //////Modified:           ///////////
                //////Author: J.Olson////////////////
                /////////////////////////////////////
                /////////////////////////////////////

                 


                //Hide the placement box/instructions
                instructions._visible=0;

                 

                //attach the first 1 line movie to be duped
                attachMovie("line_1","area1",1);

                 

                //hide it from view
                area1._x=-500;

                 

                //make the proper number of duplicates from the parameter list
                for(i=2;i<=bulletNumber;i++){
                duplicateMovieClip(area1,"area"+i,i);
                }

                 

                //stuff the text fields with content, then onto the next keyframe to measure the maxscroll
                area1.return1=input1;
                area2.return1=input2;
                area3.return1=input3;
                area4.return1=input4;
                area5.return1=input5;
                area6.return1=input6;
                area7.return1=input7;

                 

                 

                 

                 

                 

                 

                and this one also

                 

                //this is used to position the bullets in this movieclip---->completely separate of the main stage.
                function position (x){
                x._y=90;
                x._x=72;
                x._alpha=40;

                 


                }

                 

                //Check the maxscroll value of each of the text fields, then replace them if they're longer than 1 line..
                //Then position the initial clip by invoking position();
                for(i=1;i<=bulletNumber;i++){
                num=this["area"+i].return1.maxscroll;
                if(num==2){
                removeMovieClip("area"+i);
                attachMovie("line_"+num,"area"+i,i);
                }else if(num==3){
                removeMovieClip("area1"+i);
                attachMovie("line_"+num,"area"+i,i);
                }else if(num==4){
                removeMovieClip("area1"+i);
                attachMovie("line_"+num,"area"+i,i);
                }else if(num==4){
                removeMovieClip("area1"+i);
                attachMovie("line_"+num,"area"+i,i);
                }
                position(this["area"+i]);
                }

                 

                //Stuff the new clips with the content from before
                area1.return1=input1;
                area2.return1=input2;
                area3.return1=input3;
                area4.return1=input4;
                area5.return1=input5;
                area6.return1=input6;
                area7.return1=input7;

                 

                //this will space the bullets based on the previous bullet's height+position
                for(i=2;i<=bulletNumber;i++){
                this["area"+i]._y=((this["area"+(i-1)]._y)+(this["area"+(i-1)]._height))+15;
                }

                 

                //Check for a Header:::::::::::::::::::
                if(Header!="none"){
                attachMovie("header","headcase",20);
                headcase.return1=Header;
                headcase.bullet._visible=0;
                position(headcase);
                headcase._alpha=100;
                headcase._y=headcase._y-36;
                headcase._x=headcase._x-15;

                 

                }

                 

                //instantiate this movieClip on the stage by storing the instance name in "areas"
                _root.areas=this;

                 

                //remote variable declaration, storing text instances in vars a-g on the main timeline
                _root.a =area1;
                _root.b =area2;
                _root.c =area3;
                _root.d =area4;
                _root.e =area5;
                _root.f =area6;
                _root.g= area7;

                 

                //remote function declaration, this sets the value of each of the bullets to black
                _root.black=function(x){
                x._alpha=100;
                }

                 

                //remote function declaration, this restarts the playhead and sets bullets back to gray
                _root.reStart=function(){
                gotoAndPlay(1);
                areas.gotoAndPlay(1);
                }

                 

                //stop of course!
                stop();

                • 5. Re: Why am I getting a syntax Error with this
                  kglad Adobe Community Professional & MVP

                  bulletNumber looks undefined.

                   

                  assign it to zero:

                   

                  var bulletNumber:Number=0;

                   

                  before your for-loops execute.

                  • 6. Re: Why am I getting a syntax Error with this
                    Blessedwolf Level 1

                    where do I put that script at?

                    • 7. Re: Why am I getting a syntax Error with this
                      kglad Adobe Community Professional & MVP

                      :

                       



                      Play();

                      _quality="best";

                       

                      black (a);

                      black (b);

                      black (c);

                       

                      stop();

                       

                       


                       

                      /////////////////////////////////////
                      /////////////////////////////////////
                      //////Bullet Template v2.0///////////
                      //////Created:8.13.02////////////////
                      //////Modified:           ///////////
                      //////Author: J.Olson////////////////
                      /////////////////////////////////////
                      /////////////////////////////////////

                       


                      //Hide the placement box/instructions
                      instructions._visible=0;

                       

                      //attach the first 1 line movie to be duped
                      attachMovie("line_1","area1",1);

                       

                      //hide it from view
                      area1._x=-500;

                       

                      var bulletNumber:Number=0;

                       

                      //make the proper number of duplicates from the parameter list
                      for(i=2;i<=bulletNumber;i++){
                      duplicateMovieClip(area1,"area"+i,i);
                      }

                       

                      //stuff the text fields with content, then onto the next keyframe to measure the maxscroll
                      area1.return1=input1;
                      area2.return1=input2;
                      area3.return1=input3;
                      area4.return1=input4;
                      area5.return1=input5;
                      area6.return1=input6;
                      area7.return1=input7;

                       

                       

                       

                       

                       

                       

                      and this one also

                       

                      //this is used to position the bullets in this movieclip---->completely separate of the main stage.
                      function position (x){
                      x._y=90;
                      x._x=72;
                      x._alpha=40;

                       


                      }

                       

                      //Check the maxscroll value of each of the text fields, then replace them if they're longer than 1 line..
                      //Then position the initial clip by invoking position();
                      for(i=1;i<=bulletNumber;i++){
                      num=this["area"+i].return1.maxscroll;
                      if(num==2){
                      removeMovieClip("area"+i);
                      attachMovie("line_"+num,"area"+i,i);
                      }else if(num==3){
                      removeMovieClip("area1"+i);
                      attachMovie("line_"+num,"area"+i,i);
                      }else if(num==4){
                      removeMovieClip("area1"+i);
                      attachMovie("line_"+num,"area"+i,i);
                      }else if(num==4){
                      removeMovieClip("area1"+i);
                      attachMovie("line_"+num,"area"+i,i);
                      }
                      position(this["area"+i]);
                      }

                       

                      //Stuff the new clips with the content from before
                      area1.return1=input1;
                      area2.return1=input2;
                      area3.return1=input3;
                      area4.return1=input4;
                      area5.return1=input5;
                      area6.return1=input6;
                      area7.return1=input7;

                       

                      //this will space the bullets based on the previous bullet's height+position
                      for(i=2;i<=bulletNumber;i++){
                      this["area"+i]._y=((this["area"+(i-1)]._y)+(this["area"+(i-1)]._height))+15;
                      }

                       

                      //Check for a Header:::::::::::::::::::
                      if(Header!="none"){
                      attachMovie("header","headcase",20);
                      headcase.return1=Header;
                      headcase.bullet._visible=0;
                      position(headcase);
                      headcase._alpha=100;
                      headcase._y=headcase._y-36;
                      headcase._x=headcase._x-15;

                       

                      }

                       

                      //instantiate this movieClip on the stage by storing the instance name in "areas"
                      _root.areas=this;

                       

                      //remote variable declaration, storing text instances in vars a-g on the main timeline
                      _root.a =area1;
                      _root.b =area2;
                      _root.c =area3;
                      _root.d =area4;
                      _root.e =area5;
                      _root.f =area6;
                      _root.g= area7;

                       

                      //remote function declaration, this sets the value of each of the bullets to black
                      _root.black=function(x){
                      x._alpha=100;
                      }

                       

                      //remote function declaration, this restarts the playhead and sets bullets back to gray
                      _root.reStart=function(){
                      gotoAndPlay(1);
                      areas.gotoAndPlay(1);
                      }

                       

                      //stop of course!
                      stop();

                      1 person found this helpful