...

View Full Version : How to refresh contents loaded in .swf file in web page?



nestenius
03-27-2009, 07:11 AM
I've a flash file which takes the input (such as songs path and picture path) from xml file and plays music and shows slide show in a flash banner. But the songs and pictures are not being refreshed even if I modify, add or delete the path.Even if i clear the browser cache, it doesn't work.
There are couple of problems which i'm facing right now:
1. The flash file loads the content, plays music and slide shows (means works fine) when I play the .fla file from Adobe Flash CS3 Professional. However, it doesn't update anything when I embed .swf file to my aspx page and run in the localhost.
2. The same .swf file runs fine when I run it independently ( without embedding to .aspx file)

I'm currently running the project on IIS7 in Vista. The mime types .swf and .flv are already there.

Here's the XML file snippet:
<maindata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SlideShow>
<Slide>
<Image>/Flash_Data/ArtistImages/Jake_ooOh.jpg</Image>
<Body>Den 11 oktober gästar festivalen Fryshusets två scener i Stockholm. Biljetterna finns ute nu. </Body>
<Link />
<Heading1 isactive="Yes">Rockstar Taste Of Chaos_Jan</Heading1>
</Slide>
</SlideShow>
<Songs>
<Song>
<SongID>5</SongID>
<ArtistImage>/Flash_Data/ArtistImages/Freja_32.jpg</ArtistImage>
<ArtistName>Freja</ArtistName>
<Mp3>/Flash_Data/Songs/It's_My_Radio_MASTER081209.mp3</Mp3>
<TotalUsers>0</TotalUsers>
<TotalStars>0</TotalStars>
<Rating>5</Rating>
<Plays>632</Plays>
<SongName isactive="Yes">Its My Radio</SongName>
</Song>
</Songs>
</maindata>

And here's how i embed the flash file to .aspx page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head id="Head1" runat="server">
<script language="javascript" type="text/javascript" src="javascripts/swfobject.js" ></script>
</head>
<body id="master_body" runat="server">
<form id="form1" runat="server">
<div id="banner1" class="banner">
<noscript>
<img src='Images/FiketBanner.jpg' alt='Flash Banner' />
</noscript>
</div>
<script language="javascript" type="text/javascript">
var so = new SWFObject("Images/fiket.swf", "mymovie", "1171", "289", "8", "#336699");
so.addParam("wmode", "transparent");
so.addVariable("xmlfile", "http://localhost/MyProject/Xml/MainFile.xml");
so.addVariable("reporturl", "http://localhost/MyProject/FlashData//Reportdata.aspx");
so.write("banner1");
</script>
</form>
</body>
</html>

gnomeontherun
03-27-2009, 09:29 AM
I bet it has to do with improper linking, can you trace that the correct filenames that are generated by Flash?

Also try putting the full URL in the xml to be 100% sure.

nestenius
03-27-2009, 10:21 AM
I bet it has to do with improper linking, can you trace that the correct filenames that are generated by Flash?

Also try putting the full URL in the xml to be 100% sure.

-The links can be accessed easily so there're no improper linking.What is full URL?? Do you want me to use the physical url instead??

shara321
05-11-2009, 04:38 AM
nestenius

I am also facing the same problem. I am reading the contents of an xml file and updating the flash according to that. But the when I embed this flash file into an aspx page the flash contents are not getting updated even though the xml file is being updated. I have tried clearing the cache but still the problem exists:confused:. Can you please help me if you have found a solution to this problem?

Thanks,
shara321

gnomeontherun
05-11-2009, 08:30 AM
Well so far without any actionscript code I can't really help. There are a lot of potential problems with it, and my suggestion is to make sure 1) that the file names are loaded by tracing them after load and then 2) making sure an update function is being called.

If you can post more information I might be able to be more helpful.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum