Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    47

    This is a tricky one ?

    Hi Guys...I'm trying to display images like a slide show but without a predetermined amount of images. I want AMS to be able to look in a directory and figure out how many slides are in the directory and display that info to a text box and an image object.

    I have a hard coded version now...

    if e_Key == 39 then
    picnumber = picnumber + 1;
    if picnumber >=5 then
    picnumber = 5
    end
    Image.Load("SlideImage", "AutoPlay\\Images\\pic."..picnumber..".jpg");
    Paragraph.SetText("output", "Now Showing Slide "..picnumber.." of 5");
    end

    if e_Key == 37 then
    picnumber = picnumber - 1;
    if picnumber <=1 then
    picnumber = 1;
    end
    Image.Load("SlideImage", "AutoPlay\\Images\\pic."..picnumber..".jpg");
    Paragraph.SetText("output", "Now Showing Slide "..picnumber.." of 5");
    end

    I want to automate the loading of the images and the text output (ex."5") so that if i have 5,6,10,etc.. images I can add or delete the images externally from AMS and it updates automatically.

    Any help is greatly appreciated.

    Thanks
    Last edited by octane6228; 06-07-2005 at 02:17 PM.

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Octane,

    You can try the following:

    --Populate a table with jpg files from the Image directory and count their numbers

    tbl_path = File.Find("AutoPlay\\Docs\\Images", "*.jpg", false, false, nil, nil);
    img_nbr = Table.Count(tbl_path);

    --Load and show the images
    for count = 1, img_nbr do
    Image.Load("SlideImage", "AutoPlay\\Docs\\Images\\pic."..count..".jpg") ;
    Paragraph.SetText("output", "Now Showing Slide "..count.." of"..img_nbr);
    end

    Of courses, you would need to decide on your trigger.

    Good luck
    Yossi

  3. #3
    Join Date
    Feb 2004
    Posts
    47

    Thanks but still need help!

    Thanks Yossi...It worked but one problem....I'm using this code on a key press...Right now it whips through each of the images. How do I get it to stop on each image and wait for the next key press?

    Here's what I have with your help so far...(On Key)

    --Populate a table with jpg files from the Image directory and count their numbers
    tbl_path = File.Find("AutoPlay\\Images\\slides", "*.jpg", false, false, nil, nil);
    img_nbr = Table.Count(tbl_path);

    if e_Key == 39 then

    --Load and show the images
    for count = 1, img_nbr do
    Image.Load("SlideImage", "AutoPlay\\Images\\slides\\pic."..count..".jpg ");
    Paragraph.SetText("output", "Now Showing Slide "..count.." of"..img_nbr);
    end
    end

    if e_Key == 37 then

    --Load and show the images
    for count = 1, img_nbr do
    Image.Load("SlideImage", "AutoPlay\\Images\\slides\\pic."..count..".jpg ");
    Paragraph.SetText("output", "Now Showing Slide "..count.." of"..img_nbr);
    end
    end

  4. #4
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Octane,
    WHat you should do is NOT use the "for" loop onkey. Instead, just increase/decrease the count index and load the relevant image/text in paragraph.
    Yossi

  5. #5
    Join Date
    Feb 2004
    Posts
    47
    Sorry to be a pain, but what would that look like? Is it just a simpler counter?

    Thanks

  6. #6
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Something like that, yes.
    You should use the actions:

    if e_Key == 39 then

    --Load and show the images
    count = count +1;
    Image.Load("SlideImage", "AutoPlay\\Images\\slides\\pic."..count..".jpg ");
    Paragraph.SetText("output", "Now Showing Slide "..count.." of"..img_nbr);


    Yossi

Similar Threads

  1. A tricky one... Help please
    By Jonas DK in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 11-25-2004, 04:48 PM
  2. Tricky Validation
    By koaless in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 09-20-2004, 12:13 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