Titanium Community Questions & Answer Archive

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

Testing for a View Using Event Property: source

Hey guys - Trying to test for a view using the event property source.

Passing the source object is wicked easy and working just fine, but testing for the object is not.


function testView(e) {
     if (e.source == myView) {
          // do stuff

     // or

     switch (e.source) {
          case myView:
               // do stuff

myView.addEventListener("touchstart", testView);

Any ideas? This is pretty easy in other languages, since most display objects have a name property or you can just check the object itself.


— asked June 4th 2010 by Fred Spencer
  • event
  • source
  • view

1 Answer

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.