XML to Object in AS3

Turbo123

New Member
I'm trying to make this XML file into an object in AS3.\[code\]<?xml version="1.0" encoding="utf-8"?><mimeTypes> <mimeType> <ext>.ico</ext> <type>image/x-icon</type> </mimeType> <mimeType> <ext>.txt</ext> <type>text/plain</type> </mimeType> <mimeType> <ext>.html</ext> <type>text/html</type> </mimeType></mimeTypes>\[/code\]The problem is I'm trying to make the ext = the type.For example;\[code\]mimeTypes[".ico"] = "image/x-icon";mimeTypes[".txt"] = "text/plain";mimeTypes[".html"] = "text/html";\[/code\]Is there anyway I can do this?This is my code right now:\[code\]var mimeXML = new XML(e.target.data);var len:uint = mimeXML.mimeType.length();mimeT[mimeXML.mimeType.child("ext")] = mimeXML.mimeType.child("type");for(var id:String in mimeT) { var value:Object = mimeT[id]; trace(id + " = " + value);}\[/code\]but, it outputs:\[code\]<ext>.ico</ext><ext>.txt</ext><ext>.html</ext> = <type>image/x-icon</type><type>text/plain</type><type>text/html</type>\[/code\]Any help would be appreciated, thanks!
 
Back
Top