ASP ScriptingJava ScriptingCGI ScriptingHTMLJavaLanguage CERP Education Links

JAVA SCRIPTING

Flying Image

<body onLoad="MM_timelinePlay('Timeline1')">Three Parts To This Script
 
==================================================
Part 1
==================================================

<script language="JavaScript">

<!--

function MM_controlSound(sndAction,_sndObj) { //v2.0

var sndObj = eval( _sndObj );

if (sndObj != null) {

if (sndAction=='stop') {

sndObj.stop();

} else {

if (navigator.appName == 'Netscape' ) {

sndObj.play();

} else {

if (document.MM_WMP_DETECTED == null) {

document.MM_WMP_DETECTED = false;

var i;

for( i in sndObj )

if ( i == "ActiveMovie" ) {

document.MM_WMP_DETECTED = true;

break; }

}

if (document.MM_WMP_DETECTED)

sndObj.play();

else if ( sndObj.FileName )

sndObj.run();

}}}}

function MM_timelinePlay(tmLnName, myID) { //v1.2

//Copyright 1997 Macromedia, Inc. All rights reserved.

var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;

if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time

tmLn = document.MM_Time[tmLnName];

if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID

if (myID == tmLn.ID) { //if Im newest

setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);

fNew = ++tmLn.curFrame;

for (i=0; i<tmLn.length; i++) {

sprite = tmLn[i];

if (sprite.charAt(0) == 's') {

if (sprite.obj) {

numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];

if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range

keyFrm=1;

for (j=0; j<sprite.values.length; j++) {

props = sprite.values[j];

if (numKeyFr != props.length) {

if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];

else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];

} else {

while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;

if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {

if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];

else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];

} } } } }

} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);

if (fNew > tmLn.lastFrame) tmLn.ID = 0;

} }

}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0

//Copyright 1997 Macromedia, Inc. All rights reserved.

var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;

if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time

tmLn = document.MM_Time[tmLnName];

if (numGotos != null)

if (tmLn.gotoCount == null) tmLn.gotoCount = 1;

else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}

jmpFwd = (fNew > tmLn.curFrame);

for (i = 0; i < tmLn.length; i++) {

sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back

if (sprite.charAt(0) == "s") {

numKeyFr = sprite.keyFrames.length;

firstKeyFr = sprite.keyFrames[0];

lastKeyFr = sprite.keyFrames[numKeyFr - 1];

if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd

for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);

for (j=0; j<sprite.values.length; j++) {

props = sprite.values[j];

if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only

else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1);

if (sprite.obj != null) {

if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];

else sprite.obj[props.prop2][props.prop] = props[propNum];

} }

} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);

}

tmLn.curFrame = fNew;

if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');

}

function MM_initTimelines() {

//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.

var ns = navigator.appName == "Netscape";

document.MM_Time = new Array(1);

document.MM_Time[0] = new Array(2);

document.MM_Time["Timeline1"] = document.MM_Time[0];

document.MM_Time[0].MM_Name = "Timeline1";

document.MM_Time[0].fps = 15;

document.MM_Time[0][0] = new String("sprite");

document.MM_Time[0][0].slot = 1;

if (ns)

document.MM_Time[0][0].obj = document["Layer1"];

else

document.MM_Time[0][0].obj = document.all ? document.all["Layer1"] : null;

document.MM_Time[0][0].keyFrames = new Array(1, 9, 19, 33, 47, 61, 79, 95, 110,130);

document.MM_Time[0][0].values = new Array(2);

document.MM_Time[0][0].values[0] = new Array(573,560,591,610,599,584,533,481, 431,394,359,327,296,267,238,209,179,147,115,102,96,95,96,98,101,105,109,114, 119, 125,131,137,144,151,160,170,180,189,199,208,218,228,238,249,260,271,277,271,262, 253,243,232,221,210,198,187,176,165,155,146,143,154,167,179,190,202,214,225,236, 248,259,271,282,294,306,318,331,344,355,356,353,348,342,335,328,321,314,306,299, 291,283,275,268,261,260,274,286,297,308,319,331,343,355,368,383,398,415,434,455, 479,498,517,536,555,535,510,469,429,385,350,325,275,300,340,380,420,450,480,520, 573);

document.MM_Time[0][0].values[0].prop = "left";

document.MM_Time[0][0].values[1] = newArray(24,42,61,80,98,114,128,138,143,139,129,116,101,85,69,53,38,27,32,55,82, 109,137,164,192,219,246,271,295,317,339,360,379,392,403,411,418,423,427,430,432, 434,435,434,433,428,419,405,392,379,367,354,340,327,313,299,285,271,257,242,225, 221,223,227,231,235,239,244,248,252,257,261,265,270,273,277,279,280,274,259,245, 230,216,202,188,174,160,146,131,117,102,87,72,56,40,51,66,81,97,113,129,145,160, 176,191,206,220,233,242,245,243,237,230,222,213,202,192,180,168,156,143,130,117, 103, 90,76,63,50,36,24);

document.MM_Time[0][0].values[1].prop = "top";

if (!ns) {

document.MM_Time[0][0].values[0].prop2 = "style";

document.MM_Time[0][0].values[1].prop2 = "style";

}

document.MM_Time[0][1] = new String("behavior");

document.MM_Time[0][1].frame = 130;

document.MM_Time[0][1].value = "MM_timelineGoto('Timeline1','1')";

document.MM_Time[0].lastFrame = 130;

for (i=0; i<document.MM_Time.length; i++) {

document.MM_Time[i].ID = null;

document.MM_Time[i].curFrame = 0;

document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;

}

}

//-->

</script>

=========================================================
Part 2
=========================================================

<!-- -->

<p><!-- -->

============================================================
PART 3. Enter your image source and size in this section
============================================================

<!-- --><div id="Layer1" style="position:absolute; width:94px; height:102px; z-index:1; left: 440px; top: 24px"><img src="genie.gif" width="128" height="128"></div><!-- -->


Your Ad Here
Not All Of Your Subscribers Use RSS - AWeber Email Marketing
Your Ad Here