views:

20

answers:

1

I have a large module written in JS which uses Canvas to draw and animate trees. This module was written for a product which is now being migrated to flex.

Is there a way in flex to embed this JS module as is? Or would I have to rewrite the whole module in AS3 (shudder)? Further, if embedding is possible, would user interactions (mouse clicks) etc. work seamlessly?

An example of the tree structure I am talking about can be found here - http://thejit.org

+1  A: 

Don't know of anyway to embed JS into Flex, but it shouldn't be too difficult to convert to AS, just time consuming.

Another option, which really should just be an interim step to get the product out quicker is to open a browser within a frame in which you can just call the existing page in.

invertedSpear
The JS I am using has a lot of Canvas. I do not know the equivalents of Canvas drawing functions in AS. Can you please point me to a resource?
Crimson
there's a Canvas in AS, but I don't know if it's comparable to the Canvas in JS, sorry but I'm not going to be much help there, hopefully another SO user can help you, or you can research and see if the AS Canvas is what you need.
invertedSpear