Hi I am trying to get the values out of an xml file to manipulate the rotation of a movie clip. The idea is that an xml file will provide wind direction data and a movie clip of an arrow will be rotated to match the xml file data. Here is the actionscript code at the moment and the xml code any help would be much appreciated - for my sanity as much as any thing cheers Hope this makes sense import mx.utils.Delegate; var Wind:Array = new Array(); xcWind.addEventListener("result",Delegate.create(this,gotXML)); function gotXML(ev:Object):Void { var mXML:XML = ev.target.results; var nodes = mXML.firstChild.childNodes.length; for (var i=0;i<nodes;i++) { var node = mXML.firstChild.childNodes[i]; Wind.push({ winddirection:node.childNodes[0].firstChild.nodeValue }); } for (i=0;i<Wind.length;i++) { var clipName:String = "circle" + i + "_mc"; this.attachMovie("circle_mc",clipName,i); this[clipName]._rotation ="????",_x = 150,_y = 150; //value to go in here?????// } } xcWind.trigger(); <?xml version="1.0" encoding="ISO-8859-1"?> <document> <locationdata> <winddirection>300</winddirection> </locationdata> </document>
Hi, this[clipName]._rotation ="????",_x = 150,_y = 150; //value to go in here????? Try: this[clipNam]._rotation = Wind,_x=150,_y=150;
Cheers for the replies Chaos58 when I trace mXML it come up undefined and Flash Grettir when i put wind as the value it doesnt work cheers for replies
Don't see what you're looking for? Try a search.
|