2012-08-07 53 views
1

我在Flash畫面中的位置有點麻煩。在Facebook畫布中的Flash電影位置

Flash影片的大小爲760x600像素。所以我已經設置了畫布寬度的Facebook應用高級設置爲固定(760像素),高度爲固定(800像素)。

問題是,我得到一個水平滾動條,並且只顯示了750像素的Flash影片,因爲Flash影片似乎在canvas.x = 10px而不是x = 0px處對齊。

有沒有辦法設置Flash動畫的位置?最好在Flash-As3中?

在此先感謝!

更新

感謝您的輸入尼拉吉!不幸的是我從來沒有用CSS做過任何事情。這裏是我的「index.html」,你會告訴我如何將你的例子整合到html代碼中嗎?

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
<head> 
    <!-- Include support librarys first --> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 
</head> 
<body> 
    <div id="fb-root"></div><!-- required div --> 
    <div id="flashContent"> 
     <h1>You need at least Flash Player 10.2 to view this page.</h1> 
     <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></p> 
    </div> 
    <script type="text/javascript"> 
     //This example uses dynamic publishing with swfObject. Login is handled in the swf 

     //Note we are passing in attribute object with a 'name' property that is same value as the 'id'. This is REQUIRED for Chrome/Mozilla browsers   
     swfobject.embedSWF("example.swf", "flashContent", "760", "600", "10.1", null, null, null, {name:"flashContent"}); 

     // redirect 
     function redirect(id,perms,uri) 
     { 
      var params = 
      window.location.toString().slice(window.location.toString().indexOf('?')); 
      top.location = 'https://graph.facebook.com/oauth/authorize?client_id='+id+'&scope='+perms+'&redirect_uri='+uri+params; 
     }  
    </script> 
</body> 
</html> 

非常感謝!

+0

更新我的HTML代碼 – TicketToRide 2012-08-07 10:22:17

回答

1

你的問題在於你的Flash頁面。您應該從嵌入閃存的HTML頁面刪除頁邊距,並使用Javacript SDK使用setAutoGrow()函數調整頁面大小。 overflow: hidden也會刪除滾動條。

範例CSS:

body { 
    margin: 0; 
    overflow: hidden; 
} 

編輯:

在你的頁面的<head>標籤,加入:

<style type="text/css"> 
    html, body { 
     margin: 0; 
     overflow: hidden; 
    } 
</style> 
+0

原題嗨尼拉吉,我已經更新了我的問題,進一步鱈魚即 – TicketToRide 2012-08-07 11:57:34

+0

謝謝。我已經更新了我的答案。 – 2012-08-07 12:20:31

+0

太棒了,非常感謝! – TicketToRide 2012-08-07 14:15:41