Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Posts
    8

    A little tricky loop question

    I may be going about this all wrong but here it it goes.

    I'm trying to emulate a program that was done in flash. After a minute of inactivity this program will display an image and move it from upper left corner to lower right corner until the image has been clicked on. (Screen saver sorta thing) Now I can make the image move easily enough, however since it's in a loop nothing else can be done while the loop is going.

    Code:
    pg = Page.GetFocus();
    
    while (pg == "Page1") do
    	min = 0;  -- The number to start at
    	max = 100;  -- The number to stop at
    	step = .1;  -- The number to count by (in this case 0, 2, 4, ...)
    	for count = min, max, step do
    		Image.SetPos("Image1", 4 * count, 3 * count);
    	end
    	min = 0;  -- The number to start at
    	max = 100;  -- The number to stop at
    	step = -.1;  -- The number to count by (in this case 0, 2, 4, ...)
    	for count = max, min, step do
    		Image.SetPos("Image1", 4 * count, 3 * count);
    	end
    end
    This code moves a 400x300 image from corner to corner in a 800x600 project. Any way to check for a mouse click on the image while in the loop? Or a better way to move the image(or any object)?

    TIA

    PS - Also to note, the image doesn't seem to move steadily as one would expect in an incremental loop. After about 2 secs in speeds up slightly, odd thats all.

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    IMHO, what you should do is use the onTimer Event of the page.
    Here is an example. Check code in the onShow Event, onTimer Event, Global Functions and onCLick Event of the image.

    Hope that helps

    Yossi
    Attached Files

  3. #3
    Join Date
    Oct 2005
    Posts
    8
    Thanks yosik, will give it a try when I get back later.

  4. #4
    Join Date
    Oct 2005
    Posts
    8
    Think that might do the trick, will have to mess around with it.

  5. #5
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Good luck

    Yossi

Similar Threads

  1. While loop problem
    By Sferical1 in forum Setup Factory 7.0
    Replies: 13
    Last Post: 03-03-2009, 07:56 AM
  2. Unusual sound effect with a loop.
    By longedge in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 02-07-2005, 05:59 PM
  3. How to control loop time on this code?
    By pierre in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 04-29-2004, 07:02 AM
  4. Replies: 14
    Last Post: 06-24-2003, 04:21 AM
  5. Loop gives error
    By TJ_Tigger in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 06-04-2003, 07:38 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