Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Simple flash banner

    Hi

    Total nub to HTML/CSS altho i have nmanaged to upload and configure my on-line shop and make a few amendments from simple mods with easy instructions.

    All I want to do is add 1 flash banner (.swf file) to the space in the topheader. I have read various posts/articles on doing this but tbh am still confused.

    The file I have will work in ie if I right-click and select open with ie it works! But I dont know how to add it to the correct section or page let alone code it if it needs coding?

    I want to add the file to the white space between the logo and the search/login box.

    homepage http://www.pcupgradeltd.co.uk

    Any help would be appreciated thanks

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    first read this page. http://blog.deconcept.com/swfobject/

    then putting it in woudl be something like:

    Code:
    		<div id="topHeader">
    			<div id="sessionBox">
    				<div style="padding: 15px 8px 15px 15px; margin: 0px;">
    				
    <form action="index.php" method="get" style="padding: 0px; margin: 0px;">
    <span class="txtSession"><strong>Search for:</strong></span><br /><input name="searchStr" type="text" class="searchBox" id="searchStr" value="" size="22" />
    		<input type="hidden" name="act" value="viewCat" />
    		<input name="Submit" type="submit" class="searchBtn" value="Go" />
    </form>
    
    				
    <div style="padding-top: 2px;">
    
    	<span class="txtSessionGrey">Welcome Guest</span> 
    	<br />
    	<span class="txtSession">[</span><a href="index.php?act=login&amp;redir=L2luZGV4LnBocA==" class="txtSession">Login</a> <span class="txtSession">|</span> <a href="cart.php?act=reg&amp;redir=L2luZGV4LnBocA==" class="txtSession">Register</a><span class="txtSession">]</span>
    
    
    
    </div>
    
    				</div>
    			</div>
    
    <div id="flashcontent" style="float:right;width:200px;height:100px;">
      This text is replaced by the Flash movie.
    </div>
    
    <script type="text/javascript">
       var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
       so.write("flashcontent");
    </script>
    
    		</div>
    of course changing the SWF name and the sizes to suit.

    if you float it like that it just needs to go after the div id="sessionBox" ends but before the div id="topHeader" does.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply but im still not sure where to put (is it just the red bits)the code, is it index.php? as mine has loads of includes down the page and I cant see any header details resembling your example :-s

    Sorry but did read the link too and none the wiser. I have uploaded the .swf file into a skins\backgrounds\images directory and have added the line into here;

    <div id="flashcontent" style="float:right;width:200px;height:100px;">
    This text is replaced by the Flash movie.
    </div>

    <script type="text/javascript">
    var so = new SWFObject("../styleImages/backgrounds/468x60_generic.swf", "mymovie", "200", "100", "7", "#336699");
    so.write("flashcontent");
    </script>

    but thats as far as ive got!

  • #4
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    well if your site in using a lot of includes, youre going to need to find the include that is the header (ie. has the #topHeader div in it). I cant see the files seperatly so that parts up up to you.

    Once in there, yep, include the red parts. You need to get the javascript as well in order for the flash object to work. Put the javascript in the include (assuming it's a include file) that has all your other javascripts in it. ex:
    Code:
    <link href="skins/Killer/styleSheets/layout.css" rel="stylesheet" type="text/css" />
    <link href="skins/Killer/styleSheets/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="js/jslibrary.js" type="text/javascript"></script>
    <script language="javascript" src="js/swfobject.js" type="text/javascript"></script>
    </head>
    then on the swf itself do something like:

    Code:
    <div id="flashcontent" style="float:right;width:468px;height:60px;"></div>
    <script type="text/javascript">
    var so = new SWFObject("../styleImages/backgrounds/468x60_generic.swf", "mymovie", "468", "60", "7", "#ffffff");
    so.write("flashcontent");
    </script>
    Im guessing 468x60 are the dimensions of your swf file. If it isnt, just change th esizes in both the div and the script.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #5
    New to the CF scene
    Join Date
    Oct 2006
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Right, added the code;

    <link href="skins/Killer/styleSheets/layout.css" rel="stylesheet" type="text/css" />
    <link href="skins/Killer/styleSheets/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="js/jslibrary.js" type="text/javascript"></script>
    <script language="javascript" src="js/swfobject.js" type="text/javascript"></script>
    </head>

    To index.php (should the paths be complete in the lines link href="skins/Killer/styleSheets/style.css" rel="stylesheet" ? ie ../skins etc

    Also added the code;

    <div id="flashcontent" style="float:right;width:200px;height:100px;">
    This text is replaced by the Flash movie.
    </div>

    <script type="text/javascript">
    var so = new SWFObject("../styleImages/backgrounds/468x60_generic.swf", "mymovie", "468", "60", "7",

    "#336699");
    so.write("flashcontent");
    </script>

    Into index.tpl file wher the topHeader Div was but its not working as you can see, just get the Text 'THis text is replaced by the flash movie' ?

  • #6
    New to the CF scene
    Join Date
    Oct 2006
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK got it working at last :-)

    Needed to download the swfObject.js file an upload it to the JS folder.

    Also the code in the post above
    <link href="skins/Killer/styleSheets/layout.css" rel="stylesheet" type="text/css" />
    <link href="skins/Killer/styleSheets/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="js/jslibrary.js" type="text/javascript"></script>
    <script language="javascript" src="js/swfobject.js" type="text/javascript"></script>
    </head>

    wasn't required as it was already in the index.tpl file where adding the .swf code.

    Just 1 thing now is how to centre it in the header?


  •  

    Posting Permissions

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