PDA

View Full Version : Can not get this button to work on PPC



talm
February 9th, 2005, 02:16 PM
I am trying to have a button that will change states depending on Zoom Player power state. When ZP is off, the button will be red and when pressed, it will turn on ZP and will change to green. When the button is Green and then pressed, ZP will close and the button will change back to Red.

I was able to get this to work on a WIN32 but not on my Dell Axim PPC. I might add that when I turn on ZP from the WIN32 NR machine, the button changes his color and I can control ZP but I can not get it to close or open ZP.

Here is my button setup;

ID Tag:
STATE:ZP.LinkActive:0

IR Name:
if NetRemote.GetVariable('ZP.LinkActive')=="1" then
NetRemote.ExecuteAction(-1,0, 1, 'ZOOM.Off', 0)
else
NetRemote.ExecuteAction(-1,0, 1, 'ZOOM.On', 0)
end

IR Code:
5001 0000 0000 0002 fc19 0007 0000 0000

Any Ideas?

Tal

avid
February 9th, 2005, 03:04 PM
Try putting that LUA code into a function in a separate LUA file. And change the IR name of the button to call that function. I think that LUA actually in an IR name may be limited to 128 chars - and you have 164.

Brian

talm
February 9th, 2005, 07:55 PM
Brian,

You are right. I moved the LUA code to the LUA file and called it from NR and it works like a champ. The only thing that through me off was that it was working on WIN32.

Here is what I did to get it working:

1) Created a function called ToggleZoomPlayer() and put it in the top of the LUA file.

function ToggleZoomPlayer()
if NetRemote.GetVariable('ZP.LinkActive')=="1" then
NetRemote.ExecuteAction(-1,0, 1, 'ZOOM.Off', 0)
else
NetRemote.ExecuteAction(-1,0, 1, 'ZOOM.On', 0)
end
end;

2) Changed the button IR Name to ToggleZoomPlayer()

3) Left the data in the IR the same (5001 0000 0000 0002 fc19 0007 0000 0000)

Thanks to Brian and rah99 for helping me getting this issue resolved.

Tal