如何通过内容扩展swf的高度?

时间:2009-11-10 01:36:56

标签: html flash actionscript-3 height

我在flash中创建一个正在读取数据库条目的站点。我希望swf在html页面上向下扩展,以便用户可以使用浏览器滚动条查看所有内容。我不想将所有内容分成800 px高swf或其他东西 - 我希望页面扩展就像它是html一样。可能的?

1 个答案:

答案 0 :(得分:4)

我们在私人项目中做到了这一点。我们有一个使用ExternalInterface.call(http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html)的函数:

if (ExternalInterface.available) ExternalInterface.call('resizeScene', newHeight)

调用一个简单调整div元素大小的javascript函数:

function resizeScene(newHeight)
{
    document.getElementById('website').style.height = parseFloat(newHeight) + 'px';
}

您可能还想调查

http://livedocs.adobe.com/flex/3/langref/flash/display/Stage.html#align

http://livedocs.adobe.com/flex/3/langref/flash/display/Stage.html#scaleMode

相关问题