Re: [Flashcoders] best way to use external interface

2009-09-30 Thread Joel Stransky
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
breakfastcof...@gmail.comwrote:

 yup just like that

 On Mon, Sep 28, 2009 at 2:17 PM, Gustavo Duenas 
 gdue...@leftandrightsolutions.com 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 
  gdue...@leftandrightsolutions.com 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
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
   ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] best way to use external interface

2009-09-28 Thread Gustavo Duenas

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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] best way to use external interface

2009-09-28 Thread Gregory Boland
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 
gdue...@leftandrightsolutions.com 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
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] best way to use external interface

2009-09-28 Thread Gustavo Duenas

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 
gdue...@leftandrightsolutions.com 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] best way to use external interface

2009-09-28 Thread Gregory Boland
yup just like that

On Mon, Sep 28, 2009 at 2:17 PM, Gustavo Duenas 
gdue...@leftandrightsolutions.com 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 
 gdue...@leftandrightsolutions.com 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
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders