6 Replies Latest reply on Dec 3, 2007 11:39 AM by influxxmedia

    Action Script 2 Sub Menus

    Humbick
      Hi all,

      Thanks in advance for your time and help. I am new to Flash, following a great tutorial, but I have run into a big, but hopefully easy to solve, roadblock which prevents me from putting the components of my site together. Here is my issue:

      I have created a .swf for a website, which you can find here: http://humflash.awardspace.com/ww_main2.html

      The menubar (with its rollover submenus) is in a video clip symbol nested in Scene 1 canvas, with buttons nested in the video clip. Then I have content for, lets say, the "History" sub-menu of the "Company" category, which I also created in an .swf file. I want to load this into the main window as well when you click the history button. I have done this with everything in the same canvas successfully, but because the menubar is in its own movie clip (and its particularly the sub menu Im having difficulty in finding where to place the script), and the movie is its own .swf with pre-loader (which I have ready but am not sure where to put, I beleive on the button's actionscript), it is all very confusing. The script that I wish to post is as follows (attached):

      Please, help would be extremely appreciated, Im unable to figure anything out.

      If there is a way that I can better explain this or show this, please let me know. I have just spent over two hours non-stop going back and forth with scripts trying to figure it out. Thanks for your time and guidance!

      Humbick
        • 1. Re: Action Script 2 Sub Menus
          Humbick Level 1
          Sorry I have to bump this. Its very important to me.

          To make it simpler:

          What type of code do I need to activate a .swf within the file in a container, by hitting a submenu which inside a different movieclip container.

          http://humflash.awardspace.com/ww_main2.html

          Thank you for your time.

          Humbick
          • 2. Re: Action Script 2 Sub Menus
            influxxmedia
            well start simple and add functionality as you get the basics working.

            comment out all the preloader stuff and just see if you can get the SWF to load. Do you have the container MC on the stage? Maybe the code should have no quotes, and label it with _mc suffix. Flash likes that...

            myMCL.loadClip("history.swf", container_mc);

            HTH
            mm66
            • 3. Re: Action Script 2 Sub Menus
              Humbick Level 1
              Hi,

              Thank you so much for your response. Let me quickly update you where I am at:

              I have figured out how to assign the action to the button in my "mc-popUpMenu" (which is the menu/submenu movie clip nested in scene 1), and I have created a container to play "history.swf) on frame10 (keyframe) of scene 1. The following is the action I gave to the history button, which I applied within the mc-popUpMenu:

              on (release) {
              gotoAndPlay("Scene 1", "history");
              }


              The problem is, it plays (or if I choose gotoAndStop, which I probably should, it stops) at the frame or frametag specified INSIDE the mc-popUpMenu instance (which essentailly plays all the frams in my pop up menu movie clip). I need to set the code so that it goes out one level, onto the main scene, and performs the action there.

              I have uploaded the Timeline Of My Main Canvas (Scene 1)
              as well as the Timeline and Actionscript of my Pop Up Menu movie clip.

              To reiterate once again, is there a way to point the action inside of the movieclip to trigger a .swf outside of the movieclip? The pre-loader is contained within the .swf so I do not beleive that is the issue.

              Thanks again for your response, and I appreciate all help and advice that I can get.

              Humbick
              • 4. Re: Action Script 2 Sub Menus
                influxxmedia Level 1
                okay so if I understand you now, there is some action embeded in the LOADED SWF, that you want to control the MAIN TIMELINE.

                Or do you want it to control ANOTHER SWF external to this file?

                To do the first, you have to learn about the internal stacking order of Flash. Loaded SWFs load into a LEVEL, with _level0 being the maiin root timeline. When you load an external SWF you load it into a level number. So if you loaded a SWF into Level 1 in your code, you would target it thus:
                _level1.gotoAndPlay(1);
                If you load a SWF into an MC it gets more confusing, but lets start there for now.

                Communicating with EXTERNAL SWFs in a web browser requires setting up the localConnection() Class. Which again gets more complex. Lets ignore that for now as I dont think it is what you are after.

                HTH
                mm66
                • 5. Re: Action Script 2 Sub Menus
                  Humbick Level 1
                  quote:

                  Originally posted by: madmac66
                  okay so if I understand you now, there is some action embeded in the LOADED SWF, that you want to control the MAIN TIMELINE.

                  Or do you want it to control ANOTHER SWF external to this file?

                  To do the first, you have to learn about the internal stacking order of Flash. Loaded SWFs load into a LEVEL, with _level0 being the maiin root timeline. When you load an external SWF you load it into a level number. So if you loaded a SWF into Level 1 in your code, you would target it thus:
                  _level1.gotoAndPlay(1);
                  If you load a SWF into an MC it gets more confusing, but lets start there for now.

                  Communicating with EXTERNAL SWFs in a web browser requires setting up the localConnection() Class. Which again gets more complex. Lets ignore that for now as I dont think it is what you are after.

                  HTH
                  mm66


                  Im pretty sure it has to do with levels. I have tried applying the _level1.gotoAndStop.... tag, and tried it with _level0 as well, and many different variations of scenes, etc, but I still can not get it to perform the action on the main stage.

                  To reiterate, the button I am pressing is inside a movieclip. I want it to load a .swf on the main stage (Scene1, frame 10).

                  Now the good news is, i tried making a button on my main stage to perform the action that I want the button in the movieclip to perform, and it worked. it very easily went to and stopped at frame 10, and the .swf played (albeit without the pre-loader but I think I can figure that out). So it means if I have to, I can re-make the file and have the menu-tree system on the main canvas (and not in a mc), though the tutorial recommended that it shouldnt be done this way, and the timeline would be very cluttered...

                  so in the meantime I do beleive it is a level issue, i need the action inside the movieclip (which is 1 level deep) to go to a frame that is on the main/root canvas (scene 1, frame 10). I am not sure of the script for this, but the script you recommended did not do it. You mentioned I should read up on levels, do you have any idea where. I am trying to find guides for it, but if you have any recommendations that would be great.

                  Thank you very much for your advice. It didnt exactly work (and that could very well be my fault) but it spurned my realization in several other things. I appreciate forthcoming help from you and anybody else. Thanks.

                  • 6. Re: Action Script 2 Sub Menus
                    influxxmedia Level 1
                    Okay if things work as expected from the root timeline, then it sounds like the action is not finding the object you are targeting. Double check instance names, use copy/paste to keep consistency in naming, check instances are indeed MCs and not graphics. Make sure MCs in your loaded SWF have proper names etc...

                    Use trace() to help you detect where along the trial the scent is getting lost, so to speak.

                    good luck
                    mm66