Dynamic Slide show using flash player with xml
This article explained about creating a dynamic slide show using flash. There are many slide show controls are available. Here i made a sample slide show using flash player with xml.
This article explained about creating a dynamic slide show using flash. There are many slide show controls are available. Here i made a sample slide show using flash player with xml.
Today most of the flash player inputs are accessing through xml. Because we can get large amount of datas from that xml file rather than passing as a parameter. I designed the slide show player using "Anvsoft Flash slide show" software. Based on requirements modified some of the codes in flash files.
Just put the "div" to your aspx page and add the embed object tag dynamically using javascript. Use the following javascript code for creating the embed tag and assign to that "div". Refer the following code,
function Change(ctrl)
{
var Albumid=ctrl.value;
var PlayerDetails='';
PlayerDetails=PlayerDetails +"object classid='clsid:D27CDB6E-AE6D-11cf-96B8-
444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='450' height='400'";
PlayerDetails=PlayerDetails +"param name='movie' value='SlideShowPlayer.swf?
xml_path=SlideShowDetails.aspx?FromPage="+ Albumid+"' /";
PlayerDetails = PlayerDetails + "param name='quality' value='high' /";
PlayerDetails = PlayerDetails + "param name='BGCOLOR' value='#EDEBEA' /";
PlayerDetails = PlayerDetails + "embed src='SlideShowPlayer.swf?
xml_path=SlideShowDetails.aspx?FromPage=" + Albumid + "' quality='high'
pluginspage='http://www.adobe.com/shockwave/download/download.cgi?
P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='450' height='400' bgcolor='#EDEBEA'";
PlayerDetails=PlayerDetails +"/embed /object";
document.getElementById('divSlideShow').innerHTML=PlayerDetails;
}
Here i cannot post the html tag please make the proper html tag for above code
Here "divSlideShow" is id of that div tag, which is designed in your aspx page and Slideshowdetails.aspx is another aspx page for generating the xml datas dynamically. If your application is used only for single user then you can directly assign or create a xml file and give the file path.
For example, I want to assign a xml file directly, then assing the following value,
'SlideShowPlayer.swf?xml_path=Flash/Slides.xml'
"Slides.xml" is the xml file name, that resides under "Flash" folder.
Call the javascript function when the album drop down control selection is changed.
Refer the following codes,
asp:DropDownList ID="ddlSelection" runat="server" onchange="javascript: return Change(this);"'
'asp:ListItem Text="--Select--" Value="0" Selected="True">'asp:ListItem Text="Album1" Value="Album1">'asp:ListItem Text="Album2" Value="Album2">'/asp:DropDownList'
Whenever the dropdown value is changed then the javascript function is called and update the flash player through the SlideShowDetails.aspx page.
In your SlideShowDetails.aspx page, we generate the xml data with the details that are retrieved from atabase or any other source. In this example temporarily used the dataset.XML Parameter and Details:
copyright='http://www.vmdamodharan.co.cc'
(Must use same copyright otherwise flash player won't work)
jpegURL = 'your image url' (Used for Thumbnail images)
d_URL='Image url' (Used for displaying center slide images)
url = 'Image url'
(Used for show the original images while click on the slide images)
title = 'Image name or name'
(Used for displaying the image name or title to top of the player)
width = 'Width of your original images'
height = 'Height of your original images'
(Used for displaying the slide image position calculation)
startAutoPlay='true/false'
(Slide show player plays automatically if it is true)
continuum='true/false'
(If it is true play continously after end)
enableURL = 'true/false'
(If it is true, while click on the slide image it opens to new window otherwise not open)
and all other properties are related to styles.
Visit the link for live demo,
http://aspspider.ws/damuaspspider/SlideShowPlayer/ViewPlayer.aspx
If you have any trouble on implment to your application post your problems.
Please download the sample application and post your feedbacks.