Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 3 made on Friday August 6, 2010 at 18:58
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
I use panel labels and eval() quite often.

Here's is an example of panel label content defining 2 fields and a function.

var toReturn = {};
toReturn.field1='Hello';
toReturn.field2='World!';
toReturn.doSomething = function(){return (this.field1 + ' ' + this.field2);};
toReturn; // eval returns the evaluation of last statement which is the object you to return. See Mozilla documentation.

// Now, use the thing.
var evaluated = eval(CF.widget(tags to get to panel above).label);
System.print(evaluated.toSource(););
System.print(evaluated.doSomething());

Note that you can assign null to evaluated variable and all evaluated stuff is cleaned up.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse