7 Replies Latest reply on Apr 23, 2007 6:32 AM by kglad

    auto scroll help

      yes i am having difficulty with this code
      in flash i followed a tutorial i found but for some reason its still not working i am getting an error code

      my movie width is 380
      the movie clip _x starting point is at 11 and ending thumbnail is ends at -88 so total is -99
      hence where i came up with the figures below.

      this is my actionscript:

      _root.onEnterFrame = fuction() {
      this.prd_buttons_mc._x = (-99/380 * _root._xmouse)+11;


      and when i run the movie i keep getting this error code and i dont understand why?

      **Error** Scene=Scene 1, layer=actions, frame=1:Line 1: Syntax error.
      _root.onEnterFrame = fuction() {

      Total ActionScript Errors: 1 Reported Errors: 1

      Click Here to View the Movie Clip

      as you can see its not scrolling it just sists there

      and thoughts? on what i am doing wrong?

        • 1. Re: auto scroll help
          kglad Adobe Community Professional & MVP
          you misspelled function.
          • 2. Re: auto scroll help
            rojere3 Level 1
            ok i went back an fixed that and it worked perfectly thanks

            now its not working again
            i placed that scroll into its own movie clip


            an brought it out to my main scene
            actually its inside another movie clip as well.

            scene1..... products 227..... scroll_mc

            but with the code being

            doesn't it go all the way out to the main scene root?

            so how can i point it to current frame in the scroll_mc
            so confusing lol

            anyway it doesn't even move anymore

            • 3. Re: auto scroll help
              kglad Adobe Community Professional & MVP
              if the code is on the scroll_mc timeline and you want to control scroll_mc, it would probably be easiest to use:


              instead of _root.onEnterFrame.

              you coud then use "this" within the onEnterFrame method to control scroll_mc's timeline.
              • 4. Re: auto scroll help
                rojere3 Level 1
                ok i changed the code to [this instead of _root]
                this.onEnterFrame = function() {
                this.prd_buttons_mc._x = (-95/381 * _root._xmouse)+11


                the scrolling started back but only in one direction

                when i move mouse to the left the thumbnails go right
                but when i try to move mouse the right it doesn't move the thumbnails to the left

                is it because of the _root._xmouse since i changed the _root to this in the first line should i do it for the _xmouse as well?

                or does it matter?

                but yes the scrooling resumed just not both ways

                • 5. Re: auto scroll help
                  rojere3 Level 1
                  ok scratch that previous message i posted.
                  its now scrolling both ways left an right

                  but now the new problem is

                  when i run the movie like i said the scrolling moves left an right but now its not within the dimensions of the original scrolling .

                  for original background of the scroll.fla
                  was 381

                  an within its own fla the sliding goes perfectly left to right but now that its part of my bigger movie. the barriers of 381 isn't anylonger

                  for my main movie the width is 892

                  an when i run the movie the scroll_mc is where i placed it on my timeline in the main scene

                  but as i start scrolling the thumbnails

                  its telling my mouse i have to move the cursor all the way to left of my main movie screen of 892 so i can see the first thumbnail in the slider. an then when i move mouse all way to right side of main scene movie the thumbnails dont stop they keep scrolling more to the left then it should.

                  • 6. Re: auto scroll help
                    rojere3 Level 1
                    how can i keep it within the sliding width of the scroll_fla and not the width of the main fla

                    • 7. Re: auto scroll help
                      kglad Adobe Community Professional & MVP
                      instead of hardcoding those numbers you should be applying some logic. usually you would scroll to