5 Replies Latest reply on Dec 5, 2006 1:06 PM by P_Jim

    Help with simple xml menu

      Hello guys,

      I’m new to xml in flash so bare with me here. I’m using the XML Menu that came bundle with Flash 8. I want the menu to go to frames in my movie not web links. I tried changing out the code getURL(this.data.href, "_blank"); with gotoAndPlay( ); from the XmlMenu.as file but it did not like that at all. I’m guessing its something really easy that I’m missing.

      Any help would be great thanks guys.
        • 1. Re: Help with simple xml menu
          I'm likewise new to XML, but I'll try to help with principles until someone better comes along.
          What clip is gotoAndPlay()ing?
          • 2. Help with simple xml menu
            Presto-X Level 1
            well right now gotoAndPlay( ); is located in the XmlMenu.as file, I'm not sure but I'm guessing I'm going to need to add some code inside the gotoAndPaly action. I'm not sure if that is what "this.data" does or not but I would think it's going to need to know to look for info in the menu.xml file and add that content in the gotoAndPlay action.

            would I setup the link like this in the xml file?
            <menu name="Home" href="43" /></menu>
            <menu name="Services">
            <submenu name="Marketing" href="44" />
            <submenu name="Advertising" href="45" />
            • 3. Re: Help with simple xml menu
              Bob_Robertson Level 1
              After looking through the code, it appears that the Flash 8 demo is designed simply to call up a web page. What you're after is going to require some tinkering. The onRelease handlers for the relevant movieClips are defined in initMenu; you'll have to modify that loop to change the getURL to a gotoAndPlay(). The XML document only provides information that was relevant to the menu system's intended purpose. Probably, you want to include a tag saying targetFrame=xx, and make the onRelease handler say something like _root.gotoAndPlay(targetFrame). I don't know how you'd get the info from XML to a useful state in your movie.
              • 4. Re: Help with simple xml menu
                Presto-X Level 1
                ahhh... yes this gives me something to think about, do I want to sink a lot of time in trying to find out how to make this work or find another menu system for my project. All I really need is a simple menu " Home | Services | Portfolio | Information" each one of these will have a subcategory with 4 - 8 links going to frames in my project.
                • 5. Re: Help with simple xml menu
                  P_Jim Level 1
                  It would seem that AS is requesting a browser action (relating to href) based on your XML data and not a GoToFrame as Bob Robertson stated. This has been problematic for me as well. Someone told me there was a complete forum within Adobe that covers Flash interaction with XML. I remember starting a topic along those lines which has been taken down due to a space problem here... I have even been looking for books on understanding the structure, limitations, and interaction between XML and AS but none seem to exist just cookbooks. I would assume that a comprehensive book like that would have to be about 2000 pages. If you guys hear of any please let me know.