Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2005
    Posts
    2

    Help to show Pictures in an object

    Hi every body

    I want to use MediaPlayer to play some music.
    It's simple. But I want to show some pictures when a music playing.

    I use below code in MediaPlayer.play()
    Code:
    for count = 1, 10 do
    		Image.Load("obj1", "AutoPlay\\Images\\photos\\"..Math.Random(8, nil)..".jpg");
    		numLoopCount=0
    		repeat
    			numLoopCount = numLoopCount + 1;
    		until numLoopCount == 100000;
    end
    But until images changing, program is hanged & nothing work.

    Please help me
    Last edited by Abidar; 12-28-2005 at 12:31 AM.

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. Why not just create a video file using a program such as Photo Story, and then serve that in AMS?

  3. #3
    Join Date
    Dec 2005
    Posts
    2
    Very Thanks
    It's good idea.
    But I want to use pictures. because I can change pictures simply. but, if i use a movie I should create a new file when my pictures changed.

  4. #4
    Join Date
    Dec 2003
    Posts
    891
    First, name all the pic files in alphanumerical sequence with in the sequence you want to display them and put them in the Images folder (Frame1.jpg, Frame2.jpg, etc). Then note the length in time of the music file (or just loop it if you don't want a synchronized finish). Divide the music length in seconds by the number of image files (music is 360 seconds / 60 images = 6 seconds per image).
    Insert an image object where ever on the page. Insert the media player and have it load and play the music file on Page On Show, loop off. Also in Page On Show, add
    ---start frame
    nFrame = 1;
    ---length of time in milliseconds for each image to be shown for synchronization
    Page.StartTimer(6000)

    Add to On Timer
    ---use the number of images to show where to stop walking in this case 60 images
    if nFrame > 60 then
    else
    end
    Image.Load("Image1", "Autoplay\\Images\\Frame"..nFrame..".jpg")nFra me = nFrame + 1

    this will stop the slideshow at approximately the end of the music. you may have to adjust the numbers to get it exact.

    If you want to loop the the whole thing with synchro, them insert this in the On Timer event
    Add to On Timer
    ---use the number of images to show where to stop walking in this case 60 images
    if nFrame > 60 then
    nFrame = 1
    end
    Image.Load("Image1", "Autoplay\\Images\\Frame"..nFrame..".jpg")nFra me = nFrame + 1

  5. #5
    Join Date
    Dec 2003
    Posts
    891
    Quote Originally Posted by Roboblue
    Insert an image object where ever on the page.
    change this to:
    Insert an image object where ever on the page, and load the 1st image in the image object properties (frame1.jpg in this example).

    Also, the timer won't be exact. I find that adding 1 to the total images, then dividing song length gets it close. In this example, using 60 images, just divide the song length by 61. But keep the line
    if nFrame > 60 then as it is.

Similar Threads

  1. Hide object -Show object problem... bug??
    By Pupi in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 12-09-2002, 07:58 PM
  2. INFO: Difference between the Media Player Object and the AVI Object
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-29-2002, 02:15 PM
  3. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  4. Replies: 0
    Last Post: 10-04-2002, 10:09 AM
  5. Packages and If Statements
    By Medlir in forum Setup Factory 6.0
    Replies: 4
    Last Post: 05-09-2002, 03:51 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