I think it has to do with the scope of dados, so put on top of your script:
   *var dados = new Array (); *

the func carregaDados doesn't empty the same dados as the one in in the onLoad func, because it won't know it; try to put trace(dados) as the first line in carregaDados before you empty the array; without declaring the var "globally" it will trace undefined I guess.**

---->>>>

*var dados = new Array (); *

myDados = new LoadVars ();
myDados.onLoad = function ()
{
   for (var c in this)
   {
       if (c != "onLoad")
       {
           dados.push (this[c]);
       }
   }
   trace ("************************      " + dados);
   dados.pop ();
   myLength = dados.length;
   trace (myLength);
   i = 0;
   //assignDados (i);
};
function carregaDados (cat)
{
*trace(dados)* //??????? dados = null;
   dados = new Array ();
   myDados.load ("http://www.myurl.com/myfile.php?serie="; + cat);
}


>>>>* you can remove the dados = null; *


I´m loading some vars from a php database. The prob is that i have to load
different php files (categories) and has i am using an Array to push my
database values, btu when i needed to change the ategorie, i load my php
again but the Arrays does not delete it always has the same values... :(

Code:

myDados = new LoadVars ();
myDados.onLoad = function ()
{
    for (var c in this)
    {
        if (c != "onLoad")
        {
            dados.push (this[c]);
        }
    }
    trace ("************************      " + dados);
    dados.pop ();
    myLength = dados.length;
    trace (myLength);
    i = 0;
    //assignDados (i);
};
function carregaDados (cat)
{
    dados = null;
    dados = new Array ();
    myDados.load ("http://www.myurl.com/myfile.php?serie="; + cat);
}

The function carregaDados is the one i run when i want to load new values or
a new categorie froom my DB. the prob is that i have tried everything to
delete the old Array to update with new values, but no luck.

Any help please?

--
------------------------------------------------------------
Mário Jorge
Icq: 164987050
Msn + Mail: [EMAIL PROTECTED]
Web: http://www.beedigital.net
Blog: http://www.beedigital.net/blog
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to