Flash video to replace img scr in php file

Discussion in 'PHP' started by funnygirl, Feb 3, 2008.

  1. #1
    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.
     
    funnygirl, Feb 3, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Feb 3, 2008 IP
  3. archgames.net

    archgames.net Well-Known Member

    Messages:
    532
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #3
    <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?
     
    archgames.net, Feb 3, 2008 IP
  4. promanz

    promanz Banned

    Messages:
    559
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <img src="/img/ad.swf" class="flash_box"> isn't working manzz try to put this archgames.net code
     
    promanz, Feb 3, 2008 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    I bet she would have never thought of trying that.
     
    nico_swd, Feb 3, 2008 IP
  6. funnygirl

    funnygirl Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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.
     
    funnygirl, Feb 3, 2008 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    No need to apologize. There's nothing wrong with that. :) Sorry if we made it sound like you shouldn't ask.
     
    nico_swd, Feb 3, 2008 IP
  8. funnygirl

    funnygirl Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yeah it kind of did, but that's ok :) No probs.

    Thanks
     
    funnygirl, Feb 3, 2008 IP
  9. e_anka

    e_anka Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    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!
     
    e_anka, Feb 3, 2008 IP
  10. funnygirl

    funnygirl Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thanks e_anka, I will have a look at it :)
     
    funnygirl, Feb 3, 2008 IP