Visualizzazione dei risultati da 1 a 5 su 5

Discussione: visualizzazione xml

  1. #1
    Utente di HTML.it L'avatar di paxxx80
    Registrato dal
    Dec 2001
    Messaggi
    185

    visualizzazione xml

    eccomi di nuovo con un altro problema...entro la fine del mese mi ucciderete
    si tratta sempre del solito filmato ma ho un altro problema...cioè dovrei caricare un xml per poi formarci un grafico,il fatto è che il codice non mi dà errori (fermo restando che la parte che forma l'xml,sempre una pagina asp,funziona perfettamente),però il grafico che è formato dall'xml non mi viene assolutamente visualizzato.cioè mi compare subito la scritta "caricamnto in corso",che dovrebbe poi scomparire e comparire il grafico.solo che quando la scritta scompare non compare nulla.sono di nuovo disperata
    ho paura di non essermi spiegata tanto bene..in quessto caso chiedete pure...so che sembra assurdo ma io non ho mai fatto niente di simile in flash....
    grazie 1000 a tutti.

  2. #2
    Utente di HTML.it L'avatar di paxxx80
    Registrato dal
    Dec 2001
    Messaggi
    185
    xspiefarmi meglio..a ogni trace che faccio,tipo così:

    trace("numero nodi --> " + this.firstChild.childNodes.length);
    trace("primo nodo --> " + this.firstChild.childNodes[i]);

    mi dà sempre "undefined"...sembra quasi non caricare l'xml,ma allora non dovrebbe darmi errore????
    please hellllpp me disperata

  3. #3
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    dovresti postare il codice perchè si possa aiutarti

  4. #4
    Utente di HTML.it L'avatar di paxxx80
    Registrato dal
    Dec 2001
    Messaggi
    185
    eccolo...è lunghissimo lo so..questo è tutto..poi magari sbaglio una stupidaggine,ma come dicevo non sono molto esperta.grazie a chiunque non mi manderà a quel paese vedendo la lunghezza del codice



    function resize(scaleY)
    {
    for (i = 1; i <= _root.arrayNodi.length - 1; i++)
    {
    objNodo = eval("_root." + _root.arrayNodi[i].name);
    objNodo._y = objNodo._y * 1;
    } // end of for
    } // End of the function
    function objNode(name, x, y, col, current, descr)
    {
    this.name = name;
    this.x = x;
    this.y = y;
    this.col = col;
    this.current = current;
    this.name = name;
    this.descr = descr;
    } // End of the function
    function setColor(strCol)
    {
    if (strCol == "w")
    {
    return (16777215);
    } // end if
    if (strCol == "n")
    {
    return (13421772);
    } // end if
    if (strCol == "g")
    {
    return (6736998);
    } // end if
    if (strCol == "r")
    {
    return (16711680);
    } // end if
    if (strCol == "c")
    {
    return (3394815);
    } // end if
    if (strCol == "y")
    {
    return (16776960);
    } // end if
    if (strCol == "b")
    {
    return (255);
    } // end if
    } // End of the function
    function objArc(x, y, col, colL, n1, n2, descr)
    {
    this.x = x;
    this.y = y;
    this.col = col;
    this.colL = colL;
    this.n1 = n1;
    this.n2 = n2;
    this.descr = descr;
    } // End of the function
    function drawNodi()
    {
    for (i = 1; i <= arrayNodi.length - 1; i++)
    {
    duplicateMovieClip(nodo, arrayNodi[i].name, i + levelNodi);
    with (eval(arrayNodi[i].name))
    {
    _xscale = gScale;
    _yscale = gScale;
    _x = arrayNodi[i].x * _root.scaleX;
    _y = arrayNodi[i].y * _root.scaleY;
    descr = arrayNodi[i].descr;
    current = arrayNodi[i].current;
    col = arrayNodi[i].col;
    C = new Color(nodoColor);
    C.setRGB(setColor(arrayNodi[i].col));
    } // End of with
    } // end of for
    } // End of the function
    function drawArchi()
    {
    for (i = 1; i <= arrayArchi.length - 1; i++)
    {
    ++levelArchi;
    duplicateMovieClip(head, "headArc" + levelArchi, levelArchi);
    with (eval("headArc" + levelArchi))
    {
    _xscale = gScale / 2;
    _yscale = gScale / 2;
    _x = arrayArchi[i].x * _root.scaleX;
    _y = arrayArchi[i].y * _root.scaleY;
    descr = arrayArchi[i].descr;
    strC = arrayArchi[i].col;
    C = new Color(nodoColor);
    C.setRGB(setColor(arrayArchi[i].col));
    objNodoTarget = eval("_root." + arrayArchi[i].n2);
    delta_x = _x - objNodoTarget._x;
    delta_y = _y - objNodoTarget._Y;
    Arrow._rotation = -Math.atan2(delta_x, delta_y) / 1.745329E-002;
    } // End of with
    ++levelLinee;
    duplicateMovieClip(linea, "linea" + levelLinee, levelLinee);
    x = _root[arrayArchi[i].n1]._x;
    y = _root[arrayArchi[i].n1]._y;
    x1 = arrayArchi[i].x * _root.scaleX;
    y1 = arrayArchi[i].y * _root.scaleY;
    with (eval("linea" + levelLinee))
    {
    _x = x1;
    _y = y1;
    _xscale = x - x1;
    _yscale = y - y1;
    } // End of with
    C = new Color(eval("linea" + levelLinee));
    C.setRGB(setColor(arrayArchi[i].colL));
    ++levelLinee;
    duplicateMovieClip(linea, "linea" + levelLinee, levelLinee);
    x = arrayArchi[i].x * _root.scaleX;
    y = arrayArchi[i].y * _root.scaleY;
    x1 = _root[arrayArchi[i].n2]._x;
    y1 = _root[arrayArchi[i].n2]._y;
    with (eval("linea" + levelLinee))
    {
    _x = x1;
    _y = y1;
    _xscale = x - x1;
    _yscale = y - y1;
    } // End of with
    C = new Color(eval("linea" + levelLinee));
    C.setRGB(setColor(arrayArchi[i].colL));
    } // end of for
    } // End of the function
    function esito(success)
    {
    trace("esito!!!");
    if (success)
    {
    _root.info = "";
    convertXMLnodes();
    drawNodi();
    drawArchi();
    }
    else
    {
    _root.info = "Problemi nel caricamento.";
    } // end else if
    } // End of the function
    function convertXMLnodes()
    {
    trace("creazione grafico --> 1");
    mainTag = new XML();
    trace("titolo --> " + mainTag.childNodes[0].firstChild.nodeValue);
    elementTag = new XML();
    nodeList = new Array();
    arcList = new Array();
    mainTag = xml_graph.firstChild.nextSibling;
    nodeList = mainTag.childNodes;
    -->ATTENZIONE!!!QUESTO E' QUELLO CHE MI DA' UNDEFINED
    trace("numero nodi --> " + xml_graph.firstChild.childNodes.length);
    trace("primo nodo --> " + xml_graph.firstChild.childNodes[i]);
    for (i = 0; i <= nodeList.length; i++)
    {
    //trace("nodo -->" + nodeList[i].nodeName);
    if (nodeList[i].nodeName != null && nodeList[i].nodeName == "nodo")
    {
    trace("creazione grafico --> 2");
    ++indNodi;
    descr = nodeList[i].attributes.desnodo;
    nome = nodeList[i].attributes.nome;
    x = parseInt(nodeList[i].attributes.x);
    y = parseInt(nodeList[i].attributes.y);
    if (x > _root.absLeft)
    {
    _root.absLeft = x;
    } // end if
    if (y > _root.absBottom)
    {
    _root.absBottom = y;
    } // end if
    col = nodeList[i].attributes.col;
    curr = parseInt(nodeList[i].attributes.curr);
    arrayNodi[indNodi] = new objNode(nome, x, y, col, curr, descr);
    arcList = nodeList[i].childNodes;
    for (j = 0; j <= arcList.length; j++)
    {
    if (arcList[j].nodeName != null && arcList[j].nodeName == "arco")
    {
    ++indArchi;
    descr = arcList[j].attributes.desarco;
    x = parseInt(arcList[j].attributes.x);
    y = parseInt(arcList[j].attributes.y);
    col = arcList[j].attributes.col;
    colL = arcList[j].attributes.colLine;
    n1 = arcList[j].attributes.n1;
    n2 = arcList[j].attributes.n2;
    arrayArchi[indArchi] = new objArc(x, y, col, colL, n1, n2, descr);
    } // end if
    } // end of for
    } // end if
    } // end of for
    } // End of the function
    trace ("SONO NELL'XML --> 1");
    stop ();
    trace ("SONO NELL'XML --> 2");
    system.useCodepage = true;
    var indNodi = 0;
    var indArchi = 0;
    var gScale = 70;
    var scaleX = 1;
    var scaleY = 1;
    var levelNodi = 100;
    var levelArchi = 50;
    var levelLinee = 10;
    var absBottom = 0;
    var absleft = 0;
    var maxLeft = _root.bgk._width - 50;
    var maxBottom = _root.bgk._height - 100;
    var nodoCorrX = 0;
    var nodoCorrY = 0;
    var defLegCorrX = _root.bgk._width / 2;
    var defLegCorrY = 320;
    var legCorrX = _root.bgk._width / 2;
    var legCorrY = 320;
    var centerScreenX = _root.bgk._width / 2;
    var centerScreenY = _root.bgk._height / 2;
    etichetta._visible = false;
    attivita._visible = false;
    nodo._visible = false;
    blink._visible = false;
    blinkL._visible = false;
    blink.swapDepths(2000);
    blinkL.swapDepths(2001);
    head._visible = false;
    legenda._visible = false;
    note._visible = false;
    etichetta.swapDepths(1000);
    attivita.swapDepths(1001);
    legenda.swapDepths(1002);
    note.swapDepths(1003);
    subproc.swapDepths(900);
    var arrayArchi = new Array();
    var arrayNodi = new Array();
    xml_graph = new XML();
    trace ("subito prima di esito");
    xml_graph.onLoad = esito;
    xml_graph.load("grafo.asp");
    trace ("SONO NELL'XML --> 3");

  5. #5
    Utente di HTML.it L'avatar di paxxx80
    Registrato dal
    Dec 2001
    Messaggi
    185
    scusate ma io ora dò veramente le testate contro il muro
    esattamente lo stesso problema che ho scritto nell'altro post la stringa di parametri...funziona se invece di passare la stringa xml in un file asp la faccio caricare direttamente attraverso un file xml!!!!!!
    ma perchè?????????????????????????

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.