Visualizzazione dei risultati da 1 a 5 su 5

Discussione: caricare xml

  1. #1

    caricare xml

    questo il banale codice:

    Codice PHP:
    var xmlLoader:URLLoader = new URLLoader();

                var 
    xmlData:XML = new XML();

                
    xmlLoader.addEventListener(Event.COMPLETELoadXML);
                
    xmlLoader.addEventListener(IOErrorEvent.IO_ERRORioErrorHandler);
                
    //xmlLoader.load(new URLRequest("xx.xml"));
                
    xmlLoader.load(new URLRequest("http://localhost/agrimec/admin/output.php"));

                function 
    LoadXML(e:Event):void {

                    
    xmlData=new XML(e.target.data);

                    
    trace(xmlData);

                } 
    mi da questo errore:
    Error opening URL 'http://localhost/agrimec/admin/output.php'

    ovvio che il server locale è attivo etc etc, se accedo all'indirizzo dal browser tutto è ok.

    l'xml è formattato correttamente, se ne compio il contenuto in xx.xml ad esempio (linea commentata) fila tutto liscio.

    idee?
    There is nothing conceptually better than Rock 'n' Roll.

    poker is very much like sex. most people think they're the best but don't know what they're doing.

  2. #2
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    Verifica cosa ottieni direttamente con un trace dentro alla funzione (e.target.data).
    Se ottieni comunque errore è inutile, deve per forza essere il link errato.

    Codice PHP:
    var loader:URLLoader = new URLLoader(new URLRequest("http://localhost/agrimec/admin/output.php"));
    loader.addEventListener(Event.COMPLETEcompleteHandler);
    function 
    completeHandler (evt:Event=null):void {
        
    trace(evt.target.data);


  3. #3
    ottengo il seguente:

    Error opening URL 'http://localhost/agrimec/admin/output.php'
    Error #2044: ioError non gestito:. text=Error #2032: Errore di flusso. URL: http://localhost/agrimec/admin/output.php
    at index_fla::MainTimeline/frame1()

    l'url è corretto, se lo apro nel browser funziona. :master:
    There is nothing conceptually better than Rock 'n' Roll.

    poker is very much like sex. most people think they're the best but don't know what they're doing.

  4. #4
    a posto andrea, risolto.
    la prossima volta guardo meglio le impostazioni del firewall

    grazie.
    There is nothing conceptually better than Rock 'n' Roll.

    poker is very much like sex. most people think they're the best but don't know what they're doing.

  5. #5

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.