我试图在弹出窗口中打开的iFrame中加载pdf。弹出窗口正在显示,但它没有加载pdf。 这是我的代码-Main.mxml
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import com.google.code.flexiframe.IFrame;
import mx.managers.PopUpManager;
protected function dgGrid_itemDoubleClick(event:Event):void {
var win : Window = new Window();
PopUpManager.addPopUp(win,this,true);
PopUpManager.centerPopUp(win);
}
现在Window.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" width="742" height="452"
title="PopUp Window" horizontalAlign="center"
xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
xmlns:components="components.*"
showCloseButton="true"
close="closeWindow(event);" >
<mx:Script>
<![CDATA[
import mx.core.IFlexDisplayObject;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
private function closeWindow(e:CloseEvent):void {
PopUpManager.removePopUp(e.target as IFlexDisplayObject);
}
]]>
</mx:Script>
<flexiframe:IFrame id="iframe" source="C:\\test.pdf"
backgroundColor="blue" width="100%" height="100%" visible="true"/>
你可以建议它有什么问题吗?
答案 0 :(得分:0)
您需要转到 index.template.html 文件并将以下参数放入SWF中:
params.wmode= "opaque";
请注意,尽管此设置可能会解决IFrame的许多问题,但它确实会导致某些Flash版本和浏览器出现性能问题。使用IFrame需要您自担风险。