# Help with SWF loading behavior



## neljan (Feb 9, 2008)

Hello guys

I've been trying for 4 days, posted in 5-6 different forums & still no solution to my problem.

I have an SWF slideshow, around 2mb in size, which I created using AnvSoft flash Slideshow maker that I would like to use on MySpace (I can here the groan's now & half of you have closed this thread).

The slideshow works, however, it seriously slows down my page loading to around 2 minutes - which is an eternity when staring at a blank screen.

All I am trying to do is have the page load, then have the player load the SWF file within the page, like you see on many flash sites with a loading animation.

For what it's worth, here's the HTML code I'm using in MySpace:





Is there a way I can implement an xml playlist to play a single swf file? I don't want anything fancy, no controls - just images. I've downloaded several flash players that you upload to a file host along with an xml playlist like this one and this one but got a big fat 0.

I really am stumped. Please don't recommend me to use something like slide.com or any of the other thousand online advertisement happy slideshows as they are limited in transitions & number of images & filled with logos & links to their site.

Thanks to anyone who at least read all of this...

I wait in hopeful anticipation


----------



## Sequal7 (Apr 15, 2001)

Try to put the object tag (<object type="application/x-shockwave-flash" etc.....) containing the .swf file inside a div.

Name the div "xmlFlash" for arguments sake. 
Comment out the object tag as follows:

```
[b]<div id="xmlFlash"><!--[/b]<object type="application/x-shockwave-flash" ...</object>[b]--></div>[/b]

Next: add to the body tag <body [b]onLoad="javascript:reWriteFlash();[/b]" ...
then place this code in the area the page where you want the flash to show[code]
<script language="javascript" type="text/javascript">
function reWriteFlash(){

var myHTML = document.getElementById("xmlFlash").innerHTML;

myHTML = myHTML.replace("<!--","");

myHTML = myHTML.replace("-->","");

document.getElementById("xmlFlash").innerHTML = myHTML;

}
</script>
```
What this does is on the event "onLoad" (once all HTML is loaded), comments out the object tag and, hence, starts rendering the object and loads the flash file. If you wish to pre-load your images you can do that too, just make sure the preloading function is called before the one above.

CAUTION: reWriteFlash() removes all comment tags inside the div. Make sure there is nothing else in that div that needs to be un-comented otherwise the browser will pick it up and render it.


----------



## neljan (Feb 9, 2008)

Hello Sequal7

Thanks very much for your time

Unfortunately, MySpace doesn't allow Javascript 

Photobucket has a slideshow which behaves in the way I want, but is limited & advertised. It uses this code in MySpace which includes the div tags:

If it's any help?

I really appreciate your help, been at this now for 5 days!!!


----------



## Sequal7 (Apr 15, 2001)

Oh crap.....

Ok, can you preload the images in flash using actionscripting..I mean, does the flash slideshow maker give a .fla file or is it just a .swf file???

Also, do you want the image to display like a slideshow or the user has to click them?


----------



## neljan (Feb 9, 2008)

Sequal7 said:


> Oh crap.....


lol

It's just an SWF file. I did manage to convert it into an FLV file using a screen capture then converting the AVI into FLV, but the quality is poor.


----------



## neljan (Feb 9, 2008)

Sorry, just noticed you said FLA not FLV.

No there's no FLA.


----------



## Sequal7 (Apr 15, 2001)

Hey, have you tried http://www.flash.aliseya.com/, it is a simple flash image viewer using xml. 
You can download the source files here:
http://www.flash.aliseya.com/download.php?id=19827164


----------



## neljan (Feb 9, 2008)

Hi there

Sorry, I didn't like that one, but thanks anyway.

I did find one that included the scource/FLA file:

http://www.jeroenwijering.com/?item=JW_FLV_Player

But it seems a little advanced, I wouldn't know where to begin...


----------



## neljan (Feb 9, 2008)

Ok, I'm now trying to use the player from the site I posted above (jeroenwijering).

I uploaded the SWF player to a host along with an xml playlist written as:

<?xml version='1.0' encoding='UTF-8'?>
<playlist version='1' xmlns='http://xspf.org/ns/0/'>
<trackList>

<creator>Creator</creator>
Title
<location>http://www.link_to_my_video.swf</location>

</trackList>
</playlist>

But all I see is a blank white box. The HTML code I'm using is:

If I leave out the xml link I see the player with a loading animation

Any ideas?


----------



## neljan (Feb 9, 2008)

Sequal7, I finally found a suitable flash slideshow player which doesn't take years to load.

Thanks for all your help mate, I owe you one!

Keep up the good work

*karma*


----------



## Sequal7 (Apr 15, 2001)

Good news, which one was it?


----------

