2012-04-27 5 views
-1

を持っている私はtest.phpを Javaスクリプトエラー

 // JAVASCRIPT VARS 
     // the path to the SWF file 
     var swfPath = "http://loveslgirls.com/Flash Mp3 Player/project/deploy/preview.swf"; 
     //swfPath += "?t=" + Date.parse(new Date()); // uncomment this line to activate cache buster   

     // stage dimensions 
     var stageW = 560;//560//"100%"; // minimum is 450 
     var stageH = 300;//400;//"100%"; // minimum is 260 


     // ATTRIBUTES 
     var attributes = {}; 
     attributes.id = 'FlashComponent'; 
     attributes.name = attributes.id; 

     // PARAMS 
     var params = {}; 
     params.bgcolor = "#333333"; 
     params.allowfullscreen = "true"; 
     params.allowScriptAccess = "always";    
     //params.wmode = "transparent"; 


     /* FLASH VARS */ 
     var flashvars = {}; 

     /// if commented/delete these lines, the component will take the stage dimensions defined 
     /// above in "JAVASCRIPT SECTIONS" section or those defined in the settings xml   
     flashvars.componentWidth = stageW; 
     flashvars.componentHeight = stageH;       

     /// path to the content folder(where the xml files, images or video are nested) 
     /// if you want to use absolute paths(like "http://domain.com/images/....") then leave it empty("") 
     // Also, if you want the embed code to work correctly you'll need to set the an absolute path for pathToFiles, like this: http://www.yourwebsite.dom/.../mp3gallery/ 
     flashvars.pathToFiles = "http://loveslgirls.com/Flash Mp3 Player/"; 
     flashvars.xmlPath = "project/deploy/mp3gallery/xml/settings.xml"; 
     flashvars.contentXMLPath = "project/deploy/mp3gallery/xml/mp3gallery.xml"; 

     /** EMBED THE SWF**/ 
     swfobject.embedSWF(swfPath, attributes.id, stageW, stageH, "9.0.124", "http://loveslgirls.com/Flash Mp3 Player/project/deploy/js/expressInstall.swf", flashvars, params, attributes); 

</script> 

    <table width="100%" height="100%" cellpadding="0" cellspacing="0"> 
     <td align="center"> 

      <!-- this div will be overwritten by SWF object -->  
      <div id="FlashComponent"> 
       <p>In order to view this object you need Flash Player 9+ support!</p> 
       <a href="http://www.adobe.com/go/getflashplayer"> 
        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/> 
       </a> 
      </div> 

     </td> 
    </table> 

にのみ、このコードでJavaScriptを実行することができますが、私は、より複雑なPHPファイルのが実行されていない内部にこれを追加したとき。それはUncaught ReferenceError: ST is not defined Uncaught TypeError: Object [object DOMWindow] has no method 'addEvent'

どのようにこのプレイヤーを私の複雑なページに追加しますか?

+1

javascript!= Java – MByD

+1

最も複雑なページを見ることなく、本当にうまくいくわけではありません。しかし、あなたのコードのいくつかが存在しない/グローバルスコープで宣言されたaddEventメソッドにアクセスしようとしているようですので、私の最善の策はそのコードを探し、そこから参照することです。 – GillesC

+0

あなたは自分自身について話しているとき、私は私ではありません!それを編集しました。 – epascarello

答えて

0

要素がページ上にある前にスクリプトを呼び出すように見えます。呼び出しているメソッドがonloadを処理していますか?そうでない場合は、参照している要素の後にスクリプトを追加するか、document.readyで呼び出すか、スクリプトonloadを追加する必要があります。

関連する問題