博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Embedding external files using [Embed]
阅读量:6955 次
发布时间:2019-06-27

本文共 921 字,大约阅读时间需要 3 分钟。

Posted on 
2008-01-13 15:10   阅读(
313) 评论(
0)   

OK, I learnt this trick a few weeks ago from a co-worker. A user emailed me and asked if it was possible to embed an HTML/text file in a Flex application rather than having to load the files at runtime, similar to how you can embed images or whatnot.

Not being certain, I asked the team and got this response…

foobar.as

package {
    import flash.utils.ByteArray;  
    [Embed(source="test.mxml", mimeType="application/octet-stream")]
    public class foobar extends ByteArray
    {
    }
}
test.mxml
<?
xml version="1.0" encoding="utf-8"
?>
<
mx:Application 
xmlns:mx
="http://www.adobe.com/2006/mxml"
 creationComplete
="testMe()"
>
  
<
mx:Script
>
    
<![CDATA[
       public var myText:foobar = new foobar();
        public function testMe():void {
            trace(myText.toString());
        }
    
]]>
</
mx:Script
>
  
</
mx:Application
>
    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/13/1037021.html
,如需转载请自行联系原作者
你可能感兴趣的文章
MySQL的EXPLAIN命令用法
查看>>
iOS错误之“A valid provisioning profile for this executable was not found”
查看>>
jquery实现Ajax
查看>>
实验:删除/boot,恢复
查看>>
进程隐藏与进程保护(SSDT Hook 实现)(一)
查看>>
小学生都能看懂的表达式计算(图解)
查看>>
网页局部规划小试
查看>>
python的pip使用方法
查看>>
查看进程PID专用工具-------pgrep
查看>>
免费内网穿透-端口映射
查看>>
Zabbix 调用API 批量添加主机等
查看>>
AR手游Bandai Dot Heros轻松打造属于自己的机器人
查看>>
20190219find
查看>>
Ubuntu基本命令
查看>>
物联网有没有创新的思维模式?如果有,会是什么?
查看>>
微会动微信现场互动:年会策划之用产品思维搞定年会
查看>>
capture
查看>>
利用STP生成树协议实现负载均衡
查看>>
三层交换
查看>>
学习——精通软件性能测试笔记
查看>>