如何在移动 Flex 应用程序中加载交互式 .swf?
我有一个移动应用程序,我试图用它来加载交互式 .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>
i have a mobile application that i am attempting to use to load an interactive .swf file. At first, i was just going to use the .mxml applications from my other project file in flex, but they're for desktop apps and running on Flex 3.6, and Mobile apps can't be built on less than 4.5 :P
so, i figured i'd export the first project to a .swf, and load it in my mobile application, but nothing i do will get it to show up. anyone know a solution?
here's the code:
<?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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这不会起作用,因为您正在尝试加载本地 swf。我认为它需要通过互联网加载,即使如此,为什么要在本地加载 swf?为什么不直接调用它呢?
I don't think that'll work since you're trying to load a local swf. I think it needs to be loaded over the internets, and even so, why are you loading a swf in locally? Why not call to it directly?