Apperemment cette commande est
actionscipt-classpath
et l'on obtient cette fois l'erreur suivante
Citation :
---------- Capture Output ----------
> "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" -jar /flex/lib/mxmlc.jar actionscript-classpath /flex/frameworks testas3.as
defaults: Error: unable to open './flex-config.xml'
> Terminated with exit code 2.
,
Why ?
Cette fois on enregistre le fichier d'exemple testas3.as dans le dossier suivant :
/flex/frameworks/testas3.as
et on compile sous crimson et l'on obtient le message suivant :
Citation :
---------- Capture Output ----------
> "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" -jar /flex/lib/mxmlc.jar actionscript-classpath /flex/frameworks testas3.as
Loading configuration file C:\Flex\frameworks\flex-config.xml, root element flex-config
Error: only one source is allowed in the filespec
Use 'mxmlc -help' for information about using the command line.
Total time: 350ms
Peak memory usage: 13 MB (Heap: 1, Non-Heap: 12)
> Terminated with exit code 2.
Apperemment cela à marcher
mais c'est tellement simple que je me sens vraiment bête, mais c'est cool.
avec la commande suivante :
-jar /flex/lib/mxmlc.jar $(FileName)
on obtient
Citation :
---------- Capture Output ----------
> "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" -jar /flex/lib/mxmlc.jar testas3.as
Loading configuration file C:\Flex\frameworks\flex-config.xml, root element flex-config
Initial setup: 1492ms
Loaded 8 SWCs: 3465ms
Compiling...
C:\Flex\frameworks\testas3.as: Error: A file found in an source-path 'testas3' must have the same name as the class definition inside the file 'Test'.
Files: 52 Time: 2764ms
Total time: 7751ms
Peak memory usage: 26 MB (Heap: 10, Non-Heap: 16)
> Terminated with exit code 2.
On change le nom du fichier testas3.as de telle manière qu'il ait le nom de la classe, cette fois on obtient
Citation :
---------- Capture Output ----------
> "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" -jar /flex/lib/mxmlc.jar Test.as
Loading configuration file C:\Flex\frameworks\flex-config.xml, root element flex-config
Initial setup: 1032ms
Loaded 8 SWCs: 2514ms
Compiling...
C:\Flex\frameworks\Test.as(7): col: 26 Error: Type was not found or was not a compile-time constant: TextField.
private var __test_txt:TextField;
^
C:\Flex\frameworks\Test.as(10): col: 20 Error: Call to a possibly undefined method TextField.
__test_txt = new TextField();
^
C:\Flex\frameworks\Test.as(3): col: 23 Error: Definition flash.display:TextField could not be found.
import flash.display.TextField;
^
Files: 52 Time: 2733ms
Total time: 6320ms
Peak memory usage: 27 MB (Heap: 10, Non-Heap: 17)
> Terminated with exit code 3.
Code
package {
import flash.display.Sprite;
import flash.display.TextField;
public class Test extends Sprite {
private var __test_txt:TextField;
public function Test() {
__test_txt = new TextField();
__test_txt.text = "Hello AS3!";
this.addChild(__test_txt);
}
}
}
Revenons à une version HelloWorld moins exotique
Code
package
{
import flash.display.MovieClip;
import flash.display.TextField;
public class Test extends MovieClip
{
public function TestAS3()
{
var t:TextField = new TextField();
t.text = "Hello World!";
addChild( t );
}
}
}
Et l'on obtient l'Output suivant :
Citation :
---------- Capture Output ----------
> "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" -jar /flex/lib/mxmlc.jar Test.as
Loading configuration file C:\Flex\frameworks\flex-config.xml, root element flex-config
Initial setup: 1032ms
Loaded 8 SWCs: 2463ms
Compiling...
C:\Flex\frameworks\Test.as(10): col: 9 Error: Type was not found or was not a compile-time constant: TextField.
var t:TextField = new TextField();
^
C:\Flex\frameworks\Test.as(10): col: 25 Error: Call to a possibly undefined method TextField.
var t:TextField = new TextField();
^
C:\Flex\frameworks\Test.as(4): col: 22 Error: Definition flash.display:TextField could not be found.
import flash.display.TextField;
^
Files: 54 Time: 2654ms
Total time: 6169ms
Peak memory usage: 28 MB (Heap: 11, Non-Heap: 17)
> Terminated with exit code 3.
Si quelqu'un à une explication ?
Merci !
Je pense qu'il faut éditer le fichier flex-config.xml
et ajouter un classpath mais lequel
...
Citation :
<library-path>
<path-element>libs</path-element>
<path-element>locale/{locale}</path-element>
...???...
</library-path>