加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex 4 App Blank

发布时间:2020-12-15 01:44:19 所属栏目:百科 来源:网络整理
导读:我正在构建一个Flex 4应用程序(使用flexmojos而不是FlexBuilder).如果我使用mx:Application创建一个测试应用程序,那么我会看到一个按钮,如我所料: mx:Application xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="http://www.adobe.com/2006/mxml"
我正在构建一个Flex 4应用程序(使用flexmojos而不是FlexBuilder).如果我使用mx:Application创建一个测试应用程序,那么我会看到一个按钮,如我所料:

<mx:Application
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="http://www.adobe.com/2006/mxml">

    <s:Button
        label="Button"/>

</mx:Application>

但是,如果我使用s:应用程序,那么我看到的只是一个空白(白色)屏幕:

<s:Application
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="http://www.adobe.com/2006/mxml">

    <s:Button
        label="Button"/>

</s:Application>

顺便说一句,我目前没有使用html包装器,我只是直接在浏览器中加载swf.

这是我的pom ……

<project 
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.aaa.bbb</groupId>
    <artifactId>app</artifactId>
    <packaging>war</packaging>
    <version>2.0-SNAPSHOT-1</version>
    <name>app</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>3.9</version>
                <dependencies>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.5.0.20967</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
                <extensions>true</extensions>
                <configuration>
                    <policyFileUrls>
                        <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
                    </policyFileUrls>
                    <rslUrls>
                        <url>http://fpdownload.adobe.com/pub/{extension}/flex/4.5.0.20967/{artifactId}_{version}.{extension}</url>
                    </rslUrls>
                </configuration>
                <executions>
                    <execution>
                        <id>flex-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile-swf</goal>
                        </goals>
                        <configuration>
                            <output>src/main/webapp/Main.swf</output>
                        </configuration>                        
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>textLayout</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>framework</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>spark</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>sparkskins</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>rpc</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>datavisualization</artifactId>
          <version>4.5.0.17855</version>
          <type>swc</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>flex-framework</artifactId>
          <version>4.5.0.20967</version>
          <type>pom</type>
        </dependency>
    </dependencies>

</project>

谁知道我做错了什么?
谢谢

更新:

我现在将所有RLS作为.swz文件存储在与.swf文件相同的位置,并且我将RSL URL设置如下:

<configuration>
                    <policyFileUrls>
                        <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
                    </policyFileUrls>
                    <rslUrls>
                        <url>{artifactId}_${flex.sdk.version}.{extension}</url>
                    <url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_${flex.sdk.version}.{extension}</url>
                    </rslUrls>
                </configuration>

不过,该应用程序只是空白.使用FireBug似乎没有任何我可以看到的RSL请求,也没有任何与此相关的错误消息.似乎甚至没有尝试过RSL加载.

这很奇怪!

解决方法

如果你在mojos< 4将此添加到flexmojos-maven-plugin的配置中

<configuration>
    <configurationReport>true</configurationReport>
    <sourceFile>Main.mxml</sourceFile>
    <configFiles><!-- Fix for Mojos's < 4 -->
        <configFile>flex-config-swf-version-11.xml</configFile> 
    </configFiles> 
...

然后创建此文件

<?xml version="1.0"?> 
<flex-config> 
        <swf-version>11</swf-version> 
</flex-config>

来自:http://groups.google.com/group/flex-mojos/browse_thread/thread/143f69219fcddc16#

如果您在4,则可以将其添加到您的配置中

<configuration>
    <configurationReport>true</configurationReport>
    <sourceFile>Main.mxml</sourceFile>
    <swfVersion>11</swfVersion>
...

来自:http://groups.google.com/group/flex-mojos/browse_thread/thread/9ff3ea2e0e0461a4

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读