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

Login:
Pass:
 
 

Topic:
Set Image Problem
This thread has 4 replies. Displaying all posts.
Post 1 made on Monday February 2, 2009 at 09:12
xrmichael
Long Time Member
Joined:
Posts:
June 2007
73
I am using the following script to change the image of a button to its pressed state image

if (wPage) CF.widget("but1").setImage(CF.widget("but1").getImage(1)); // this works

I then want to change the image back again but the following line has no effect

if (wPage) CF.widget((addr)).setImage(CF.widget((addr)).getImage(0));

Does the 1st command over right the released image with the pressed image ? preventing the change back ? I am trying to avoid a resources page holding the button images.

Thanks
Post 2 made on Monday February 2, 2009 at 12:45
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Look at the dev guide for widget.setImage().

In the call to setImage for a button or a panel, you SHOULD provide an index parameter of which image to set. If this parameter is missing, it defaults to 0. In your case, you are trying to set the image at index 1 and have NOT provided the correct index.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Tuesday February 3, 2009 at 03:02
xrmichael
Long Time Member
Joined:
Posts:
June 2007
73
The button i am trying to set the image of is not pressed on the panel so the target set image index would allways be 0.

Looking at it more i need a seperate page holding the pressed and released images.
Post 4 made on Tuesday February 3, 2009 at 11:45
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Sounds like you have a bug. Time for a _PS_DEBUG_ panel to find out what "addr" is and also make sure that your "addr" points to a widget that is on the same page.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Wednesday February 4, 2009 at 23:52
Spudnic
Long Time Member
Joined:
Posts:
January 2009
10
if (wPage) CF.widget((addr)).setImage(CF.widget((addr)).getImage(0));

Yeah, I think Lyndel is on to it ... what is addr .. is it a variable you've set? If so, it should resolve to a string reference ... otherwise your script won't work. You also shouldn't need the double parens. If addr is a widget object reference that you've set like:

var addr = CF.widget("widget","page");

then you maybe should be doing something like:

addr.setImage(addr.getImage(0));

... but it all depends on what addr is. Maybe you just need quotes instead of braces ... the way you've referenced it, addr is a variable of some sort.


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse