Post 1 made on Saturday January 19, 2008 at 23:09 |
Minstrel Long Time Member |
Joined: Posts: | September 2004 20 |
|
|
Hi, I´m trying to make a button walk around the screen and I'm having a hard time. Example: I want to move a button (tagged "BUTON") 100 pixels vertically, so I put this code on another button on the same page: =============== var bt=widget("BUTTON"); // just referencing the button tagged "BUTTON" for(var i=100 ; i>0 ; i--) //creating the loop { bt.top-=i; // move the button up by one line every loop System.delay(100); // a delay so the movement can be seen }; ===============
When I activate the script, the TSU9400 stops responding for a little time then the button appears 100 lines above the inicial line, like it should, but there's no animation'.The button simply pops up 100 lines above (100*100 ms after)!! No matter what I do, I can't make it animate. Am I missing anything?
thank you!
|
|
Post 2 made on Saturday January 19, 2008 at 23:28 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 13,007 |
|
|
Use scheduleAfter() or following your System.delay(100); issue GUI.updateScreen() (may be refreshScreen()).
I highly suggest downloading from the Philips Site The Kazaam game and having a look as well. I helped Andre out by making his credits page use scheduleAfter() for animation.
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
OP | Post 3 made on Sunday January 20, 2008 at 01:11 |
Minstrel Long Time Member |
Joined: Posts: | September 2004 20 |
|
|
Than you very much! It did worked!!!
|
|
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.