<?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" minWidth="955" minHeight="600" xmlns:code="http://code.google.com/p/flex-iframe/">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.events.MoveEvent;
protected function panel1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
panel.startDrag();
}
// 让iframe跟着父容器拖动
protected function panel_moveHandler(event:MouseEvent):void
{
// 这里只要更改了xy就行,不必管多少,因为已设置left="0" top="0"
sadsa.x = 1;
sadsa.y = 1;
// 通过这个调用iframe里的js方法
// sadsa.callIFrameFunction('show');
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Panel id="panel" width="70%" height="70%" mouseDown="panel1_clickHandler(event)" mouseMove="panel_moveHandler(event)">
<code:IFrame x="0" y="0" id="sadsa" label="we" width="100%" height="100%" source="http://www.baidu.com" left="0" top="0"/>
</s:Panel>
</s:Application>
flex-iframe随父容器拖动
最新推荐文章于 2026-06-15 10:33:10 发布

2615

被折叠的 条评论
为什么被折叠?



