Click here to Skip to main content
15,905,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
Am displaying the images in a SWF file, so here i want read the images from different xml files based upon the selection. So how to change the xml file name (value) in the given swf parameter value dynamically. How to read the data from different xml files into a single swf file, using C#/Javascript ???
Posted

1 solution

It depends on the actual swf gallery player. It depends how it is implemented. If the xml file name is fixed, you can only change it's content. Actually you can generate it dynamically. I suppose, you use ASP.NET. Here is an example, how to generate XML on server side: http://www.stardeveloper.com/articles/display.html?article=2009031901&page=1[^]. But you need to make the player reload the xml.
If the file name was provided to the object using a parameter, you can simply change this DOM attribute on client side. But this will be not enough, since these values are loaded by the flash player on initialization. So changing attribute will have no effect. So you either have to rebuild the object in DOM, or try using swfObject's "dynamic" loading method[^].
I suggest you consult the gallery player's documentation first to see what your possibilities are.
 
Share this answer
 
Comments
Rakesh Katanguri 21-Aug-12 2:08am    
Hi,
Thanks for the response. Here actually am generating the xml files while uploading the images into database using asp.net. So these xml files contains the image path and details. So here multiple xml files are generating, and i want to load those xml files based upon the user selection of the given categories. So how can i change the xml file name dynamically in the object parameter value.
Zoltán Zörgő 21-Aug-12 2:51am    
I understood your question already. But you did not read my answer attentively. But let's start here: is an swf made by you, or downloaded. In later case: where have you downloaded it, I would have a look at it's documentation.
Rakesh Katanguri 21-Aug-12 2:57am    
Hi,
Actually am planning to load the images in the 3D manner, and i've downloaded the swf file. Here is my code for swf file...

<object id="_slideshowBoxEmbed395170" type="application/x-shockwave-flash" data="templates/Wall3D.swf" width="900" height="700" style="padding-left:10px;">
<param name="movie" value="templates/Wall3D.swf">
<param name="allowFullScreen" value="true">
<param name="flashvars" value="source=sample.xml">

So in place of sample.xml file, i want to load the different files as per the user selection of photo albums.

Thanks...
Zoltán Zörgő 21-Aug-12 3:17am    
No, you still don't get me. "flashvars" are evaluated when the object is initiated. Changing it won't help! You have to delete the object from DOM, and rebuild it with the new xml in the parameter list.
This is it: http://www.slideshowbox.com/slideshow-templates-examples/wall-3d.html ?
Rakesh Katanguri 21-Aug-12 3:23am    
Thanks,
Yes from that link only, and I'l check with your steps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900