> So far looks good. Only one error I couldn't figure out:
> 
> class Hello {
>               function new() {
>                       // creates a textfield named 'tf'
>                       for i in 0...5 {
>                               
> Boot.current.createTextField("tf"+i,i,i,i,Stage.width,Stage.height);
>                               var tf : TextField = Boot.current["tf"+i]; // 
> throws compiler error
>                               tf.text = "hello world !";
>                       }
>               }
>               static var init : Hello = new Hello();
> }
> 
> (18:34:31 <~/working/haxe_test>) 0 $ haxe -cp . -cp std -cp flash/ -swf 
> hello.swf Hello -v; open hello.swf
> Classpath : /usr/local/bin/flash/;flash/;std/;./;/usr/local/bin/std/;;/
> ./Hello.hx:6: characters 38-44 : String should be Int
> 
> I should be able to do this, right?

No, you can't.
I mean, you CAN be the type system forbid you to do it.
In haXe, brackets [] accesses are only for Arrays, and MovieClip is not 
an Array.

You can use untyped for that, since it will skip the type checks :

var tf : TextField = untyped Boot.current["tf"+i];

Nicolas

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to