1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<s:Application xmlns:fx=
"http://ns.adobe.com/mxml/2009"
xmlns:mx=
"library://ns.adobe.com/flex/mx"
minWidth=
"955"
minHeight=
"600"
creationComplete=
"application1_creationCompleteHandler(event)"
>
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import
mx.events.FlexEvent;
protected
function
application1_creationCompleteHandler(event:FlexEvent):
void
{
var
loader: Loader =
new
Loader();
var
urlRequest: URLRequest =
new
URLRequest(url);
loader.load(urlRequest);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
function
(e:Event):
void
{
img1.source = e.target.content;
});
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<mx:Image id=
"img1"
x=
"87"
y=
"75"
/>
</s:Application>
|
分类:
Flex