I feel that using FlashMX2004 components

xiaoxiao2021-03-06  39

When using the flashmx2004 component, when connecting the XML file, there is no need to understand XML, just know the probably format. The code is as follows: stop (); system.useCodePage = true; // Tell Flash to use local encoding, solve Chinese problems _Global.myxml = new xml (); // establish XML global class object MyXMLVAR CBOX = New Array (); var Clist = new array (); maincontent.fontsize = 20; // Set the font size MYXML.LOAD ("MyXML.XML") in Textarea; MyXML.IgnoreWhite = true; myxml.onload = function (Success) {ix (Success) ) {If (myxml.childnodes [0] .HaschildNodes ()) {// Search for sub-tag for (i = 0; i ) {CBOX [i] = myxml.childNodes [0] .childnodes [i]. Attributes.name; if (myxml.childnodes [0] .childnodes [i] .nextsibling == null) {breaf; // If there is no label, you have not, exit loop}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} ] .childnodes [0] .HaschildNodes ()) {for (i = 0; i ) {clist [i] = myXml.childNodes [0] .childNodes [0] .childnodes [i]. attributes.name; IF MYXML.CHILDES [0] .childnodes [0] .childnodes [i] .nextsibling == null) {Break;}}} mybox.setdataProvider (CBOX); MyList.SetDataProvider (CLIST); VAR Texts: string = myxml.childNodes [0] .childnodes [0] .childnodes [0] .childNodes [0] .NodeValue; _root.maincontent.text = texts;}} // Set Horizontal Scroll MyContent.hscrollPolicy = "ON "; mylist.hscrollpolicy =" on "; when writing, pouring the XML always does not normalize Chinese characters, spent, can be used: system.usendepage = true; this line code is to inform Flash to use local encoding, so that can be solved Chinese problem

转载请注明原文地址:https://www.9cbs.com/read-72849.html

New Post(0)