Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

in-object communication issue

Hello,

I created a object containing also a button with an event listener.

function winAddUser() {

    this.infoVar = '122';

    this.bExistingUser = Titanium.UI.createButton({
          height: 55,
          width: 130
    });

    this.bExistingUser.addEventListener("click", function(e) {
        // HOW TO ACCESS TO OBJECT FUNCTIONS/VARIABLES
    });



    this.changeUserType = function(type)
    {
        alert("AH");
    }

}

When the user clicked on the button how can I run the function "changeUserType" or access to the variable "infoVar" ?
I already tried to do like this:

this.infoVar or this.changeUserType() but it doesn't work.
Any idea?

casbar

— asked September 28th 2010 by Caspar Baratella
  • communication
  • listener
  • object
  • this
0 Comments

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.