Crossbridge-Recast-Navigation
Crossbridge-Recast-Navigation copied to clipboard
problems building the demo
Hi Vladimir,
I tried following the instructions and this is where I'm stuck with an error.
CustomRCContext.as(12): col: 78 Error: Implicit coercion of a value of type Class to an unrelated type flash.events:IEventDispatcher.
Pointing to CustomRCContext.as:
public class CustomRCContext extends RCContext implements IEventDispatcher
{
private const _eventDispatcher:EventDispatcher = new EventDispatcher(this);
private const _logCategoryNames:Vector.<String> = new <String>[
"", "Progress", "Warning", "Error"
];
It's highlighting the 'this' part as the error. If I switched from MainApplication and uncomment to the TestApplication, it builds fine but crashes after launch. This is both as AS3 or AIR Mobile project.
Any ideas? Thanks.
It's some strange AS compiler behavior I keep encountering recently. It's weird because 'this' keyword in such scope has always pointed to the instance of a class, not class itself. Adding explicit cast here should fix the problem:
private const _eventDispatcher:EventDispatcher = new EventDispatcher(IEventDispatcher(this));
Thanks Vladimir, With your fix above, it did build and ran ok now but for some reason when I select any obj file from the dropdown selection, it won't load them. There's no error message. I used the standard AS3 project to replicate your sample web demo.
I hope it's not related to the feathers library, as I have trouble loading the provided mobiletheme folder (even if added to src) so I replaced it with my own copy of starling (not 2.0) + feathers + mobiletheme, all in swc format.