简体   繁体   中英

how to load interactive .swf in mobile flex application?

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>

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM