【发布时间】:2009-11-10 01:36:55
【问题描述】:
我正在闪存中创建一个站点,该站点正在从数据库中读取条目。我希望 swf 在 html 页面上向下扩展,以便用户可以使用浏览器滚动条查看所有内容。我不想将所有内容分页成 800 px 高的 swf 或其他东西 - 我希望页面像 html 一样扩展。可能吗?
【问题讨论】:
标签: html flash actionscript-3 height
我正在闪存中创建一个站点,该站点正在从数据库中读取条目。我希望 swf 在 html 页面上向下扩展,以便用户可以使用浏览器滚动条查看所有内容。我不想将所有内容分页成 800 px 高的 swf 或其他东西 - 我希望页面像 html 一样扩展。可能吗?
【问题讨论】:
标签: html flash actionscript-3 height
我们在私人项目中正是这样做的。我们有一个使用 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
【讨论】: