Hi Manish,
 
I guess the below works out for U!!!
Try it out!!
 
 
Code for Mxml:
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
 <mx:Script>
 <![CDATA[
  import mx.controls.Alert
  
  function callJS(){
   Alert.show("Clicked on Btn")
   var someText = "SomeText from FLex";
   getURL("_javascript_:jsFun('"+someText+"')");
   
  }
 ]]>
 </mx:Script>
 <mx:Canvas> 
  <mx:Button label="click" click="callJS()"/>
 </mx:Canvas>
</mx:Application>
 
Code for embedding mxml in HTML and call JS
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Flex n HTML</title>
<script language="_javascript_">
 function jsFun(txt){
  alert(txt)
 }
</script>
</head>
 <body>
  <object classid="" codebase="" href="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"> http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="200">
    <param name="movie" value="imageClick.mxml.swf">
    <param name="quality" value="high">
    <embed src="" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer " type="application/x-shockwave-flash" width="200" height="200"></embed>
  </object>
 </body>
</html>
 
The first block gives you the structure of Mxml code, a button that calls an AS function which uses to getURL() to call Js function.
 
The sec block is just html page that has mxml embedded in it and js function (jsFun) that is being referred by AS.

 
On 10/8/05, Manish Jethani <[EMAIL PROTECTED]> wrote:
On 10/7/05, djok_fb <[EMAIL PROTECTED]> wrote:

> 1-Embed the mxml file in a HTML page:
> <html>
> <head>
> <script type="_javascript_">
>         function launchSpellChecker(someText) {
>                 alert(someText);
>         }
> </script>
> </head>
> <body>
[snip]

> 2- Write a AS function using getURL:
>         function doSpellCheck( textToCheck ) {
>                 getURL("_javascript_:launchSpellChecker('" + textToCheck +
> "');void(0);");
>         }

> 3- Link the function to a button
>
> The AS function is called but IE tells me "Object not found".
> I tried with Firefox (w/ _javascript_ debugger) and it tells me:
> "launchSpellChecker function not found".

I don't see anything obviously wrong.  What version of IE are you using?


------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->

--
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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to