Onmouseover + display flash or java in a table column

Discussion in 'Programming' started by Dbaseivom, Oct 20, 2007.

  1. #1
    Hi!

    I´m trying to design my site so that if I move the mousepointer over different images, two things will happen.

    1. The image changes, that´s a piece of cake, so no problem with that.
    2. At the same time I want a certain javascript of flashscript to load in a table column which I´ve given an ID <h1 id="TitleText"></h1> (don´t know if this is the right way to do it though...)

    I´ve experimented a bit with this code, but so far with no success...

    The javascript looks like this:
    -------------------------------------------------------------------------------
    <script language="JavaScript">
    <!--
    // PRELOADING IMAGES
    if (document.images) {
    img0_on =new Image(); img0_on.src ="/images/image2.gif";
    img0_off=new Image(); img0_off.src="/images/image1.gif";

    img1_on =new Image(); img0_on.src "/images/anotherimage2.gif";
    img1_off=new Image(); img0_off.src="/images/anotherimage1.gif";
    }

    function movr(k) {
    if (document.images)
    eval('document.img'+k+'.src=img'+k+'_on.src');
    }

    function mout(k) {
    if (document.images)
    eval('document.img'+k+'.src=img'+k+'_off.src');
    }
    -------------------------------------------------------------------------------

    And the code in the HTML looks like this:
    -------------------------------------------------------------------------------
    <a href="#any_URL" onMouseOver="movr(0);java script:document.getElementById('TitleText').innerHTML='Something will happen here';return true;" onMouseOut="mout(0);java script:document.getElementById('TitleText').innerHTML='This is the main info I want to display';return true;" onClick="return false;">
    <img name=img0 width=153 height=18 border=0 alt="This image changes when you point at it!" src="/images/image1.gif" width="153" height="18" border="0" alt=""></a>
    -------------------------------------------------------------------------------

    This script works if I only want to display plain text, but how am I suppose to do if I want to display for example a news scroller on a flash script??

    Any help is appreciated!


    PS. I tried to put this code:
    -------------------------------------------------------------------------------
    <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='400' height='160'>
    <!-- www.Vevs.com Flash news scroller -->
    <param name='movie' value='vevscroll.swf?NewsFile=webnews472343.inf&ddd=1'>
    <param name='quality' value='high'>
    <param name='scale' value='noscale'>
    <param name='salign' value='lt'>
    <param name='bgcolor' value='#ffffff'>
    <embed src='vevscroll.swf?NewsFile=webnews472343.inf&ddd=1' quality='high' scale='noscale' salign='lt' bgcolor='#ffffff' width='400' height='160' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>
    </object>
    -------------------------------------------------------------------------------

    within ...innerHTML='Something will happen here'...

    But it obviously don´t work... :(
     
    Dbaseivom, Oct 20, 2007 IP