1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

change color

Discussion in 'CSS' started by dommelsch-voske, Apr 18, 2005.

  1. #1
    I have made a site using HTML and CSS with a .swf banner (made in Flash). The point is that the banner is designed for a green site and I have added a colorchanger into the page. The colorchanger activates an alternate CSS script wich results in a change of color from green to grey or blue. The point is that I've made the banner in blue and grey but I don't know how to change the color of the banner with the same action.

    The scripts:

    
    Head: //defines that there are more stylesheets (CSS) 
    
    <head> 
    <link rel="stylesheet" type="text/css" href="css/green.css" title"green" /> 
    <link rel="alternate stylesheet" type="text/css" href="css/blue.css" title="blue" /> 
    <link rel="alternate stylesheet" type="text/css" href="css/silver.css" title="silver" /> 
    <link rel="alternate stylesheet" type="text/css" href="css/red.css" title="red" /> 
    </head> 
    
    Body: //defines the buttons that can change the style (and color) 
    
    <a><img src="images/style_changer.jpg" alt="style_changer" border="0" width="160" height="38" usemap="#style_changer"></a> 
    <map id="style_changer" name="style_changer"> 
    <area shape="rect" 
    coords="3,3,38,32" 
    alt="green" 
    href="#" title="green style" onclick="setActiveStyleSheet('green',1); return false;"><title="green style" alt="green style" /></a> 
    
    <area shape="rect" 
    coords="42,3,78,32" 
    alt="blue" 
    href="#" title="blue style" onclick="setActiveStyleSheet('blue',1); return false;"><title="blue style" alt="blue style" /></a> 
    
    <area shape="rect" 
    coords="82,3,116,32" 
    alt="silver" 
    href="#" title="silver style" onclick="setActiveStyleSheet('silver',1); return false;"><title="silver style" alt="silver style" /></a> 
    
    <area shape="rect" 
    coords="121,3,156,32" 
    alt="red" 
    href="#" title="red style" onclick="setActiveStyleSheet('red',1); return false;"><title="red style" alt="red style" /></a> 
    </td> 
    </tr> 
    </table> 
    
    The banner: 
    //made in green, the other banners are named blue.swf red.swf and silver.swf 
    
    
    <body> 
    <<table class="midden" width="1024" border="0" cellspacing="0" cellpadding="0" align="center"> 
    <tr> 
    <td><!--url's used in the movie--> 
    <!--text used in the movie--> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1024" height="141"> 
    <param name="movie" value="javascript/green.swf"> 
    <param name="quality" value="high"> 
    <embed src="javascript/green.swf quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="702" height="141"></embed> 
    </object></td> 
    
    Code (markup):
    Can anyone help me to solve this problem (maybe with java ??)
    Answers in Dutch or English please

    The site: www.dse.nl/~stefanvanleuven

    Greetz, Stefan
     
    dommelsch-voske, Apr 18, 2005 IP
  2. fiftybyfifty

    fiftybyfifty Peon

    Messages:
    2
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It looks like you're using a javascript function to change the stylesheet. You could add a line to that function that changed the link to the swf in a similar way - without seeing the javascript I can't say for sure.. but with a bit of perserverance I bet you'll figure it out.
     
    fiftybyfifty, Apr 20, 2005 IP