Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3

Thread: timed page.jump

  1. #1
    Join Date
    Jul 2004
    Posts
    313

    timed page.jump

    Can anyone tell me how to create a page that will jump to another page after 10 minutes?

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    I like the easy ones

    Just put this in the first pages onShow Event -

    Page.StartTimer(600000);

    Then, in the onTimer event, tell it what to do when the timer fires -

    Page.Jump("your_page");

    HTH

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Here is a little trick I learned from Worm. It uses a dll on your windows machine to get the system time. It proved to be more accurate when creating a timer for the quiz app that I built.

    I have tried to add comments on things you can change within the project. Let me know if you have questions.

    Here is the function:

    DoTimer(allowedtime, JumpPage);
    - allowedtime is defined in seconds unless you uncomment a line within the function, then you can define allowedtime in minutes
    - JumpPage is a string that defines the page to which you want to jump

    Code:
    function DoTimer(allowedtime, JumpPage)
    	-- allowedtime is defined in Seconds
    	-- JumpPage is a string defining the page to jump to when the timer expires
    	
    	-- Uncomment the following text to change the specified allowed time from seconds to minutes
    	--allowedtime = allowedtime *60
    	
    	if basetime == nil then
    		basetime = DLL.CallFunction(_SystemFolder .. "\\winmm.dll", "timeGetTime", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    	end
    	
    	curtime =  DLL.CallFunction(_SystemFolder .. "\\winmm.dll", "timeGetTime", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
    	elapsedtime = allowedtime - ((String.ToNumber(curtime) - String.ToNumber(basetime)) / 1000)
    	
    	if elapsedtime <= 0 then
    		Page.StopTimer()
    		Page.Jump(JumpPage)	
    	else --comment out or delete this section to remove the timer that is shown on the page
    		hours = Math.Floor(elapsedtime / 3600);
    		mins = Math.Floor((elapsedtime - (hours * 3600)) / 60);
    		secs = Math.Floor(elapsedtime - ((hours*3600)+(mins*60)));
    		
    		if hours < 10 then
    			hours = "0"..hours;
    		end
    		if mins < 10 then
    			mins = "0"..mins;
    		end
    		if secs < 10 then
    			secs = "0"..secs;
    		end
    		
    		Label.SetText("Timer", hours..":"..mins..":"..secs)
    		--delete or comment through here
    	end
    end
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Similar Threads

  1. Getting an error on Page.Jump
    By Crash_Davenport in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-29-2004, 05:51 AM
  2. Page.Jump
    By Philster in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 10-02-2003, 12:28 PM
  3. Page.Jump on Condition
    By Terry Vance in forum AutoPlay Media Studio 4.0
    Replies: 6
    Last Post: 08-15-2003, 09:32 AM
  4. How to make a timed event? (if supported :P )
    By Xtense in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 06-23-2003, 12:38 AM
  5. Can events be timed?
    By a6106a in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 02-04-2002, 04:33 AM

Posting Permissions

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