Hi, I need to update a php file and replace an image with a flash .swf file. I've replaced it with the <img src="/img/ad.swf" class="flash_box">, but now I realize it wont work because of the img src. So how do I embed the swf file? Many thanks ps- I just realised I wrote in the tile flash video, which I actually will need to do as well.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="32" height="32"> <param name="movie" value="URL TO FLASH FILE"> <param name="quality" value="high"> <embed src="URL TO FLASH FILE" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="32" height="32"></embed> </object> PHP: is that what you need?
Sorry yes, I'm not a coder, but I would rather ask and learn something. I wasn't sure if I should put it under php or html. Thanks for code posted. It works fine, apart from the positioning, but I'll figure it out and I actual found that w3schools.com/flash/flash_inhtml.asp a second after I posted this thread.
No need to apologize. There's nothing wrong with that. Sorry if we made it sound like you shouldn't ask.
1. This is not php related. It's XHTML thing 2. Yes, this is some way to embed the swf in xhtml, but there are few problems with such code: it's messy, looks very complicated, and the embed element was never in XHTML specification, so you will never pass W3C (or any other validation). So this is ok if you don't need valid XHTML. 3. If you want valid XHTML and streaming that works in all browsers you need to use the code: <object type="application/x-shockwave-flash data="c.swf?path=movie.swf" width="400" height="300"> <param name="movie" value="c.swf?path=movie.swf" /> <img src="noflash.gif" width="200" height="100" alt="" /> </object> HTML: Where c.swf is a container movie which loads yours movie (this is a necessary hack to get the streaming work in IE/Windows). You do an empty movie, and in the first frame put the line: _root.loadMovie(_root.path,0); Code (markup): . This movie loads a movie that is set in path variable, and path variable is set in your XHTML here: data="c.swf?path=movie.swf" Code (markup): Now, img element is an alternative content, for the browsers that can't display flash. Maybe it looks a bit complicated, but IMHO, this is a clean way to get flash embedded and still have valid XHTML. The method is called Flash Satay, and there is a good article about it here: http://www.alistapart.com/articles/flashsatay, if you need to know more details. Good luck!