Hi. I'm pretty much a noob. I need help making a menu. Any help would be greatly appreciated! :D
So I'm creating a flash portfolio site that has a blog in the background. The blog updates from an xml document. But I'm having trouble making the menu buttons. I'd like to assign buttons to 4 random words from the xml (which would change each time I updated the xml). The catch is, I would only like to pick words that fall on the left side of the page (say between x = 55 to 250). The buttons would open an overlay on the same page. So 4 buttons on the left, with an overlay to the right.
The current XML loading code in actionscript:
var myXML:XML = new XML();
var XML_URL:String = "myXMLFile.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void {
myXML = XML(myLoader.data);
var xmlDoc:XMLDocument = new XMLDocument();
xmlDoc.ignoreWhite = true;
var menuXML:XML = XML(myLoader.data);
xmlDoc.parseXML(menuXML.toXMLString());
for each (var ListItem:XML in myXML..ListItem) {
var listLabel:String = ListItem.itemLabel.toString();
var myFont = new Font1();
var myFormat:TextFormat = new TextFormat();
myFormat.size = 36;
myFormat.align = TextFormatAlign.JUSTIFY;
myFormat.font = myFont.fontName;
var myText1:TextField = new TextField();
myText1.defaultTextFormat = myFormat;
myText1.embedFonts = true;
myText1.antiAliasType = AntiAliasType.ADVANCED;
myText1.text = listLabel;
myText1.textColor = 0xD1D3D4;