4 Replies Latest reply on May 22, 2006 4:19 PM by r_barlow

    Actionscript Inside Movie Symbol

      I'm making a flash menu that is a movie symbol. There are sub menus in this movie that are involved in motion tweening so I made them movies as well. The animation all works greats but the sub menus actionscript don't. Does anybody have any information that will help me? I'm pretty new at this....
        • 1. Re: Actionscript Inside Movie Symbol
          Hi r_barlow....maybe you can give us some examples of the actionscript code that isn't working and where it appears...ie. in the .fla itself....via an .as file, etc. I have a feeling it's a scoping issue meaning that whatever code you're trying to execute isn't finding the target you want it to find and manipulate.

          The BoxDoctor
          • 2. Re: Actionscript Inside Movie Symbol
            r_barlow Level 1
            Overall movie has an on(rollOver) event which activates all the animation via gotoAndPlay(".."). That all works wonderfully... the thing that isn't working is I want to be able to click on one of the movie objects to go to a new website:

            on (release){

            The problem is the on release event isn't being triggered when I press on the object.

            Sorry...don't know what a .as file is
            • 3. Re: Actionscript Inside Movie Symbol
              boxdoctor Level 1
              Ok...is there anyway you can post the code you wrote? Otherwise I'm guessing but I'm assuming you have the main menu clip called something like mcMainMenu (make sure your instance is named on your stage)

              Inside of it you have the sub menus which "each?" is a movieclip as well? i.e. submenu1, submenu2, submenu3? So that when you click on either of them it will call the url event....right? Make sure each of those instances have a name as well (on the property inspector make sure it doesn't say <InstanceName> if it does...then that's probably the issue.

              If you go to the main timeline of your movie you probably want to eventually take the code you have assigned to each of the individual clips and just create a new layer called "actions" and put something like the following:

              mcMainMenu.onRollover = function() {

              mcMainMenu.subMenu1.onRelease = function() {
              mcMainMenu.subMenu2.onRelease = function() {
              mcMainMenu.subMenu3.onRelease = function() {

              ...obviously substituting the correct URL and goto frame/scene accordingly. But you see there's a hierarchy that is being followed so that flash knows exactly what item you want to assign an event to. Hope this helps a bit. If not...zip up your code and put it somewhere so we can take a look.

              • 4. Actionscript Inside Movie Symbol
                r_barlow Level 1
                Thanks for all your help! I completely understand how these elements are supposed to be related in the heirarchy however I'm still having a problem with the getting the events for the children to fire. Here's what I have right now:

                ------mvMain (Movie Symbol)
                -------------btnSub1 (Movie)
                -------------btnSub2 (Movie)
                -------------btnSub3 (Movie)

                Here's the code:

                mvMain.onRollOver = function() {
                mvMain.gotoAndPlay("drop down");

                mvMain.onRollOut = function() {
                mvMain.gotoAndPlay("drop up");

                mvMain.btnSub1.onRollOver = function() {
                getURL(" http://www.google.ca");

                mvMain.btnSub2.onRelease = function() {
                getURL(" http://www.yahoo.com");

                The onRollOver/onRollout events are working perfect, but none of the onRelease events are.

                I don't have anywhere to upload the .fla but if you think it will help I can email it to you if you give me your email.

                Thanks again for all your help,