Flash中使用FlashPaper

在Flash中使用FlashPaper

我们可以将一个FlashPaper文档插入到Flash的FLA源文件中。当把FLA文件导出为SWF文件时,FlashPaper SWF文件就会嵌入到导出的SWF文件中。

下面的代码显示了一个普通的Flash FLA文件是如何使用 loadFlashPaper() 函数载入一个FlashPaper SWF文档的。

function loadFlashPaper(
path_s, // path of SWF to load
dest_mc, // MC which we should replace with the SWF
width_i, // new size of the dest MC
height_i, // new size of the dest MC
loaded_o) // optional: object to be notified that loading is complete
{
var intervalID = 0;
var loadFunc = function()
{
dest_mc._visible = false;
var fp = dest_mc.getIFlashPaper();
if (!fp)
return;
if (fp.setSize(width_i, height_i) == false)
return;
dest_mc._visible = true;
clearInterval(intervalID);
loaded_o.onLoaded(fp);
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}

下面的代码显示已经嵌入一个FlashPaper SWF文档后如何使用 loadFlashPaper() 函数。

function onLoaded(fp)
{
// loading is complete, so we can now adjust the current page, zoom, etc.
// go to page 50.
fp.setCurrentPage(50);
// change magnification to 33%
fp.setCurrentZoom(33);
}
loadFlashPaper("FlashPaper.swf", theDocMC, theDocMC._width, theDocMC._height, this);

其中fp.setCurrentPage值被设置为50,fp.setCurrentZoom值被设置为33,当FLA文件被导出时,嵌入的FlashPaper SWF文件以33%的放大倍率在导出的SWF文件中出现。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值