The ExternaInterface API makes it very simple to call methods in the
enclosing wrapper. You use the static call() method, which has the following
signature:

*
Flash.external.ExternalInterface.call(function_name:String[,arg1,…]):Object;
*

The following example script block calls the JavaScript f() function in the
enclosing wrapper by using the call() method:

<mx:Script>

<?xml version="1.0" encoding="iso-8859-1"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

    <mx:Script>

        import flash.external.*;

            public function callWrapper():void

         {

            var f:String = "changeDocumentTitle";

            var m:String =     ExternalInterface.call(f,"New Title");

            trace(m);

        }

    </mx:Script>

    <mx:Button label="Change Document Title" click="callWrapper()"/>

</mx:Application>





On Thu, Apr 2, 2009 at 3:23 PM, VJ <[email protected]> wrote:

>
> Hi all,
>
> Has anybody worked on communicating betwen actionscript and
> javascript.
> Actually I have a javascript application which uses the flex code, so
> for this i will be including the swf in the html page with javascript
> written for functionality, this javascript in turn will access some
> methods from flex (i.e. swf). So is anyone aware of this?
>
> - Vijayata
> >
>


-- 
Thanks & Regards,

Jagan Mady's

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to