WEB开发网
开发学院图形图像Flash Flash Actionscript常用的几段代码 阅读

Flash Actionscript常用的几段代码

 2008-05-28 11:20:50 来源:WEB开发网   
核心提示:1、flash调用打印机//库里一个mc,连接符为aa,Flash Actionscript常用的几段代码,舞台上一个按钮,名字为print_btnthis.createEmptyMovieClip("creat_mc", 999);creat_mc.attachMovie("aa&quo

1、flash调用打印机

//库里一个mc,连接符为aa,舞台上一个按钮,名字为print_btn

this.createEmptyMovieClip("creat_mc", 999);
creat_mc.attachMovie("aa", "aa_mc", 1000, {_x:200, _y:200});
print_btn.onPress = function()
{
var printJobrintJob = new PrintJob();
var isStartPrint:Boolean = printJob.start();
if (isStartPrint)
{
  printJob.addPage(_root, {printAsBitmap:true});
  printJob.send();
}
delete printJob;
};

//提示,打印那桢停哪桢,PrintJob类其他方法就不写了,按f1自己看吧。

////////////////////////////////////////////

2、调用outlook,我的电脑,回收站等

//先在舞台上建个叫aa_btn的按钮

  _root.aa_btn.onPress = function()
{
getURL("mailto:tslxg@hotmail.com");
//调用outlook必须放到服务器上使用,本地无效
  
  //链接[我的电脑].swf放桌面上有效,以下一样
getURL("file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"); 
  
  //链接[我的文档]
//getURL("file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}");
  
  //链接[网上邻居]
//getURL("file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}")
  
  //链接[控制面版]
//getURL("file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}/::{21EC2020-3AEA-1069-A2DD-08002B30309D}");
  
  //链接[回收站]
//getURL("file:///::{645FF040-5081-101B-9F08-00AA002F954E}");
};

/////////////////////////////////////////

3、flash调用js函数

//就举个例子,其他的自己试吧,大括号内写成一行,放网页上,本地无效,网页中的高,宽要全改为100%

aa_btn.onPress = function()
{
getURL("javascript:NewWindow=window.open('http://www.webjx.com/flash/index.html','newWin','width=660,height=480,left=0,top=0,toolbar=No,
location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus();   void(0);");
};

////////////////////////////////////////////

4、设为首页:

on (release) {
getURL(";void document.links.setHomePage('http://www.webjx.com/')", "_self", "OST");
}

注意要将网页中的flash的ID号命名为"links"

加入收藏夹:

on (release) {
getURL(" window.external.AddFavorite(http://www.webjx.com,'网页');", "_self", "OST");
}

Tags:Flash Actionscript 常用

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接