Hi,

quick fix:

request.addListener("
completed", function(e){
     if(e.getContent() == "true")
     {
           this.tmp_var = true;
           alert('True');
     }
     else
     {
           this.tmp_var = false;
           alert('False');
     }
}, this);

third argument to addListener() is the function context.

Hope that helps
- Petr

On Wed, Jul 14, 2010 at 3:12 PM, rlbferreira <
[email protected]> wrote:

>
> Hi,
>
> I'm trying to do a remote request/response - http://pastebin.com/NLZWpifw.
>
> And the script is working just fine! My problem has to do with the
> variables
> scope.
>
> If I try to access a variable of the script that I'm calling from, it gives
> me a error because the variable is not defined. But I defined in the
> "members" and even in "main". Can anyone help me?
>
> -- Example --
>
> request.addListener("completed", function(e){
>      if(e.getContent() == "true")
>      {
>            this.tmp_var = true;
>            alert('True');
>      }
>      else
>      {
>            this.tmp_var = false;
>            alert('False');
>      }
> });
>
> -- --
>
> Thanks in advance.
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Variables-Scope-tp5292436p5292436.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



-- 
Best regards
- Petr Kobalicek <http://kobalicek.com>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to