gpt4 book ai didi

apache-flex - Flex 4 应用空白

转载 作者:行者123 更新时间:2023-12-04 03:08:19 25 4
gpt4 key购买 nike

我正在构建一个 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:Application,那么我看到的只是一个空白(白色)屏幕:

<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

关于apache-flex - Flex 4 应用空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6425213/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com