Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004
    Posts
    3

    Random image display stop on key...

    Hey there...

    I need to create (very quickly) a random image displayer(?) of around 80 photographs of people.

    These photographs should be displayed for around .5 seconds each.

    Upon keypress / mouse down, the display should stop on the current image.

    I need some help... anyone??

    Cheers, Paul

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    Hello Paul,

    First of all I take it you've got AMS5 Pro Version which will allow to create random numbers.

    I would use IrfanView and resize all my pictures to the same dimensions and orientation then rename them image1.png through to image80.png.

    Insert an image object on your page with image1.png already loaded.

    In the pages On Show event do a Page.StartTimer(5000) for e.g. a 5 second display and then in the On Timer event enter use something like -

    x = Math.Random(1, 80);
    nextimage="AutoPlay\\Images\\image."..x.."png"
    Image.Load("Image1", nextimage);

    which will generate a number then build the number into a string to identify the image to load and load it.

    Some of the more capable members of the forum would probably write code to enumerate the image names and use them directly without the first steps but this is just one possibility which is quick and easy.

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by paulelvins
    Hey there...

    I need to create (very quickly) a random image displayer(?) of around 80 photographs of people.

    These photographs should be displayed for around .5 seconds each.

    Upon keypress / mouse down, the display should stop on the current image.

    I need some help... anyone??

    Cheers, Paul
    There are a few ways you can do this. If you don't want to rename your images I would suggest you use the File.Find to build a table of all your images. Those images will then be indexed numerically. Then you could use the Math.Seed/Math.Random to generate a random number between 1 and the Table.Count of the table containing your images. and then load that table[random] into your image object.

    As loneedge said, use the timer to change your images every .5 seconds. Then on keypress/mouse stop the timer.

    HTH
    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

  4. #4
    Join Date
    Dec 2004
    Posts
    3
    Thanks guys, but I can't seem to get it working.

    I've done exactly as longedge suggested but it doesn't seem to work, just stays on the first picture.

    Am I doing something wrong?... yep AMS5 PRO version being used.

    Cheers

    Paul

  5. #5
    Join Date
    Dec 2004
    Posts
    3
    Sorry guys... it was me!

    Working brilliantly now... thanks for your help

    Paul

Similar Threads

  1. Switching pictures with forward/back buttons
    By ilandv in forum AutoPlay Media Studio 4.0
    Replies: 10
    Last Post: 08-08-2004, 04:51 PM
  2. Function: Resize & Center an Image
    By kpsmith in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-17-2004, 01:36 PM
  3. Making a Thumbnail Image Browser
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 02:16 PM
  4. Display Text by Mouse Over of Image Object
    By jdanniel in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 04-30-2003, 12:05 PM
  5. Newbie - How to display an image w/mouseover
    By shake in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 08-23-2002, 08:48 PM

Posting Permissions

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