【问题标题】:Flash movie position in Facebook canvasFacebook 画布中的 Flash 电影位置
【发布时间】:2012-08-07 09:26:29
【问题描述】:

我在 facebook 画布中定位 Flash 电影时遇到了一些问题。

Flash 影片的大小为 760x600 像素。所以我已经将画布宽度的 facebook 应用程序高级设置设置为固定(760 像素),高度设置为固定(800 像素)。

问题是,我得到了一个水平滚动条,并且只显示了 750 像素的 flash 电影,因为 flash 电影似乎在 canvas.x = 10 px 处对齐,而不是在 x = 0 px 处。

有没有办法设置 Flash 电影的位置?最好在 Flash-As3 中?

提前致谢!

更新

感谢 Niraj 的输入!不幸的是,我从未对 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>

非常感谢!

【问题讨论】:

  • 用 html 代码更新了我原来的问题

标签: facebook actionscript-3 flash facebook-canvas


【解决方案1】:

您的问题在于您的 Flash 页面。您应该从嵌入 Flash 的 HTML 页面中删除边距,并使用 Javacript SDK 使用 setAutoGrow() 函数调整页面大小。 overflow: hidden 也会移除滚动条。

示例 CSS:

body {
  margin: 0;
  overflow: hidden;
}

编辑:

在页面的&lt;head&gt;标签中,添加:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-26
    • 2013-02-11
    • 2012-07-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-07
    • 1970-01-01
    • 2012-06-04
    相关资源
    最近更新 更多