Probleem Met JavaScript

Status
Niet open voor verdere reacties.

o0o0nick0o0o

Gebruiker
Lid geworden
19 mrt 2006
Berichten
8
Hallo allemaal ik ben nick.
Ik heb een probleem met een java script.:(
Mijn poes is overleden en wil een duif van links onder naar boven laten vliegen met een gif bestand zoiets als dit -------> http://www.weddingteam.nl

Maar het lukt me niet om de script in te voeren.
Kan iemand mij Helpen ????
Alvast bedankt

Greets Nick
 
Dit komt ergens tussen de "head"-tags te staan :

HTML:
<script language="javascript">
<!--
function MM_timelinePlay(tmLnName, myID) {
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;
  };
  if (myID == tmLn.ID) {
    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) {
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines();
  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];
    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;
      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
        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() {
    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 = 20;
    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, 100);
    document.MM_Time[0][0].values = new Array(2);
    document.MM_Time[0][0].values[0] = new Array(-140,-135,-129,-124,-118,-113,-107,-102,-96,-91,-85,-80,-75,-69,-64,-58,-53,-47,-42,-36,-31,-25,-20,-15,-9,-4,2,7,13,18,24,29,35,40,45,51,56,62,67,73,78,84,89,95,100,105,111,116,122,127,133,138,144,149,155,160,165,171,176,182,187,193,198,204,209,215,220,225,231,236,242,247,253,258,264,269,275,280,285,291,296,302,307,313,318,324,329,335,340,345,351,356,362,367,373,378,384,389,395,400);
    document.MM_Time[0][0].values[0].prop = "left";
    document.MM_Time[0][0].values[1] = new Array(400,395,390,385,380,375,370,365,360,355,349,344,339,334,329,324,319,314,309,304,299,294,289,284,279,274,269,264,259,254,248,243,238,233,228,223,218,213,208,203,198,193,188,183,178,173,168,163,158,153,147,142,137,132,127,122,117,112,107,102,97,92,87,82,77,72,67,62,57,52,46,41,36,31,26,21,16,11,6,1,-4,-9,-14,-19,-24,-29,-34,-39,-44,-49,-55,-60,-65,-70,-75,-80,-85,-90,-95,-100);
    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 = 200;
    document.MM_Time[0][1].value = "MM_timelineGoto('Timeline1','1')";
    document.MM_Time[0].lastFrame = 200;
    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>

Dit komt in de "body"-tag :

HTML:
 onLoad="MM_timelinePlay('Timeline1');"

En dit tussen de "body"-tags :

HTML:
<div id="Layer1" style="position:absolute; width:134px; height:99px; z-index:1; left: -140px; top: 400px"><img src="../Pictures/duif.gif"></div>

Dit script heb ik niet nagekeken, maar het werkt wel (echter niet in firefox). Klik -> hier <- voor een voorbeeld.

Greetz : Jer:cool:en.
 

Bijlagen

Laatst bewerkt:
Graag gedaan.
Wil je deze topic nog even markeren als opgelost? :thumb:

Greetz : Jer:cool:en.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan