t0bias: JavaScript kennt Objekt noch nicht

Beitrag lesen

Hi,

ich habe folgende HTML-Seite erstellt:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
 <head>  
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">  
  <title>CreativeCompartment Homebase</title>  
  <script type="text/javascript">  
 function sound() {  
  alert('Sound function goes here...');  
  alert(Panorama.getPan());  
 }  
 function computing() {  
  alert('Computing function goes here...');  
 }  
 function graphics() {  
  alert('Graphics function goes here...');  
 }  
 function mail() {  
  alert('Mail function goes here...');  
 }  
  
  </script>  
  <style type="text/css" title="Default">  
   body, div, h1, h2, h3, span, p {  
    font-family: Verdana,Arial,Helvetica,sans-serif;  
    color: #000000;  
   }  
   body {  
     font-size: 10pt;  
     background : #ffffff;  
   }  
   table,tr,td {  
    font-size: 10pt;  
    border-color : #777777;  
    background : #dddddd;  
    color: #000000;  
    border-style : solid;  
    border-width : 1px;  
   }  
   h1 {  
    font-size: 18pt;  
   }  
   h2 {  
    font-size: 14pt;  
   }  
   .warning {  
    font-weight: bold;  
   }  
  </style>  
 </head>  
 <body>  
 <div id="FlashBase" style="position:absolute; left:50%; top:50%; width:720px; height:480px; margin-top:-240px; margin-left:-360px;">  
 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  
         codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"  
         id="Panorama"  
         width="720" height="480" >  
        <param name="movie" value="Panorama.swf">  
        <param name="FlashVars" value="externalinterface=1">  
 <param name="pan" value="22">  
  
        <embed width="720" height="480"  
         pluginspage="http://www.macromedia.com/go/getflashplayer"  
         type="application/x-shockwave-flash"  
         name="Panorama"  
         src="Panorama.swf"  
                FlashVars="externalinterface=1"  
  pan="22"  
        />  
        </object></div>  
  
<a onClick="Panorama.moveTo(-30,0,70,10);" href="#">Move To Sound</a>  
<a onClick="Panorama.moveTo(45,0,70,10);" href="#">Move To Computing</a>  
<a onClick="Panorama.moveTo(-230,0,70,10);" href="#">Move To Graphics</a>  
<a onClick="Panorama.moveTo(-170,0,70,10);" href="#">Move To Mail</a>  
  
 </body>  
</html>  

Die einzelnen Funktionen werden aus dem Flash-Panorama heraus korrekt aufgerufen, d.h. die alert-Boxen erscheinen. Die Links, die auf das Objekt "Panorama" zugreiffen funktionieren auch, nur die Zugriffe auf das Panorama-Objekt aus den Funktionen heraus klappen nicht, ich gehen einmal davon aus,
dass dies der Fall ist, weil der Browser zum Zeitpunkt des Ladens das Objekt
noch nicht kennt.
Wie erreiche ich, dass diese Steuerung funktioniert?

Gruss

Tobias