Thank you very much, Abdul. :-) --Feng Abdul Qabiz wrote: Following code shows the right way, please read the documentation of " Flash _javascript_ Integration Kit":http://osflash.org/doku.php?id=flashjs You need to place "com\macromedia\_javascript_\" directory, _javascript_FlashGateway.js and _javascript_FlashGateway.swf next to file and you need other files. That's why I am asking you to read documentation on above link to get an idea, how to setup the Flash _javascript_ Integration Kit. ##FJIKExample.jsp## <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib uri="FlexTagLib" prefix="mm" %> <HTML> <HEAD> <script type="text/_javascript_" src=""></script> <script language="_javascript_"> window. function confirmExit() { var flashProxy = new FlashProxy('mmid', '_javascript_FlashGateway.swf'); flashProxy.call('comm'); return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; } </script> <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK" %> <META http-equiv="Content-Type" content="text/html; charset=GBK"> <META name="GENERATOR" content="IBM WebSphere Studio"> <META http-equiv="Content-Style-Type" content="text/css"> <LINK href="" rel="stylesheet" type="text/css"> <TITLE>test.jsp</TITLE> </HEAD> <BODY> <mm:mxml id="mmapp" name="mmapp"> <mm:flashvar name="lcId" value="mmid" /> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" creationComplete="onAppInit()"> <mx:Script> <![CDATA[ import com.macromedia._javascript_._javascript_Proxy; var jsProxy:_javascript_Proxy; var lcId:String; function onAppInit() { jsProxy = new _javascript_Proxy(lcId, this); } function comm(){ alert("in flash"); trace("!!!ZF, this in test JS and AS communication"); } ]]> </mx:Script> <mx:Button label="click" click="comm();"/> </mx:Application> </mm:mxml> </BODY> </HTML> -abdul -----Original Message----- From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Abdul Qabiz Sent: Wednesday, June 29, 2005 4:17 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] puzzled with _javascript_ and Flash Integration Kit Hold on, I will post an example...something is going wrong here... I am in meeting now :) -abdul -----Original Message----- From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Banks Sent: Wednesday, June 29, 2005 3:57 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] puzzled with _javascript_ and Flash Integration Kit Hi, Abdul, Thank you very much. i try this, but it does not take the effect. my jsp file is : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib uri="FlexTagLib" prefix="mm" %> <HTML> <HEAD> <script type="text/_javascript_" src=""></script> <script type="text/_javascript_" src=""></script> <script type="text/_javascript_" src=""></script> <script type="text/_javascript_" src=""></script> <script language="_javascript_"> window. function confirmExit() { var flashProxy = new FlashProxy('mmid', 'mmapp'); flashProxy.call('comm'); return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; } </script> <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK" %> <META http-equiv="Content-Type" content="text/html; charset=GBK"> <META name="GENERATOR" content="IBM WebSphere Studio"> <META http-equiv="Content-Style-Type" content="text/css"> <LINK href="" rel="stylesheet" type="text/css"> <TITLE>test.jsp</TITLE> </HEAD> <mm:mxml id="mmapp" name="mmapp"> <mm:flashvar name="lcId" value="mmid" /> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ function comm(){ alert("in flash"); trace("!!!ZF, this in test JS and AS communication"); } ]]> </mx:Script> <mx:Button label="click" click="comm();"/> </mx:Application> </mm:mxml> </HTML> Abdul Qabiz wrote:Yeah... That should work, as long as you are also passing lcId to Flex AppusingFlashVars attribute of <mm:mxml ../> like this: <mm:mxml> <mm:flashvar name="lcId" value="<%= lcId %>" /> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> </mx:Application> </mm:mxml> -abdul -----Original Message----- From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Banks Sent: Wednesday, June 29, 2005 12:01 PM To: [EMAIL PROTECTED] Com Subject: [flexcoders] puzzled with _javascript_ and Flash Integration Kit Hi, All, I am try to use this tool. But as an flex new user, I am be puzzledwiththis tool. The docs for this are about the flash file. if i place this tag "<mm:mxml source="/Test/test.mxml" id="mmapp" name="mmapp"/>" in my JSP file, does this mean I can construct the flashProxy like this: var flashProxy = new FlashProxy('mmapp', 'mmapp');-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com ---- LSpots keywords ?> ---- HM ADS ?> YAHOO! GROUPS LINKS
|