[haXe] "Invalid package : flash9.utils should be flash.utils" ?

Mark Winterhalder mark13 at gmail.com
Tue Jan 16 17:06:06 CET 2007


Hi,

you never import as flash9.*, always as flash.* -- the distinction is
made through the -swf-version compiler argument. haXe will use the
flash9.* packages if it is set to 9.

So...:

import flash.utils.ByteArray;

class Test {
   public static function main () {
      var foo = new ByteArray();
   }
}

...must be compiled like:

haxe -swf-version 9 ...

HTH,
Mark



On 1/16/07, Carsten Spanheimer <cspan at mcw.de> wrote:
> Hi there,
>
> I want to use the Flash9 API, especially the ByteArray class.
> Since it is defined in the file
> 'std/flash9/utils/ByteArray.hx', I tried in my code:
>     import flash9.utils.ByteArray;
> but on this line I get the error:
>     "Invalid package : flash9.utils should be flash.utils"
>
> But of course, when I do:
>     import flash.utils.ByteArray;
> I get the error:
>     "Class not found : flash.utils.ByteArray"
> That seems obvious, since there is no file 'std/flash/utils/ByteArray.hx'.
>
> Looking at the import file 'std/flash9/utils/ByteArray.hx',
> the first line is:
>     package flash.utils;
> This seems inconsistent. So I just tried changing this to
>     package flash9.utils;
> but it doesn't help either, instead it gives the error:
>     "Invalid package : flash9.utils should be flash.utils"
> on the line:
>     extern class ByteArray implements IDataInput, implements IDataOutput,
> implements ArrayAccess<Int> {
>
> So I think I got something wrong on how to import the flash9 classes.
> This is my first flash9 project. I got a test program to work with
> as2/mtasc, then ported it to haXe.
> Now I want to use the new flash9 features to port an existing java app to
> flash.
>
> The haXe version I'm using is 1.10, compiled from the CVS at 13-Jan-2007.
> Browsing haxe.org and Google didn't help.
> Could someone give me a hint what I am missing?
>
> Thanks in advance.
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
>



More information about the Haxe mailing list