Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6

Thread: Script.Wait

  1. #1
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432

    Script.Wait

    Hello,

    I'm having some problems with a script I'm playing with. Itsn't any way to simulate an Script.Wait or something like this? I don't want the whole application to be frozen during the waiting time. Just my script. I'm trying to find a way to not use OnTimer to do some animations.

    Here's my script:
    Page OnShow:
    Code:
    wndSize = Window.GetSize(Application.GetWndHandle());
    --Custom Variables
    	--Page Margin:
    	marginTop = 10;
    	marginBottom = 10;
    	marginRight = 10;
    	marginLeft = 10;
    OnClick (any button):
    Code:
    thisSize = Button.GetSize(this)
    thisPos = Button.GetPos(this);
    Xpos = wndSize.Width - thisSize.Width - marginRight;
    Ypos = wndSize.Height - thisSize.Height - marginTop;
    
    while thisPos.X < Xpos do
        if thisPos.Y < Ypos then
    	    thisPos = Button.GetPos(this);
    		Button.SetPos(this, thisPos.X+1, thisPos.Y+1);
    	end 
    end
    BTW, I have a problem in the last script. If I only add a value to the X axis, that's ok. It stops at the page limits. But if I add a value to the Y, it never stops and I'm forced to use CTRL+Alt+Del. Do you know what is the problem?

    Thanks!
    FoxLeader
    Note: I attached the apz.
    Attached Files

  2. #2
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Hello,

    I found this page explaining what I want in "plain Lua". Could anybody help me integrate this in AMS?

    I had a quick look, this didn't work. And I don't really know how to do this... so any help would be appreciated

    Regards,
    FoxLeader

  3. #3
    Join Date
    Aug 2003
    Posts
    2,427
    Try the following code in the button on click, it works for me -

    Code:
    thisSize = Button.GetSize(this)
    thisPos = Button.GetPos(this);
    Xpos = wndSize.Width - thisSize.Width - marginRight;
    Ypos = wndSize.Height - thisSize.Height - marginTop;
    
    while not stop do
        	Button.SetPos(this, thisPos.X+1, thisPos.Y+1);
    		thisPos = Button.GetPos(this);
    	if (thisPos.Y > (Ypos-(thisSize.Height/2))) or (thisPos.X > Xpos) then
    	stop=true
    	end 
    end
    
    stop = false
    Last edited by longedge; 02-03-2008 at 12:11 PM.

  4. #4
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Thanks, this part worked

    Does anybody has an idea for the second part? (the wait thing).

    Regards,
    FoxLeader

  5. #5
    Join Date
    Aug 2003
    Posts
    2,427
    Well I've been playing around with swf's that I put on a page as a 1 pixel object that do nothing but send fsCommands at various intervals, each one named differently so I can use them as multiple timers/counters. Don't know if using a flash object would be an option for you?

  6. #6
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Yes, this might be an option in most cases since Flash is common, but I'd rather not have to relay on this. And in this case, it's not a real timer I want... it's just to make the script wait before acting...

    The page I pointed should be a good start for a more experienced coder... but I'm not XD

    I will post this in the suggestions forum. This might get more visibility and just be helpful for others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts