【发布时间】:2011-09-26 06:27:39
【问题描述】:
我有一个移动应用程序,我正尝试使用它来加载交互式 .swf 文件。起初,我只是打算在 flex 中使用我的其他项目文件中的 .mxml 应用程序,但它们适用于桌面应用程序并在 Flex 3.6 上运行,而移动应用程序不能在低于 4.5 的基础上构建:P
所以,我想我会将第一个项目导出为 .swf,然后将其加载到我的移动应用程序中,但我所做的一切都不会让它显示出来。有人知道解决办法吗?
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Task Graphic Novels">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:SWFLoader width="100%" height="100%"
loadForCompatibility="true"
id="bookLoader" enabled="false"/>
<fx:Script>
<![CDATA[
import
]]>
</fx:Script>
<s:List height="100%" width="100%">
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer height="100" labelField="name"
iconField="photo" iconHeight="70"
iconWidth="54" messageFunction="getMessage">
<fx:Script>
<![CDATA[
import spark.components.NavigatorContent;
protected function getMessage(o:Object):String
{
return o.message;
}
]]>
</fx:Script>
</s:IconItemRenderer>
</fx:Component>
</s:itemRenderer>
<s:dataProvider>
<s:ArrayCollection>
<fx:Object name="Breach an Obstacle" photo="@Embed('assets/img/sumeco/beach/title.jpg')" message=""/>
<fx:Object name="Conduct a Raid" photo="@Embed('assets/img/sumeco/title.jpg')" message=""/>
</s:ArrayCollection>
</s:dataProvider>
<s:change>
<![CDATA[
if(event.currentTarget.selectedItem.name == "Beach")
//here's where i'm trying to load the swf {bookLoader.enabled=true; bookLoader.load(new U RLRequest("assets/BookDemo.swf"));}
else if(event.currentTarget.selectedItem.name == "Title"){}
]]>
</s:change>
</s:List>
</s:View>
【问题讨论】:
-
我没有收到任何错误,它只是没有加载:/ 截至目前,单击该项目与单击第二个项目相同,没有。
-
您的目标平台是什么?对于 iOS,这是不可能的。
-
根本不适合 iOS?即使 swf 包含在打包的应用程序中也不行?
标签: apache-flex flash embed interactive mobile-application