Details
Description
Problem in compiling the action script that uses flash.display.NativeMenuItem using flexTask.jar (ant).
Error:
Darlans-MacBook-Pro:testeGridComp darlan$ ant Buildfile: /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml compile: [echo] Compiling build/testeGridComp.swc [compc] Loading configuration file /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/compile-config.xml [compc] /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/src/br/com/test/Test.as(8): col: 61 Error: Incorrect number of arguments. Expected no more than 0. [compc] [compc] var fileMenu:NativeMenuItem = new NativeMenuItem("test", false); [compc] ^ [compc] BUILD FAILED /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml:30: compc task failed. Total time: 1 second Darlans-MacBook-Pro:testeGridComp darlan$ clear Darlans-MacBook-Pro:testeGridComp darlan$ ant Buildfile: /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml compile: [echo] Compiling build/testeGridComp.swc [compc] Loading configuration file /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/compile-config.xml [compc] /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/src/br/com/test/Test.as(8): col: 67 Error: Incorrect number of arguments. Expected no more than 0. [compc] [compc] var nativeMenuItem:NativeMenuItem = new NativeMenuItem("test", false); [compc] ^ [compc] BUILD FAILED /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml:30: compc task failed. Total time: 1 second
Code:
package br.com.test { import flash.display.NativeMenuItem; public class Test { public function createMenu():void { var nativeMenuItem:NativeMenuItem = new NativeMenuItem("test", false); } } }
Ant:
<project name="testeGridComp" default="compile" basedir="."> <property file="${basedir}/build.properties"/> <property file="${basedir}/env.properties"/> <property environment="env"/> <target name="compile" description="Compile testeGridComp.swc"> <echo message="Compiling build/testeGridComp.swc"/> <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/> <compc fork="true" output="${basedir}/build/testeGridComp.swc"> <jvmarg line="${compc.jvm.args}"/> <load-config filename="${basedir}/compile-config.xml" /> <include-sources dir="${basedir}/src" includes="*"/> <arg value="+playerglobal.version=${playerglobal.version}" /> <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> <arg value="+env.FLEX_HOME=${FLEX_HOME}" /> </compc> </target> </project>