<html>
<head>
<title>JavaScript. Позиционирование.</title>
<script language="JavaScript">
<!--
var gjapox=0;
var gjapoy=0;
var tekkoorx=0;
var tekkoory=0;
function japapilon(japox, japoy) {
gjapox=japox-50;
gjapoy=japoy-50;
tekst=gjapox+" "+gjapoy;
polet() }
function polet() {
if (gjapox<gjapoy) { if (tekkoory<gjapoy) {
tekkoory+=1;
tekkoorx=tekkoory*(gjapox/gjapoy);
tekkoorx=Math.round(tekkoorx);
}
else {
getFlashMovieObject('movie').SetVariable('/:ANY_VAR', 'Заработало :)');
}}
if (gjapox>gjapoy) { if (tekkoorx<gjapox) {
tekkoorx+=1;
tekkoory=tekkoorx*(gjapoy/gjapox);
tekkoory=Math.round(tekkoory);
}
else {
getFlashMovieObject('movie').SetVariable('/:ANY_VAR', 'Заработало :)');
}}
tekstt=tekkoorx+" "+tekkoory+"/"+tekst;
document.getElementById('bibon').value = tekstt;
if (navigator.appName == "Netscape")
{ document.move.left = tekkoorx +'px'
document.move.top = tekkoory +'px' }
else { document.all.move.style.left= tekkoorx +'px'
document.all.move.style.top = tekkoory +'px' }
setTimeout(arguments.callee, 2);
}
function getFlashMovieObject(movieName)
{
if (window.document[movieName])
{
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}
-->
</script>
</head>
<body>
<div id="move" style="position:absolute; left:0px; top:0px; width:100px; height: 100;">
<p>
<object id="movie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100" height="100" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="primer.swf" />
<param name="FlashVars" value="maxkoor=150">
<param name="quality" value="high" />
<embed src="primer.swf" name="movie" quality="high" FlashVars="maxkoor=150" width="100" height="100" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</p>
</div>
<form name="form1" method="post" action="">
<textarea name="bibon" id="bibon"></textarea>
</form>
</body>
</html> |