开发者

How to integrate flex swf file in java script?

We implemented one concept in Flex and now would like to integrate with JavaScript. Earlier we integrated an Applet code but now, we developed the conc开发者_JAVA百科ept in Flex, however, I am unable to integrate the concept in java script.

Can anyone help me out with the procedure to integrate flex swf file in java script ?

Here is my earlier java script code :

var file=gup('query'); //document.write(file); var prevFile=gup('prevFileName'); //document.write(prevFile); document.write("");

document.write(""); function gup( name ) { name = name.replace(/[[]/,"\[").replace(/[]]/,"\]"); var regexS = "[\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; }

Thanks in advance.


I'm not exactly clear what you're trying to do… But you'd need to use the ExternalInterface class to let JavaScript code call into Flex, and Flex code call into JavaScript. For example, to call a JS function from Flex:

var result:* = ExternalInterface.call("myFunction", arg1, arg2)

Also, if you're trying to embed the SWF into the HTML page, SWFObject is your friend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜