简体   繁体   English

在Flex应用程序中嵌入Javascript模块

[英]Embed Javascript Module within Flex application

I have a large module written in JS which uses Canvas to draw and animate trees. 我有一个用JS编写的大型模块,该模块使用Canvas绘制和设置树的动画。 This module was written for a product which is now being migrated to flex. 这个模块是为现在正在迁移到Flex的产品编写的。

Is there a way in flex to embed this JS module as is? flex中有没有办法按原样嵌入此JS模块? Or would I have to rewrite the whole module in AS3 (shudder)? 还是我必须在AS3(抖动)中重写整个模块? 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 我正在谈论的树结构示例可以在这里找到-http: //thejit.org

Don't know of anyway to embed JS into Flex, but it shouldn't be too difficult to convert to AS, just time consuming. 无论如何都不知道将JS嵌入到Flex中,但是转换成AS并不会太困难,而只是浪费时间。

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. 另一个选择(实际上应该只是使产品更快推出的一个临时步骤)是在框架内打开浏览器,您可以在其中调用现有页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM