ver1 era una unità autonoma, che proseguirà, al tempo stesso, questa volta da creating più versioni di un orfano è possibile chiamare il sistema di codifica used. NET e gestisce le informazioni sui progressi del codice non farcela, ed eseguire il caricamento di dati da trattare come una gestione delle eccezioni metodo è stato nullo.
codice AS3
1 2 3 4 5 6 7 8 | com.dao.GetXML importazione; init ( ) : void private function init (): void ( ; GetXML.getXML (xmlPath, inputReferMethod, enterMethod); / / O GetXML.getXML (xmlPath, inputReferMethod); ) inputReferMethod ( xml : XML = null ) : void { } private function inputReferMethod (xml: XML = null): void () enterMethod ( ) : void { } private function enterMethod (): void () |
codice AS3
1 2 3 4 5 6 7 8 9 Dieci 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Trenta 31 A 32 33 34 A 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79a 80 81 82 83 84 85 86 87 | com.dao { /** * 플래시 기본 API 클래스 */ import flash.display . Sprite ; import flash.events . Event ; import flash.net . URLLoader ; import flash.net . URLRequest ; import flash.events . IOErrorEvent ; /** * XML 데이터 정보를 관리한다. */ final public class GetXML { /** Private Properties */ private var inputReferMethod : Function ; private var enterMethod : Function ; public function GetXML ( xmlPath : String = "" , setXMLFunc : Function = null , enterFunc : Function = null ) { trace ( "## XML :: getXML() = " , xmlPath ) ; if ( xmlPath == null ) return ; /** XML 데이터 값을 리턴 받을 참조 메서드 */ this .inputReferMethod = setXMLFunc; /** XML 데이터 완료시 실행할 참조 메서드 */ this .enterMethod = enterFunc; var ul : URLLoader = new URLLoader ( ) ; ul. addEventListener ( Event . COMPLETE , onCompleteXML ) ; ul. addEventListener ( IOErrorEvent . IO_ERROR , onErrorXML ) ; ul. load ( new URLRequest ( xmlPath ) ) ; } /** * XML 데이터를 로드하는 메서드 * @param xmlpath : 호출할 경로. * @param setXMLFunc : 로드가 완료 될 시에 XML 데이터를 파라메터로 받기 위한 메서드. * @param enterFunc : 로드가 완료 될 시에 실행할 메서드로서 enterMethod에 참조하여 실행되게 처리 됨. */ public static function getXML ( xmlPath : String = "" , setXMLFunc : Function = null , enterFunc : Function = null ) : GetXML { return new GetXML ( xmlPath, setXMLFunc, enterFunc ) ; } /** * XML 이벤트 핸들러 정의 */ /** COMPLETE */ private function onCompleteXML ( e : Event = null ) : void { trace ( "## XML :: onCompleteXML()" ) var xml : XML = XML ( e. target . data ) ; trace ( "## XML :: onComplete =" , xml ) ; /** 이벤트를 제거 한다 */ e. currentTarget . removeEventListener ( Event . COMPLETE , this .onCompleteXML ) ; e. currentTarget . removeEventListener ( IOErrorEvent . IO_ERROR , this .onErrorXML ) ; /** XML 데이터를 호출 할때 코어쪽에 데이터를 입력하기 위한 설정 메서드에 값을 인자로 넘긴다. / ** * @ Jin_u Autore, jinuiny@ghost-corps.com, www.jinustudio.com / blog * @ * @ dal 2009/06/28 versione 0.0.2 * / com.dao pacchetto (/ ** * flash classi di base API * / flash.display importazione. Sprite; flash.events importazione. evento; flash.net importazione. URLLoader; flash.net importazione. URLRequest; flash.events importazione. IOErrorEvent; / ** * dati XML è la gestione delle informazioni. * / public class GetXml finale (/ ** * Proprietà Private / var inputReferMethod privato: Funzione; enterMethod private var: Funzione; pubblica funzione GetXml (xmlPath: String = "", setXMLFunc: Function = null, enterFunc: Function = null) (trace ( "# # XML:: GetXml () =", xmlPath), se (xmlPath == null) return; / ** dati XML, vedere il metodo per ricevere il * valore di ritorno / presente. inputReferMethod = setXMLFunc; / ** di dati XML, al termine della Riferimento per eseguire il metodo * / questo. enterMethod = enterFunc; var ul: URLLoader = new URLLoader (); ul. addEventListener (Event. COMPLETE, onCompleteXML), ul. addEventListener (IOErrorEvent. IO_ERROR, onErrorXML), ul. carico (nuovo URLRequest ( ) / ** * metodi di caricamento dei dati XML * @ param xmlpath: chiamata. percorso * @ param setXMLFunc: Strada;) sarà completato al momento del metodo per ricevere i dati XML come parametri. * @ param enterFunc xmlPath): Download essere completata al metodo run di eseguire il processo come un riferimento diventa enterMethod. * / static public function GetXml (xmlPath: String = "", setXMLFunc: Function = null, enterFunc: Function = null): GetXml (ritorno nuova GetXml ( xmlPath, setXMLFunc, enterFunc);) / ** * XML gestori di eventi definito * / / ** * COMPLETE / funzione privato onCompleteXML (e: Event = null): void (trace ("# # XML:: onCompleteXML ()") xml: XML = XML (e. target var. dei dati); trace ("# # XML:: onComplete =", xml); / ** * Rimuove un evento / e. currentTarget. removeEventListener (Event. COMPLETE, questo. ); e. currentTarget onCompleteXML. removeEventListener (IOErrorEvent. IO_ERROR, questo. onErrorXML); / ** dati XML quando si chiama attraverso metodi di core per l'inserimento di dati come argomento passa un valore. .inputReferMethod ( xml ) ; /** XML 로드가 완료가 되면 실행 등록한 메서드를 실행한다. * / Questo. InputReferMethod (xml); / ** caricamento XML è completa, eseguire il metodo di esecuzione è registrato. ( this .enterMethod ! = null ) { this .enterMethod ( ) ; } } /** IO_ERROR */ private function onErrorXML ( e : IOErrorEvent = null ) : void { trace ( "## XML :: onError" ) ; } } } * / If (this. EnterMethod! = Null) (this. EnterMethod ();)) / ** * IO_ERROR / funzione privato onErrorXML (e IOErrorEvent = null): void (trace ("# # XML:: onerror") ;))) |













