我的Flex应用程序遇到问题,确切菜单(基于mx.controls.Menu和flexlib.controls.ScrollableMenu)。
当我通过FlashBuilder菜单构建我的应用程序时。见截图:
但是当我使用flexmojos-sonatype-plugin通过maven构建它时,菜单被破坏(根据labelField属性它没有正确呈现,并且它不会捕获任何事件,如鼠标点击)。见截图:
我的.actionScriptProperties文件:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="ats.mxml" projectUUID="802474ea-5e3c-4d2c-bdaa-8c263c0828f4" version="6">
<compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="false" copyDependentFiles="true" flexSDK="Flex 3.3" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderLocation="D:/flex" outputFolderPath="bin-debug" rootURL="http://localhost:8080/flex/" sourceFolderPath="src/main/flex" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compilerSourcePath />
<libraryPath defaultLinkType="1">
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation/3.3.0.4852/automation-3.3.0.4852.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_agent/3.3.0.4852/automation_agent-3.3.0.4852.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_dmv/3.3.0.4852/automation_dmv-3.3.0.4852.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_flashflexkit/3.3.0.4852/automation_flashflexkit-3.3.0.4852.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation_agent/3.3.0.4852/automation_agent-3.3.0.4852-en_US.rb.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/automation/3.3.0.4852/automation-3.3.0.4852-en_US.rb.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flexunit/flexunit/0.90/flexunit-0.90.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/adobe/flex/framework/as3corelib/0.92.1/as3corelib-0.92.1.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="3" linkType="1" path="d:/apps/.m2/repo/com/google/code/flexlib/flexlib/2.6-M3/flexlib-2.6-M3.swc" useDefaultLinkType="true"/>
<libraryPathEntry kind="4" path="">
<modifiedEntries>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="true"/>
</modifiedEntries>
<excludedEntries>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
</libraryPath>
<sourceAttachmentPath>
<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/>
</sourceAttachmentPath>
</compiler>
<applications>
<application path="myApp.mxml"/>
</applications>
<modules/>
<buildCSSFiles/>
</actionScriptProperties>
我有效的POM文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.application.myApp</groupId>
<artifactId>myApp</artifactId>
<version>trunk-SNAPSHOT</version>
<packaging>swf</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.code.flexlib</groupId>
<artifactId>flexlib</artifactId>
<version>2.6-M3</version>
<type>swc</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.code.flexlib</groupId>
<artifactId>flexlib</artifactId>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>3.3.0.4852</version>
<type>pom</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>playerglobal</artifactId>
<groupId>com.adobe.flex.framework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>3.3.0.4852</version>
<type>swc</type>
<classifier>10</classifier>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<version>0.90</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>as3corelib</artifactId>
<version>0.92.1</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>datavisualization</artifactId>
<version>3.3.0.4852</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.0-RC2</version>
<extensions>true</extensions>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>sources</goal>
</goals>
<configuration>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<compilerWarnings>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</execution>
<execution>
<id>swf-optimization</id>
<goals>
<goal>optimize-swf</goal>
</goals>
<configuration>
<attachOriginalArtifact>false</attachOriginalArtifact>
<reduce>false</reduce>
<reduceMergeABC>false</reduceMergeABC>
<reduceMergeCF>false</reduceMergeCF>
<reduceSortCPool>false</reduceSortCPool>
<strip>false</strip>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<compilerWarnings>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>license</artifactId>
<version>3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-flex3-compatibility-layer</artifactId>
<version>4.0-RC2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.3.0.4852</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>adt</artifactId>
<version>3.3.0.4852</version>
<scope>compile</scope>
</dependency>
</dependencies>
<configuration>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<compilerWarnings>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.0-RC2</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-compile-swf</id>
<phase>compile</phase>
<goals>
<goal>compile-swf</goal>
</goals>
<configuration>
<sourceFile>myApp.mxml</sourceFile>
<ignoreVersionIssues>true</ignoreVersionIssues>
<skipTests>true</skipTests>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
<show-binding-warnings>false</show-binding-warnings>
<warn-duplicate-variable-def>false</warn-duplicate-variable-def>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>sources</goal>
</goals>
<configuration>
<sourceFile>myApp.mxml</sourceFile>
<ignoreVersionIssues>true</ignoreVersionIssues>
<skipTests>true</skipTests>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
<show-binding-warnings>false</show-binding-warnings>
<warn-duplicate-variable-def>false</warn-duplicate-variable-def>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</execution>
<execution>
<id>swf-optimization</id>
<goals>
<goal>optimize-swf</goal>
</goals>
<configuration>
<attachOriginalArtifact>false</attachOriginalArtifact>
<reduce>false</reduce>
<reduceMergeABC>false</reduceMergeABC>
<reduceMergeCF>false</reduceMergeCF>
<reduceSortCPool>false</reduceSortCPool>
<strip>false</strip>
<sourceFile>myApp.mxml</sourceFile>
<ignoreVersionIssues>true</ignoreVersionIssues>
<skipTests>true</skipTests>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
<show-binding-warnings>false</show-binding-warnings>
<warn-duplicate-variable-def>false</warn-duplicate-variable-def>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>license</artifactId>
<version>3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-flex3-compatibility-layer</artifactId>
<version>4.0-RC2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.3.0.4852</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>adt</artifactId>
<version>3.3.0.4852</version>
<scope>compile</scope>
</dependency>
</dependencies>
<configuration>
<sourceFile>ats.mxml</sourceFile>
<ignoreVersionIssues>true</ignoreVersionIssues>
<skipTests>true</skipTests>
<compilerWarnings>
<warn-no-constructor>false</warn-no-constructor>
<show-binding-warnings>false</show-binding-warnings>
<warn-duplicate-variable-def>false</warn-duplicate-variable-def>
<assignmentWithinConditional>true</assignmentWithinConditional>
<constructorReturnsValue>true</constructorReturnsValue>
<duplicateArgumentNames>true</duplicateArgumentNames>
<duplicateVariableDef>true</duplicateVariableDef>
<noConstructor>true</noConstructor>
</compilerWarnings>
<actionscriptFileEncoding>UTF-8</actionscriptFileEncoding>
<licenses>
<flexbuilder3>...</flexbuilder3>
</licenses>
<targetPlayer>10.2.0</targetPlayer>
<accessible>true</accessible>
<headlessServer>true</headlessServer>
<localesCompiled>
<locale>en_US</locale>
</localesCompiled>
<verboseStacktraces>true</verboseStacktraces>
<generateHtmlWrapper>false</generateHtmlWrapper>
<enableM2e>false</enableM2e>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我发现使用MonsterDebugger在运行时菜单对象中创建了它的MenuItemRenderers。
我使用Flex SDK 3.3,FlashBuilder 4,Maven 3.0.5,flexmojos-maven-plugin 4.0-RC2。你知道FlashBuilder和Maven构建我的应用程序有什么区别吗?谢谢你的回复。
答案 0 :(得分:0)
通过Flash Builder纯粹构建项目不会为您提供使用FlashBuilder / Maven集成构建项目所带来的敏捷开发。作为独立的开发环境,Flash构建器往往缺乏版本和依赖关系管理领域。正如您所看到的,您的项目会不断发展并达到新的版本,与使用Apache Ant任务运行器相比,您可以在这里找到使用Maven和Flash构建器的地方。任何可以帮助管理干净地管理依赖关系,支持模块化和易于管理的更新的东西绝对是值得的。如果您还没有,可能需要在flex / maven上签出adobe资源。
http://www.adobe.com/devnet/flex/articles/flex-maven-flexmojos-pt1.html