How do I... ?
AnswerList of Questions
Make a Slideshow with Audio
Tip: AutoPlay Media Studio 8 now contains a SlideShow object that can also be used for this functionality.
As an example, we will create a slideshow with voiceovers for each image. This project will require one audio file for every image, and one page in your project for every image that you want to display. On each page, create one image object which loads the desired image.
1. Create one page in your project for every image file you wish to display. In this example, we will have three images, and three audio files.
2. On each page in your project, create an image object which loads the desired image.
3. Create global variables:
-- will keep track of the audio files audio_count = 1;
--loads desired audio files into a table audio = { "Autoplay\\Audio\\audio_file1.ogg", "Autoplay\\Audio\\audio_file2.ogg", "Autoplay\\Audio\\audio_file3.ogg"
};
4. Create the following action in the On Show event of every page:
Audio.Load(CHANNEL_USER1, audio[audio_count], true, false);
5. Create the following script in the On Audio event of every page (except your last page):
Input.SetText("Input1", e_State); if e_State == "Finish" then
audio_count = audio_count + 1; Page.Navigate(PAGE_NEXT);
end
Note: When run, this application will load the first page and play the audio file. When that audio file is complete, the application will jump to the next page, and launch the audio file. This continues until the last page. Each image is displayed for the length of the audio file.
Tip: If you want to have background music playing in your application, insert the following code into the first page's On Show event (you will load the background music into a different channel than the voiceovers are being loaded into):
Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\background.ogg, true, true);
Audio.SetVolume(CHANNEL_BACKGROUND, (255 * 0.25)); --sets the volume to 25%
How do I... ?
AnswerList of Questions
Make a Thumbnail Image Browser
The idea behind a thumbnail image is to present the user with a small image that when clicked links to a larger image. To accomplish this in AutoPlay Media Studio, create an image object with the image you wish to use for the thumbnail, and resize it to the desired dimensions. Now create an action that links to the larger image when the thumbnail is clicked.
Here are two examples illustrating how to complete this task:
Example 1
1. Create a project with two pages. On the first page (Page1) will be your thumbnail, on your second page (Page2) will be your large image.
2. On each page in your project, create an image object which loads the desired image.
3. Create an action in your thumbnail image's On Click event that will jump to the second page of your project (containing the large image):
Page.Jump("Page2");
3. On your second page, you may wish to include a back button that jumps back to the first page.
Use the following action for this button's On Click event:
Page.Jump("Page1");
Note: If you wish to have more than one thumbnail, create a new page for every image, and then add their thumbnails to the first page. Then add actions to open each page when the appropriate thumbnail is clicked.
Example 2
1. Create a project with one page.
2. Create two image objects on this page: Image1 and Image2. Image1 will be your thumbnail image, Image2 will be your large image. Size the two images accordingly.
3. Set the visible property of Image2 to false.
4. Create an On Click action for Image1 that shows Image2 when clicked:
Image.SetVisible("Image2", true);
5. Create an action for Image2 that hides it when it is clicked (use the On Click event):
Image.SetVisible("Image2", false);
How do I... ?
AnswerList of Questions
Make an Image Browser
As an example, we will create an application that has the user select a folder on his drive, and then populates a listbox object with all of the *.png and *.jpg files within that directory. The user clicks on a file in the listbox object, and clicks the "Open" button to load the selected image into the image object.
1. Create a project with two button objects, a listbox object, and an image object.
2. Label Button1 "Load" and Button2 "Open".
3. Insert the following code into the On Click event for Button1:
--Disable listbox Updating ListBox.SetUpdate("ListBox1", false);
--Get the desired folder to browse
folder = Dialog.FolderBrowse("Open Folder", "C:\\");
--populate tables with all the .jpg and .png files file_jpg = File.Find(folder, "*.jpg", false, false, nil); file_png = File.Find(folder, "*.png", false, false, nil);
images = {file_jpg, file_png};
--do the following for each file:
for k in pairs(images) do --loops through the different image types for j,file_path in pairs(images[k]) do --loops through each
image file
--add the item to the listbox, with the name visible and path as data
ListBox.AddItem("ListBox1", String.SplitPath(file_path).Filename, file_path);
end
end
--Allow the listbox to display the updated content ListBox.SetUpdate("ListBox1", true);
4. Insert the following code into the On Click event for Button2:
selected = ListBox.GetSelected("ListBox1"); for j,k in pairs(selected) do
Image.Load("Image1", ListBox.GetItemData("ListBox1", k));
end
How do I... ?
AnswerList of Questions
Make an Image Semi-Transparent
In AutoPlay Media Studio, it is possible to make an image object translucent, or "see-through." This is accomplished by lowering the value of the Opacity setting in the properties pane:
1. Create an image object
2. In the properties pane, change the Opacity setting to the desired opacity.
Note: The opacity number is a percentage. A value of 100 makes the object fully visible, and a value of 0 makes the object invisible.