Hi experts out there,
could u check the script ? and tell me where i am going wrong? Please help me.
In flash i have two frame
Flash code:(First Fame)
var myXML:XML = new XML();
var links:Array = new Array();
myXML.load("myMenu.xml");
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean){
if(success){
menuItem = this.firstChild.childNodes;
_root.gotoAndStop("success");
}
}
stop();
Second Frame
for (var i = 0; i<menuItem.length; i++) {
item = loadHere.attachMovie("itemClip", "itemClip"+i, i);
item._x = 0;
item._y = 20*i;
item.itemLabel.text = menuItem*.attributes.name;
item.movieUrl = menuItem*.attributes.movieUrl;
item.onRelease = function() {
_root.container.loadMovie(this.movieUrl);
};
}
for (var j = 0; j<menuSub.length; j++) {
sub = loadHere.attachMovie("subClip", "subClip"+j, j);
sub._x = 0;
sub._y = 20*j;
sub.subLabel.text = menuSub[j].attributes.name;
sub.movieUrl = menuSub[j].attributes.movieUrl;
sub.onRelease = function() {
_root.container.loadMovie(this.movieUrl);
};
}
XML Code
<?xml version="1.0"?>
<myMenu>
<myItem name="Profile"/>
<mySub name="About Us"movieUrl="aboutus/aboutus.swf" />
<mySub name="Carlson Wagonlit Travel"movieUrl="aboutus/aboutus.swf"/>
<myItem name="Services"/>
<mySub name="Fedral Travel Management" movieUrl="services/services.swf" />
<mySub name="Business Travel Management" movieUrl="services/services.swf" />
<mySub name="Leisure Travel" movieUrl="services/services.swf" />
<mySub name="Travel Insurance" movieUrl="services/services.swf" />
<mySub name="Visa Assistance" movieUrl="services/services.swf" />
<myItem name="International Travel Information" movieUrl="international/international.swf" />
<myItem name="Resources" movieUrl="resources/resources.swf" />
<myItem name="Career" movieUrl="career/career.swf" />
<myItem name="Contact us" movieUrl="contact/contact.swf" />
<mySub name="Address Details" movieUrl="contact/contact.swf" />
<mySub name="Feedback" movieUrl="contact/contact.swf" />
</myMenu>
What i exartly want is
for this
<myItem name="... />
tag i want the flash load “itemClip” attached movie clip
and
for this
<mySub name="... />
tag i want the flash load “subClip” attached movie clip.
i think i am doing some mistake please help me to code this.
i have attached the files.