Sunday, March 30, 2014

[ANE] Daily pitfall, ANE and Worker don't get along in constructor

Quick note for ANE and Worker when you got...
ReferenceError: Error #1065: Variable ... is not defined. at Main()

To reproduce

  1. get any ANE e.g. https://github.com/freshplanet/ANE-Alert/
  2. get helloworld Worker e.g. http://esdot.ca/site/2012/intro-to-as3-workers-hello-world
  3. and put both in constructor like this https://gist.github.com/katopz/9873681

Work around


  • don't alloc ANE and Worker in constructor together, let worker do their job in their thread and then alloc ANE in Main thread.

That's it! back to work!

No comments: