Keep in mind as a second parameter to ExternalInerface.call() you can pass arguments. There's actually some hidden power to EI where the js doesn't even need to exist physically in the html. You can actually write js right from EI and then call it and or delete it later. http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in-ActionScript-3/Page1.html
On Mon, Sep 28, 2009 at 2:24 PM, Gregory Boland <[email protected]>wrote: > yup just like that > > On Mon, Sep 28, 2009 at 2:17 PM, Gustavo Duenas < > [email protected]> wrote: > > > Ok, thanks, so it should work this way right? > > > > Gustavi > > > > On Sep 28, 2009, at 12:53 PM, Gregory Boland wrote: > > > > thats essentially it. > >> > >> Syntax is slightly different.... > >> > >> if (ExternalInterface.available){ > >> ExternalInterface.call("openMyWindow");} > >> } > >> > >> make sure to import flash.external.ExternalInterface; > >> > >> and when u tell it what the name of the method in the javascript is > leave > >> off the () > >> > >> > >> > >> On Mon, Sep 28, 2009 at 12:18 PM, Gustavo Duenas < > >> [email protected]> wrote: > >> > >> Hi I have a function in javascript on the html > >>> > >>> like: > >>> > >>> <script type="javascript"> > >>> > >>> function openMyWindow(){ > >>> document.getElementByID(myWindow).setStyle(etc) > >>> } > >>> > >>> and I would like to use it from falsh something like this: > >>> > >>> mybutton.addEventlistener(MouseEvent.CLICK, contactJavascript); > >>> > >>> function contactJavascript(e:MouseEvent):void{ > >>> > >>> if (externalInterface.available){ > >>> externalInterface.call("openMyWindow()"); > >>> } > >>> > >>> let me know if this could work at all. > >>> I'm trying to find a google about it, but all seems so obscure > >>> any help appreciated > >>> > >>> _______________________________________________ > >>> Flashcoders mailing list > >>> [email protected] > >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >>> > >>> _______________________________________________ > >> Flashcoders mailing list > >> [email protected] > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > >> > > > > > > > > _______________________________________________ > > Flashcoders mailing list > > [email protected] > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- --Joel Stransky stranskydesign.com _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

