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

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - aixia

好久不更新了 Flex图片过度增强版 组件Event新写法 - aixia - 博客园 遍历flex和flash对象的属性和方法 as3访问对象属性和方法的经典用法 - aixia - 博客园 一个蛮有用的event BitmapData中不明白的问题 Array为什么这样会有错? - aixia - 博客园 flex图片过度 AS3图片特效 自定义ToolTip flex采集证券数据 flash cs3 安装程序数据库损坏无法安装的解决方法 run-time debugger for adobe flex components DataGrid通过webService和数据库绑定 flex使用外部参数详细版 给DateField和DateChooser进行汉化 flex module不编译的问题 自定义组件继承自定义组件
Flex加载图片的常用的几种方式 - aixia - 博客园
aixia · 2008-01-24 · via 博客园 - aixia

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="InitApp()">
    
<mx:Script>
        
<![CDATA[
        
            
//第一种方式 这种方式编译以后1.jpg 会直接编译进swf文件中 所以swf可以独立存在
            [Bindable]
            [Embed(source
="1.jpg")]
            private 
var imgClass:Class;
            
            
//第2种方式
            private var _loader:Loader;
            
            private 
function InitApp():void{
                
                
//第一种方式的代码
                _img.source = imgClass;
                
                
//第二种方式的代码
                _loader = new Loader();
                
//这里需要注意的是 不是_loader.addEventListener  这样是没有效果的
                _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(e:Event):void{
                    _img.source 
= e.currentTarget.content;
                }
);
                
//这里说一个技巧  当url 中有中文字体的话 使用encodeURI方法 如果没有 则可以不加
                _loader.load(new URLRequest(encodeURI("1.jpg")));
                
                
                
//第三种方式比较简单
                _img.source = "1.jpg";  //注意这里必须设置img autoLoad属性为true
                
                
//最后说明 其中第2 第3种方式中swf都不能独立存在 必须配合1.jpg文件的存在 而第一种方式则不需要
            }

        ]]
>
    
</mx:Script>
    <mx:Image x="51" y="62" width="298" height="245" autoLoad="true" id="_img"/>
</mx:Application>