SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    flash in css div not loaded?

    hey all,
    i never used flash in css. so i went through some tutorials on web about inserting flash in css but i am having a problem. the page doesn't load flash movie. my flash movie is in file in flash.html which i m trying to include using php include in the div which i created. why isn't it loading. pls help. here is my code
    Code PHP:
    <div class="flashmov">
    <?php include ("flash/flash.html")?>
    </div>
    Code CSS:
    .flashmov{width:800px; height:200px; background-color:#333;}
    Code HTML4Strict:
    <object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
    codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0
    width=800
    height=200>
    <param name=movie value=smooth.swf>
    <param name=quality value=high>
    <param name=BGCOLOR value=#FFFFFF>
    <param name=SCALE value=noborder>
    <embed src=smooth.swf
    quality=high
    pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash
    width=800
    height=200
    bgcolor=#FFFFFF
    scale= noborder>
    </embed>
    </object>
    when i see the file flash.html by loading it in browser, it works fine
    All those who wander aren't lost.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    The first thing to check is the path to the include file:

    <?php include ("flash/flash.html")?>

    This will look for a folder called /flash/ at the same level as the page, which is probably not where the flash folder is located.

    Where is the flash folder located in relation to the page?
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    flash.html is in flash folder and all pages like index are on root
    All those who wander aren't lost.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    OK, so that path is right.

    In the object code, you have things like this:

    src=smooth.swf

    Once that code has been placed on aonther page, that path is no longer correct. It would need to be

    src=flash/smooth.swf

    So you'll have to change those paths too.

    Why are you doing this as an include? If you want to place the same code on various pages, you will have to use a different path system.

    I would do this:

    src=/flash/smooth.swf
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  5. #5
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    doing include coz its repeating in every page so make the code tidy i have made an include
    All those who wander aren't lost.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    doing include coz its repeating in every page so make the code tidy i have made an include
    In that case, I would change your code to this:

    Code:
    <object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
    codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,2,0
    width=800
    height=200>
    <param name=movie value="/flash/smooth.swf">
    <param name=quality value=high>
    <param name=BGCOLOR value=#FFFFFF>
    <param name=SCALE value=noborder>
    <embed src="/flash/smooth.swf"
    quality=high
    pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash
    width=800
    height=200
    bgcolor=#FFFFFF
    scale= noborder>
    </embed>
    </object>
    Then, whenever you want to include that code on a page, use this:

    Code:
    <div class="flashmov">
    <?php include $_SERVER["DOCUMENT_ROOT"] . "/flash/flash.html"; ?>
    </div>
    Last edited by ralph.m; Apr 11, 2010 at 18:34. Reason: typo
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •