chr*_*ris 3 apache-flex flexmojos flex4 maven
我正在构建一个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>
Run Code Online (Sandbox Code Playgroud)
但是,如果我使用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>
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我目前没有使用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>
Run Code Online (Sandbox Code Playgroud)
谁知道我做错了什么?谢谢
更新:
我现在将所有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>
Run Code Online (Sandbox Code Playgroud)
不过,该应用程序只是空白.使用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>
...
Run Code Online (Sandbox Code Playgroud)
然后创建此文件
<?xml version="1.0"?>
<flex-config>
<swf-version>11</swf-version>
</flex-config>
Run Code Online (Sandbox Code Playgroud)
来自:http://groups.google.com/group/flex-mojos/browse_thread/thread/143f69219fcddc16#
如果您使用的是4+,则可以将其添加到您的配置中
<configuration>
<configurationReport>true</configurationReport>
<sourceFile>Main.mxml</sourceFile>
<swfVersion>11</swfVersion>
...
Run Code Online (Sandbox Code Playgroud)
来自:http://groups.google.com/group/flex-mojos/browse_thread/thread/9ff3ea2e0e0461a4
| 归档时间: |
|
| 查看次数: |
2830 次 |
| 最近记录: |