Lets say I pick up a pure Javascript library… one that doesn’t rely on the DOM in any way.
Now, lets say I want to take that library and us it in Flex. Is there any good way to do this? I can’t simply include the Javascript, as it is not close enough to ActionScript to compile… but is there a good converter that will do it for me? Take the Javascript prototype style classes and convert it to ActionScript classes?
Lastly, I don’t want to use the Browser for this. I know that I can always use ExternalInterface to access the browser, but I am not always running my Flex app in the browser… sometimes it is Air, and sometimes it is in a PDF.
Any thoughts on this?
Usually porting from JS to AS isn’t too hard. But you might want to check out Jangaroo. It goes the other direction, AS -> JS but might be able to be used in reverse.