如何在运行时设置mxml中的backgroundImage?
public var log_img:Class;
[Embed(source="../images/logo.jpg")]
这是这样使用的:
<monitor:MonitorDisplay backgroundImage="{ log_img }"/>
上面会将图像嵌入到swf中,但我希望从当前网站加载图像,例如
<img src="/images/logo.jpg" />
如何做到这一点?
我尝试过这个但不起作用:
[source="http://domain.name/images/logo.jpg"]
public var log_img:Class;
[Embed(source="../images/logo.jpg")]
Which is used this way:
<monitor:MonitorDisplay backgroundImage="{ log_img }"/>
The above will Embed the image into the swf,but I want the image to be loaded from the current website,like
<img src="/images/logo.jpg" />
How to do this?
I tried this but doesn't work:
[source="http://domain.name/images/logo.jpg"]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
Loader
类。一个简单的例子:
use the
Loader
class.a simple example:
如果您想动态加载图像,您应该查看 Loader 类。
例如 :
I you want to load dynamically an image, you should look at the Loader class.
For example :