惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 噢耶游戏

星际迷航 致、青春 12306火车票网站自动登录工具 - 噢耶游戏 Compile your AS3 projects with Ant + Flex SDK (all Open Source) 有史以来关于Flash Player的最详细说明 深入理解Flash Player的应用程序域(Application Domains)(转载) - 噢耶游戏 弄了个新blogs 欢迎捧场 - 噢耶游戏 PHP 实用便捷代码(转) 一个鼠标拖出一个圆形的简单demo HttpModule 工作原理(转) Flex 拖拽 - 噢耶游戏 - 博客园 ASP.NET防止盗链(转) CS0016: 未能写入输出文件“C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\2adfa36a\1a90a869\8_prkz0n.dll" 错误的解决办法。 - 噢耶游戏 FLEX 12个基础 很有用的方法 取得工作目录下的文件 Asp.net中防止用户多次登录的方法(转) 大型网站的系统架构(摘) ActionSrcipt 资源 - 噢耶游戏 Flex和.net Webservice之间多层结构开发
Flex中不使用FelxPrintJob通过ExternalInterface直接调用JavaScript利用浏览器本身的功能进行打印
噢耶游戏 · 2008-12-19 · via 博客园 - 噢耶游戏

By Minidxer | November 1, 2008

有些情况下,我们的应用程序可能不允许我们使用FelxPrintJob,下面的代码说明了在不使用FelxPrintJob的情况下,利用浏览器本身的打印功能,通过ExternalInterface调用直接进行打印。

首先需要准备下面这样的一段JavaScript脚本,放在index.template.html 的之前:

<script language="JavaScript">

    function printPage(htmlPage)

    {

        var w = window.open("about:blank");

        w.document.write(htmlPage);

        w.print();

        w.close();

    }

</script>

接下去是利用ExternalInterface进行调用:

import mx.controls.Alert;

import flash.external.ExternalInterface;  

public static function PrintHtmlPage(pHtmlPage:String):void

{

    if (ExternalInterface.available)

    {

        try 

        {

              ExternalInterface.call("printPage",pHtmlPage);

        }

        catch (error:SecurityError) { Alert.show("Security Error"); }

        catch (error:Error) { Alert.show("Error");}

    }

    else { Alert.show("ExternalInterface not avalible");}

}

pHtmlPage是一串HTML标准的字符串,比如可以是这样:

<html><h1>Helo World</h1></html>

噢耶游戏是中国最大的轻社交游戏开发商,致力于手机页游的研发及推广业务。我们首创性地提出了HTML5游戏中心思路,在第三方App 中嵌入式休闲游戏,为开发者提供了全新的应用内游戏解决方案。