6 Replies Latest reply on Jul 19, 2006 2:17 PM by coreysyms

    Looking for Some Assistance

    JUNKHED
      Hi Im having a problem Im creating a webpage where when I click on a month say january it moves a movie clip called jan1 from the right of the page to the center of the main page so people can see the information. The idea is to have 12 movie clips each named after each month and have 12 buttons which are labeled after each month. When I press one of the buttons say( janview) it triggers the script which is on the movie jan1 and it moves the movie out for people to view the dynamic text which is placed in the movie. Here is the script that Im using on the movie clip :

      onClipEvent (load) {
      _x = 10;
      _y = 380.0;
      spd = 8;
      // this is the scrolling speed, the hight the number the faster it scrolls//
      }
      onClipEvent (enterFrame) {
      _x += (endX-_x)/spd;
      _y += (endY-_y)/spd;
      _root.easing.janview.onRelease = function() {
      endX = 10;
      endY = 380.0;
      };
      _root.easing.marchview.onPress = function() {
      endX = 969.0;
      endY = 380.0;
      };
      _root.easing.febview.onPress = function(){
      endX=960.0;
      endY=380.0;
      };
      }
      here is my problem when I place this script on each movie (all 12 for each month) of course adding the extra buttons so I have all 12 months listed on each movie, when I press say janview it pulls jan1 out to view, when I press say febview it moves jan1 movie clip back to the outer right of the page and brings feb1 into the middle of the page. Now if I were to press marchview it brings marches info out but doesnt get rid of jan1 or feb 1 from the page. it seems like the script gets confused as if it can only do one function ( for instance if I only placed the script on say jan1 and feb1 movie clip it works fine) but when I place this script on all the movies it won't work. Does this make sense can anyone help i want to be able to press any button and have each page swing in and out
        • 1. Re: Looking for Some Assistance
          LB Back
          I'd make 1 generic function which you can call from any of the 12 buttons to move any "month-clip" to the center. As soon as one of those clips is centered you can make it indicate that that's the active one, something like

          _root.activeMonthMc = this;

          In that same generic function you could make _root.activeMonthMc slide back out of sight.
          • 2. Re: Looking for Some Assistance
            JUNKHED Level 1
            Hi thanks very much for the response, I would like to ask if its not too much trouble could you give me a sample of how to put this script together Im still fairly new and learning my way around creating these scripts the one I'm using below I got from a tutorial on sliding pages but then thought about this idea of having a clip for each month and fiddled around and came up with some added things for that one to work, but Im quite sure how to apply what you gave me. Thanks very much.. I'll fiddle around at home till I hear something back maybe I'll stumble on to something...lol Thank you again...
            • 3. Looking for Some Assistance
              coreysyms
              hello,

              this can be done easy with the actionscript tween class, and the attach movie method.

              create your month movie clips and leave them in the library so there is nothing on the stage.

              you will "attach" the month clips to the stage using the attach movie method.
              to do this you must give each of the month movie clips a linkage handler.
              this can be done by right clicking on the proper clip and clicking on "linkage", you should then check the "export for actionscript" check box. it will fill in the name of the movieclip, but you can give it any name you like.

              next create your month buttons on the stage and give them instance names so we can call them in our code.

              currently you should have just your month buttons on the stage.

              in the actions panel, add the following code.

              as you can see the actionscript attached the proper month clip to the stage using the name you gave it in the linkage. actionscript asks you to name the clip on the stage (which is the second quoted name, the first object flash asks for is the linkage name) but we don't need to worry with it because we are dealing with the depth that the clip is at rather than a direct name call.

              it slides in the seleted clip and slides out and removes the clip that currently sits in the users view.

              any questions, just post. :)
              • 4. Looking for Some Assistance
                coreysyms Level 1
                --
                • 5. Re: Looking for Some Assistance
                  JUNKHED Level 1
                  Hi thanks very much for your insight into this, Im going to give this a try once I get home. I'm assuming that the script just goes in a blank keyframe on the 1st frame of my actions layer? what would I do if I had my buttons inside of another movie clip. For instance I made a clip where inside of it are the buttons and the clip is on the outside border of my main movie. I have 2 buttons which can either slide that out or back in but when they slide out you can see the buttons and from there you choose your months. Hope this makes sense and again thanks Im learning so much from all this, I love this stuff....lol
                  • 6. Re: Looking for Some Assistance
                    coreysyms Level 1
                    no problem, to answer your questions...

                    1. yes the code goes is a black keyframe in the actions panel.

                    2. if your button is inside another movie clip, adjust the target path to the button.
                    ex > myClip1.myClip2.myClip3.marBut.onRelease = function() {

                    as long as the path to the button is correct, then you can have your button anywhere, use the find target button in the actions panel to make sure your path is correct.

                    3. you can use the tween class on you "dock" style month button bar as well, to slide in and out the dock.

                    happy flashing