List Info

Thread: Strange problem with LoadVars




Strange problem with LoadVars
country flaguser name
Romania
2007-02-19 12:33:42
I have this script :

function adauga() {
    error.length = 0;
    verif();
    if (error.length>0) {
        status_txt.text = "Completati corect toate
campurile";
    } else {
        trace("succes");
        c1.onLoad = function() {
            status_txt.text = this.rez;
            switch (this.rez) {
            case "b" :
                status_txt.text = "Contul a fost creat
cu succes";
                var i:Number = 0;
                while (i<=a.length-1)  {
                    dataSend.nume = nume_txt.text;
                    dataSend.pnume = pnume_txt.text;
                    dataSend.clasa = a[i];
                    dataSend.user = user_txt.text;
                    dataSend.parola = pass1_txt.text;
                    dataSend.permisiune =
"profesor";
                   
dataSend.sendAndLoad("adauga.php", dataReceive,
"POST");
                    
trace("Ta"+i+"="+a[i]);
                    ++i;
                }
                break;
            case "a" :
                status_txt.text = "Contul nu a fost
creat - contul exista";
                break;
            default :
            }
        };
        d.user1 = user_txt.text;
        d.sendAndLoad("search.php", c1, 
"POST");
    }
}

I receive from the search.php the variable &rez=a or
&rez=b, in the status_txt.text shows "a" or
"b" (correct) but the instructions from switch
doesn't work. I tried with "if" too, but the same
problem, the instructions are not executed even if the
conditions is true.(the instructions in bold)

I would appreciate very much, if someone can help me to
solve this problem. 

Thank you,
Mike








 
---------------------------------
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
Check it out.
_______________________________________________
Flashcoderschattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcode
rs

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

Re: Strange problem with LoadVars
country flaguser name
Hungary
2007-02-19 12:58:59
Are you sure that there are no spaces or linebreaks after
the value
passed back? Placing a & symbol (delimiter) at the end
of each
value is always a good practice.

 Attila

BM> I have this script :
BM> 
BM> function adauga() {
BM>     error.length = 0;
BM>     verif();
BM>     if (error.length>0) {
BM>         status_txt.text = "Completati corect
toate campurile";
BM>     } else {
BM>         trace("succes");
BM>         c1.onLoad = function() {
BM>             status_txt.text = this.rez;
BM>             switch (this.rez) {
BM>             case "b" :
BM>                 status_txt.text = "Contul a fost
creat cu succes";
BM>                 var i:Number = 0;
BM>                 while (i<=a.length-1)  {
BM>                     dataSend.nume = nume_txt.text;
BM>                     dataSend.pnume = pnume_txt.text;
BM>                     dataSend.clasa = a[i];
BM>                     dataSend.user = user_txt.text;
BM>                     dataSend.parola =
pass1_txt.text;
BM>                     dataSend.permisiune =
"profesor";
BM>                    
dataSend.sendAndLoad("adauga.php", dataReceive,
"POST");
BM>                     
trace("Ta"+i+"="+a[i]);
BM>                     ++i;
BM>                 }
BM>                 break;
BM>             case "a" :
BM>                 status_txt.text = "Contul nu a
fost creat - contul exista";
BM>                 break;
BM>             default :
BM>             }
BM>         };
BM>         d.user1 = user_txt.text;
BM>         d.sendAndLoad("search.php", c1, 
"POST");
BM>     }
BM> }
BM> 
BM> I receive from the search.php the variable &rez=a
or &rez=b, in
BM> the status_txt.text shows "a" or
"b" (correct) but the
BM> instructions from switch doesn't work. I tried with
"if" too, but
BM> the same problem, the instructions are not executed
even if the
BM> conditions is true.(the instructions in bold)
BM>
BM> I would appreciate very much, if someone can help me
to solve this problem. 



_______________________________________________
Flashcoderschattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcode
rs

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

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )