flex内嵌html网页示例代码
程序员文章站
2022-06-28 14:06:28
首先,并添加到libs中 下面直接上代码 复制代码 代码如下:
首先,并添加到libs中
下面直接上代码
<?xml version="1.0" encoding="utf-8"?>
<s:application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:code="http://code.google.com/p/flex-iframe/"
minwidth="955" minheight="600"
creationcomplete="application1_creationcompletehandler(event)">
<fx:script>
<![cdata[
import mx.events.flexevent;
protected function application1_creationcompletehandler(event:flexevent):void
{
this.myiframe.source = "http://m.weather.com.cn/m/pn11/weather.htm";
}
]]>
</fx:script>
<fx:declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:declarations>
<code:iframe id="myiframe" width="100%" height="100%"/>
</s:application>
下面直接上代码
复制代码 代码如下:
<?xml version="1.0" encoding="utf-8"?>
<s:application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:code="http://code.google.com/p/flex-iframe/"
minwidth="955" minheight="600"
creationcomplete="application1_creationcompletehandler(event)">
<fx:script>
<![cdata[
import mx.events.flexevent;
protected function application1_creationcompletehandler(event:flexevent):void
{
this.myiframe.source = "http://m.weather.com.cn/m/pn11/weather.htm";
}
]]>
</fx:script>
<fx:declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:declarations>
<code:iframe id="myiframe" width="100%" height="100%"/>
</s:application>