12 Replies Latest reply on Apr 18, 2006 6:16 PM by kglad

    Basic scipt errors :(

    Damnnationx Level 1
      Ive desighned a nice flashy Menu system called Mymenu_MCP. in my menu mcp i have a few layers
      graphics animation of menu system up to frame 70
      buttons inside buttons i have animation up to frame 70 of buttons_MCP

      Problem is no matter where i insert code i cant get the code to work. im lead to belive i need to insert code in to frame 1 of my actions layer for the entire Movie clip but no matter what code ive tried i either get errors or it just doesnt work..

      The event i wish to occur is to play frame 1 of MYMENU so that it plays the menu animation stops on frame 70

      Then in a button i presume i need seperate code to do the following Action: upon clicking button, Goto scene"AboutME" and play frame 1,stop on last frame-----or if i use another layer called pages instead of scenes for pages i would need an: goto"MYMENU" frame number say 80 and stop ....

      im not sure best wya to get this to work any help apreciated
        • 1. Re: Basic scipt errors :(
          kglad Adobe Community Professional & MVP
          first, don't use scene info for navigation. label the frames you need for navigation and use those labels to navigate.

          second, is the a stop() on frame 70 of MYMENU (or is it MYmenu_MCP)? you need to be clear about the exact movieclip name and case (almost always) matters in flash.
          • 2. Re: Basic scipt errors :(
            Damnnationx Level 1
            Right Well il describe it better here
            i have:
            Scene 1 Called MENU it has 1 layer called Actions and 1 layer called MaMenu only 1 frame
            in MaMenu i have a movieclip called MYMENU_MCP
            this MYMENU_MCP has 4 layers all with names Title, Graphics Buttons - all the layers fade in etc over 70 frames.

            On frame 70 the clip is at the end and all images, parts are fully viewable

            The buttons layer has init a Buttons_MCP (i did this folowing a previous tutorial im not sure this is a bad way to do it )

            now what i got to do is tell the MaMenu layer on homescene to play the MaMenu_MCP from frame 1 to frame 70 then stop there

            at that point i need the Buttons in my Button_MCP to have functionality ie on clicking each button to be directed to either another Frame within MaMenu_MCP a frame outside the 1 to 70 bit or a diffrent frame in the root timeline ie HOME scene timeline..
            Does this help? id be glad to send my swf file if it would alow me to get help with this as its simply for a home site im trying to play with i did the graphics and animations but using the help system to self teach actionscript is proveing to be rather difficult..

            my email adress is damnnationx@hotmail.com feel free to add me or email me for further contact...or jus tpost here again..

            ps thansk for reply matey
            • 3. Re: Basic scipt errors :(
              Damnnationx Level 1
              i dont think ive made any sense reading my own post but would be sur eglad if somebody understands what im trying to do here.
              Think i need to make the main timeline the ROOT
              then make the menu_MCP play which is inside the 1st frame of the root timeline
              then at the end of the menu_MCP has played to stopon frame 70
              At frame 70 of that time line inside my buttons layer of the same movie clip i need the buttons to do simple onclick events go to pages or frames..

              i can make the menu play and stop on frame 70 by adding a stop() to frame 70 But imprety sure that is not the best way to do it as all tutorials tell me to use frame 1 of the main timeline for script ...
              • 4. Re: Basic scipt errors :(
                Damnnationx Level 1
                grrr 3 days of pissin around with this and im fed up with stareing at the output panels errors

                from main timeline frame 1 actions: go to the movei clip named " menu in frame 1 of main time line, play sodding clip and stop on frame 70....that would be a good start doing this as apposed to going to frame 70 in that clip and using escape st
                which i was told was a bad way to go............
                • 5. Re: Basic scipt errors :(
                  try posting your code, or a link to it.

                  It seems that your description may be a little confusing. I had a similar problem until I posted the code and others could see it straight away.
                  • 6. Re: Basic scipt errors :(
                    kglad Adobe Community Professional & MVP
                    post a link to your fla.
                    • 7. Basic scipt errors :(
                      Damnnationx Level 1
                      ok here is a link to my .fla
                      there is no code on it as i deleted anything that does no work. run the movie to see what it looks like at the end
                      main stage with a movie clip in it, inside movie clip is another movie clip called buttons..
                      The buttons are not labeled yet as i did not see point in that until i can get therm to work or atleast 1 button to go to the page or frame i need it to.

                      what i need done is for movie clip to play up to frame 70 and stop and the buttos to go to a difrent frame for each page. between frame 70 and 80 i placed a test pic thing as well

                      thanks for the help ....i bet its realy frigen obvious too


                      ps i placed a stop() on frame 70 of the menu clip so it stops in full view like i want it to...
                      • 8. Re: Basic scipt errors :(
                        kglad Adobe Community Professional & MVP
                        here's your corrected file:


                        the main problem you were probably encountering was trying to define button actions on frame 1 of your _root timeline for buttons that didn't exist when the frame first played. you can't define actionscript for objects that don't exist, yet.

                        if you check my fix, you'll see i initiated a setInterval() loop to check for the existance of the first button. if the first button exists, they all exist and we can therefore define button actions for them.
                        • 9. Re: Basic scipt errors :(
                          Damnnationx Level 1
                          ohmygod you totaly roxoe Kglad!!!!!!!!!!!!!!!!!!!!1
                          i now realise why i could not get it to work myself. 1stly i belive its because you cant actualy tell the movieclip to goto frame in scene and play from frame and then stop on frame...
                          Youve used a loop command.. so im guessing that it loops the movie clip until the buttons movie clip is on. then the script basicly uses a set of statistics as a function and the other buttons follow it.... im not 100% sure but il be reading up and al lthe ++ ivar and prety much most of the stuff mentiond in this script

                          loopI = setInterval(loopF, 100);
                          function loopF() {
                          if (menuMC.menuActive.MenuActive1_btn) {
                          btnNum = 3;
                          for (var i = 1; i<=btnNum; i++) {
                          menuMC.menuActive["MenuActive"+i+"_btn"].ivar = i;
                          menuMC.menuActive["MenuActive"+i+"_btn"].onPress = function() {

                          i can see where some of it works but some is beyond me atleast im prety sure i know what i need to make the other buttons work and that would be to simply add labels to the other buttons....il make a save copy and play abit with it...

                          Thansk again kglad...
                          ps what did you think of the graphics? the last fade in of the buttons is a bit dogy but im working on it, any suggestions?
                          • 10. Re: Basic scipt errors :(
                            kglad Adobe Community Professional & MVP
                            i liked your graphics. that looks nice.

                            to add code for more buttons, just change btnNum in the above code and add the appropriate pages (4,5,6 etc) to the correct frames of _root.menuMC (74, 75, 76 etc).
                            • 11. Re: Basic scipt errors :(
                              Damnnationx Level 1

                              Originally posted by: kglad
                              i liked your graphics. that looks nice.

                              to add code for more buttons, just change btnNum in the above code and add the appropriate pages (4,5,6 etc) to the correct frames of _root.menuMC (74, 75, 76 etc).

                              Yehh i just changed btn= 3 to btn=10 and gave those buttons lables like the 1st 3 buttns in the movie clip......and yeh i aded some more frames hehe .... i think once ive sorted the crap vertical fadein on the buttons i may try and add some sound and possibly some nice fade fade out on the actual pages .....
                              Got this picture in my head....But it never quiet comes out the way! ya want it

                              hmm might be a good signature qoute that

                              • 12. Re: Basic scipt errors :(
                                kglad Adobe Community Professional & MVP
                                or a good title for a song.