---
title: "Flex URL 加载资源"
author: "demojava"
date: "2011-02-28T12:01:45Z"
tags: []
categories: ["Web前端"]
slug: "flex-url"
draft: false
lastmod: "2011-02-28T12:01:45Z"
id: 933304
url: "https://demojava.iteye.com/blog/933304"
---

1.绝对资源：

  &lt;mx:Style source=[http://baidu.com/style/style.css](http://baidu.com/style/style.css)&gt;

2.动态路径：

&lt;mx:HTTPService url="@ContextRoot()/demo.xml"/&gt;

3\. 编译时路径通常与Flex运行根目录有关

&lt;mx:Scirpt source="/myscript.as"/&gt;

4.相对路径：就是从当前目录下查找资源的文件路径：

&lt;mx:Scirpt source="../demo.as" /&gt;