
//主应用loadFp.mxml
<!--l version="1.0" encoding="utf-8-->
//主应用loadFp.mxml
//flash cs3代码,生成所需要的fpl.swf
import flash.display.Stage;
Stage.align = "LT";
//Stage.scaleMode = "showAll";
var url = "template.swf";
var fp;
//localConnection通讯接口
var caller:LocalConnection = new LocalConnection();
var sender:LocalConnection = new LocalConnection();
caller.connect("_flashpaperloader");
caller.allowDomain("*");
sender.allowDomain("*");
Security.allowDomain("*");
//设置页面
//caller.setPage = function(n:Number)
//{
//fp.setCurrentPage(n);
//}
//设置大小
caller.setPaperSize = function(w:Number,h:Number)
{
trace("fpLoader width=" + w + " height =" + h) ;
fp.setSize(w,h);
}
//设置缩放
//caller.setCurrentZoom = function(zoom:Object)
//{
//fp.setCurrentZoom(zoom);
//sendCurrentZoom();
//}
//设置下一页
//caller.nextPage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p + 1 <= fp.getNumberOfPages())
//fp.setCurrentPage(p + 1);
//}
//设置上一页
//caller.prePage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p - 1 > 0)
//fp.setCurrentPage(p - 1);
//}
//卸载
caller.unload = function()
{
caller.close();
caller = null;
sender = null;
fp.destroy();
fp = null;
unloadAndStop();
paper.unloadMovie();
paper = null;
}
// function: loadFlashPaper
// ------------------------
// Load FlashPaper document, size it,
// Parameters:
// path_s: Path of SWF to load
// dest_mc: Movie clip to hold the imported 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
function loadFlashPaper(path_s, dest_mc, loaded_o) {
var intervalID = 0;
var loadFunc = function(){
trace("加载开始....");
dest_mc._visible = false;
fp = dest_mc.getIFlashPaper();
if (!fp) {
return;
} else if (!fp.setSize(0,0)){
trace("没有设置窗口大小");
return;
} else {
trace("flashPaper加载成功了");
clearInterval(intervalID);
//var pages_i = fp.getNumberOfPages();
//paper.toolbar_mc.brandClip_mc.swapDepths(1000);
//paper.toolbar_mc.brandClip_mc.removeMovieClip();
//ctrlHolder_mc.swapDepths(_root.control_mc);
dest_mc._visible = true; // Now show the document
//_root.control_mc._visible = true; // Now show the controller
loaded_o.onLoaded(fp);
}
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
// function: onLoaded()
// ------------------------
// Called once loading is complete
// Parameters:
// fp: FlashPaper interface (returned by getIFlashPaper())
function onLoaded() {
// We can now call the FlashPaper API functions.
// Remove the standard user interface features:
//fp.showUIElement("PrevNext", false);
fp.showUIElement("Print", false);
//fp.showUIElement("Find", false);
//fp.showUIElement("Tool", false);
//fp.showUIElement("Pop", false);
//fp.showUIElement("Zoom", false);
//fp.showUIElement("Page", false);
//fp.showUIElement("Overflow", false);
//fp.enableScrolling(false);
// Some additional API features (here commented out):
fp.setCurrentZoom(100);
//sendCurrentZoom();
sender.send("_flexloader","fpLoaded");
}
// Hide the navigation controller until after the document is loaded:
//_root.control_mc._visible = false;
// Create movie clip to hold the document:
var paper = this.createEmptyMovieClip("paper",100);
// Create movie clip to exchange the depth with the navigation controller clip:
//var ctrlHolder_mc = this.createEmptyMovieClip("ctrlHolder",200);
// Position the document clip on the stage:
paper._x = 0;
paper._y = 0;
// Load the FlashPaper document:
loadFlashPaper(url, paper, this);
<!--l version="1.0" encoding="utf-8-->
//主应用loadFp.mxml
//flash cs3代码,生成所需要的fpl.swf
import flash.display.Stage;
Stage.align = "LT";
//Stage.scaleMode = "showAll";
var url = "template.swf";
var fp;
//localConnection通讯接口
var caller:LocalConnection = new LocalConnection();
var sender:LocalConnection = new LocalConnection();
caller.connect("_flashpaperloader");
caller.allowDomain("*");
sender.allowDomain("*");
Security.allowDomain("*");
//设置页面
//caller.setPage = function(n:Number)
//{
//fp.setCurrentPage(n);
//}
//设置大小
caller.setPaperSize = function(w:Number,h:Number)
{
trace("fpLoader width=" + w + " height =" + h) ;
fp.setSize(w,h);
}
//设置缩放
//caller.setCurrentZoom = function(zoom:Object)
//{
//fp.setCurrentZoom(zoom);
//sendCurrentZoom();
//}
//设置下一页
//caller.nextPage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p + 1 <= fp.getNumberOfPages())
//fp.setCurrentPage(p + 1);
//}
//设置上一页
//caller.prePage = function()
//{
//var p:Number = fp.getCurrentPage();
//if(p - 1 > 0)
//fp.setCurrentPage(p - 1);
//}
//卸载
caller.unload = function()
{
caller.close();
caller = null;
sender = null;
fp.destroy();
fp = null;
unloadAndStop();
paper.unloadMovie();
paper = null;
}
// function: loadFlashPaper
// ------------------------
// Load FlashPaper document, size it,
// Parameters:
// path_s: Path of SWF to load
// dest_mc: Movie clip to hold the imported 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
function loadFlashPaper(path_s, dest_mc, loaded_o) {
var intervalID = 0;
var loadFunc = function(){
trace("加载开始....");
dest_mc._visible = false;
fp = dest_mc.getIFlashPaper();
if (!fp) {
return;
} else if (!fp.setSize(0,0)){
trace("没有设置窗口大小");
return;
} else {
trace("flashPaper加载成功了");
clearInterval(intervalID);
//var pages_i = fp.getNumberOfPages();
//paper.toolbar_mc.brandClip_mc.swapDepths(1000);
//paper.toolbar_mc.brandClip_mc.removeMovieClip();
//ctrlHolder_mc.swapDepths(_root.control_mc);
dest_mc._visible = true; // Now show the document
//_root.control_mc._visible = true; // Now show the controller
loaded_o.onLoaded(fp);
}
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
// function: onLoaded()
// ------------------------
// Called once loading is complete
// Parameters:
// fp: FlashPaper interface (returned by getIFlashPaper())
function onLoaded() {
// We can now call the FlashPaper API functions.
// Remove the standard user interface features:
//fp.showUIElement("PrevNext", false);
fp.showUIElement("Print", false);
//fp.showUIElement("Find", false);
//fp.showUIElement("Tool", false);
//fp.showUIElement("Pop", false);
//fp.showUIElement("Zoom", false);
//fp.showUIElement("Page", false);
//fp.showUIElement("Overflow", false);
//fp.enableScrolling(false);
// Some additional API features (here commented out):
fp.setCurrentZoom(100);
//sendCurrentZoom();
sender.send("_flexloader","fpLoaded");
}
// Hide the navigation controller until after the document is loaded:
//_root.control_mc._visible = false;
// Create movie clip to hold the document:
var paper = this.createEmptyMovieClip("paper",100);
// Create movie clip to exchange the depth with the navigation controller clip:
//var ctrlHolder_mc = this.createEmptyMovieClip("ctrlHolder",200);
// Position the document clip on the stage:
paper._x = 0;
paper._y = 0;
// Load the FlashPaper document:
loadFlashPaper(url, paper, this);
分类:
101~flex/flash
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
2009-04-16 C# 生成js文件
2009-04-16 onmousemove与onmouseover区别