HOME
NEWS
REVIEWS
FEATURES
FILES
FORUMS
Philips Pronto Professional Forum - View Post
Find remotes at:
Read more news »
Acoustic Research Xsight Touch ARRX18G
Sony PlayStation 3 Advanced Control Roundup
Pinnacle PCTV HD Pro Stick HDTV Tuner
Universal Remote Control Inc. Digital R50
[
SEARCH
]
[
CONTACT
]
The following page was printed from RemoteCentral.com:
Forums
>
Professional
>
Philips Pronto Professional
View Single Message
Login:
Pass:
Register
Forum Search
Login
Original thread:
Problem with clossure
Post 6
made on
Tuesday November 30, 2010
at
20:57
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
View Profile
And...
If you cannot get closure working, you can always store fields on the widget and reference them at time function is called using the 'this' keyword.
CF.widget("BTN_ON_" + (i+1)).myID = actors[i].id;
And inside your onPress function, you can do the following:
function pressHandler()
{
// this keyword points to actual widget inside onPress.
System.print(this.myID);
}
CF.widget("BTN_ON_" + (i+1)).onPress = pressHandler;
And... If you cannot get closure working, you can always store fields on the widget and reference them at time function is called using the 'this' keyword. CF.widget("BTN_ON_" + (i+1)).myID = actors[i].id; And inside your onPress function, you can do the following: function pressHandler() { // this keyword points to actual widget inside onPress. System.print(this.myID); } CF.widget("BTN_ON_" + (i+1)).onPress = pressHandler;
Lyndel McGee
Philips Pronto Addict/Beta Tester
View Code
View Normal
View the original thread...
©1998-2024, Daniel Tonks. All rights reserved.
Contact
|
Advertise
Home
|
News
|
Reviews
|
Features
|
Files
|
Forums
|
Search