# Xlm menu help

**URL:** <https://forum.kirupa.com/t/xlm-menu-help/186734>\
**Category:** Uncategorized\
**Created:** [April 24, 2006, 8:11am UTC](https://forum.kirupa.com/t/xlm-menu-help/186734 "2006-04-24T08:11:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkstyle](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@darkstyle](https://forum.kirupa.com/u/darkstyle)\
**Post date:** [April 24, 2006, 8:11am UTC](https://forum.kirupa.com/t/xlm-menu-help/186734/1 "2006-04-24T08:11:18Z")

</div>

Hi there,

I am having xml dynamic menu in the main.swf , now i want to load an enternal swf in main.swf on clicking on clicking dynamic menu

## menu load movie location

about us aboutus.swf main.swf  
services services.swf main.swf

Please if some could help me with an example will be very helpful.  
thanks

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [April 24, 2006, 10:49am UTC](https://forum.kirupa.com/t/xlm-menu-help/186734/2 "2006-04-24T10:49:47Z")

</div>

```auto
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success:Boolean) {
	if (success) {
		for (var i = 0; i<this.firstChild.childNodes.length; i++) {
			tmpMC = _root.createEmptyMovieClip("menuItem"+i, _root.getNextHighestDepth());
			tmpTxt = tmpMC.createTextField("menuItemText", 1, 25, 25+50*i, 150, 40);
			tmpTxt.text = this.firstChild.childNodes*.attributes.description;
			tmpMC.movieUrl = this.firstChild.childNodes*.attributes.movieUrl
			tmpMC.onRelease = function() {
				if(!_root.container) {
					_root.createEmptyMovieClip("container", this.getNextHighestDepth());
				}
				container.loadMovie(this.movieUrl);
			};
		}
	} else {
		trace("error loading xml file");
	}
};
myXML.load("menu.xml");

```

menu.xml uses this structure… it need more things as encoding and such…

```php
<menu>
	<item description="About us" movieUrl="about.sfw" />
	<item description="Services" movieUrl="services.sfw" />
</menu>

```

I suppose that you actualy are running main.swf and executing that code from there… at least I understood it that way…

---

<div class="post-metadata">

**Author:** ![darkstyle](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@darkstyle](https://forum.kirupa.com/u/darkstyle)\
**Post date:** [April 24, 2006, 11:41am UTC](https://forum.kirupa.com/t/xlm-menu-help/186734/3 "2006-04-24T11:41:44Z")

</div>

@ mathew.er thank you very much its working fine.  
related to this issue i have another two question.

(1) from the xml menu can i play 2nd frame of aboutus.swf?  
eg.something like gotoAndPlay(2); (of an external movie such as aboutus.swf)

(2) The clients wants me to disable all the menu while the external movie is loading and enable all the menu when the movie is loaded.

Please help. I guess i am being a pain, But sorry i am very bad at AS.
