C
crmpicco
Code:
function animateText(id,iStart,iCurrent,iDir)
{
var obj = document.getElementById(id);
if(typeof(iStart)=="undefined")
{
iStart = 0;
iCurrent = iStart;
iDir = +2; // Increasing Value also increases speed
}
if(iDir > 0 && iCurrent > obj.parentNode.offsetHeight)
{
/*
obj.innerHTML = "<img border='0' src='/v2/asp/images/picco.gif'
style='visibility: hidden' />";
obj.innerHTML = obj.innerHTML + "empowered by Picco ©";
*/
obj.innerHTML = "<OBJECT
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'
WIDTH='200' HEIGHT='100' id='picco'><EMBED src='picco.swf'
bgcolor='#333399' WIDTH='200' HEIGHT='100' NAME='volaro'
TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>";
//obj.innerHTML = "<img border='0' src='picco.swf' />";
iDir = -2; // Increasing Value also increases speed (must match
the speed above)
}
iCurrent += iDir;
obj.style.top = iCurrent + "px";
var iSpeed = 15; // The Speed at which the image scrolls down and the
text scrolls up (smaller = faster)
if(iCurrent!=iStart)
{
window.setTimeout(function() { animateText(id, iStart, iCurrent,
iDir) }, iSpeed);
}
}
// If the Client's browser is MSIE then proceed with the functions to
show/hide image
if (browser.isIE)
{
window.onload = function()
{
var iWait = 1000; // How many seconds to wait after page loads to
hide the image
window.setTimeout(function() { animateText('scrollHead') }, iWait);
return true;
};
}
I am trying to load this 'object' which is a flash file (picco.swf)
from my javascript into a <td> cell using innerHTML. Is this possible,
as it does not seem to work at the moment.
The code in question is:
Code:
obj.innerHTML = "<OBJECT
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'
WIDTH='200' HEIGHT='100' id='picco'><EMBED src='picco.swf'
bgcolor='#333399' WIDTH='200' HEIGHT='100' NAME='volaro'
TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>";
This code works, when coded into the cell, but I am looking to have it
appear from below and gradually go to the top as it did previously with
the text 'empowered by Picco'.....
Code:
<td align="right" valign="top">
<div style="position: relative; z-index: -20;">
<span id="scrollHead" class="div_Header_Pos">
<OBJECT
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="200" HEIGHT="100" id="volaro">
<EMBED src="volaro.swf" bgcolor=#333399 WIDTH="200" HEIGHT="100"
NAME="volaro" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</span>
</div>
</td>