Error in as3 generation for Date?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Error in as3 generation for Date?

Dinkar Ganti
Hi,

Is there an error in generating as3 code correctly for Date.now()?
import mx.core.Container;
import mx.controls.Label;
class DateUtilTests {
  public function new(aContainer : Container) {
    try {
    var date = Date.now();
    var label = new Label();
    label.text = "The date " + Std.string(date);
    aContainer.addChild(label);
    }catch(err : Dynamic) {
      var errorLabel = new Label();
      errorLabel.text = "There is an error " + Std.string(err);
      aContainer.addChild(errorLabel);      
    }
  }
 
}


The above code returns type error : #1006. I am compiling this code
using Haxe Compiler 2.0 and generating as3 code. Is there a conflict between
the flex's default date and haxe's date. Is there a workaround that I
could use?

Thanks,
Dinkar

--
haXe - an open source web programming language
http://haxe.org

dinkar_ganti.vcf (202 bytes) Download Attachment