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

Michael Pliskin pl at tepkom.ru
Tue Jan 16 17:05:08 CET 2007


Hello Carsten,

  I think you should add -swf-version 9 to your .hxml file or cmdline
  when invoking haXe - looks like you're compiling for flash 8 and
  trying to use flash 9 classes/API which of course won't work.

CS> I want to use the Flash9 API, especially the ByteArray class.
CS> Since it is defined in the file 'std/flash9/utils/ByteArray.hx', I tried in my code:
CS>     import flash9.utils.ByteArray;
CS> but on this line I get the error:
CS>     "Invalid package : flash9.utils should be flash.utils"

CS> But of course, when I do:
CS>     import flash.utils.ByteArray;
CS> I get the error:
CS>     "Class not found : flash.utils.ByteArray"
CS> That seems obvious, since there is no file 'std/flash/utils/ByteArray.hx'.

CS> Looking at the import file 'std/flash9/utils/ByteArray.hx', the first line is:
CS>     package flash.utils;
CS> This seems inconsistent. So I just tried changing this to
CS>     package flash9.utils;
CS> but it doesn't help either, instead it gives the error:
CS>     "Invalid package : flash9.utils should be flash.utils"
CS> on the line:
CS>     extern class ByteArray implements IDataInput, implements
CS> IDataOutput, implements ArrayAccess<Int> {

CS> So I think I got something wrong on how to import the flash9 classes.
CS> This is my first flash9 project. I got a test program to work
CS> with as2/mtasc, then ported it to haXe. 
CS> Now I want to use the new flash9 features to port an existing java app to flash.

CS> The haXe version I'm using is 1.10, compiled from the CVS at 13-Jan-2007.
CS> Browsing haxe.org and Google didn't help.
CS> Could someone give me a hint what I am missing?

CS> Thanks in advance.

CS>   


-- 
Best regards,
 Michael                            mailto:pl at tepkom.ru


More information about the Haxe mailing list