# External Interface\> local = ok server = nope

**URL:** <https://forum.kirupa.com/t/external-interface-local-ok-server-nope/207808>\
**Category:** flash\
**Created:** [November 21, 2006, 6:39pm UTC](https://forum.kirupa.com/t/external-interface-local-ok-server-nope/207808 "2006-11-21T18:39:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedro\_paulo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pedro_paulo/32/2017_2.png) [@pedro\_paulo](https://forum.kirupa.com/u/pedro_paulo)\
**Post date:** [November 21, 2006, 6:39pm UTC](https://forum.kirupa.com/t/external-interface-local-ok-server-nope/207808/1 "2006-11-21T18:39:25Z")

</div>

Hi, guys!

A interesting problem:

I have a function on my fla that executes many things. All these things depends of a number parameter.

Ok. No problem with this. But now I must call this function through a html link at the same flash´s page.

So, my way is the External Interface class.

When I try it at my local pc, everything is great. But when I upload it, it stops working!

The flash code:

> 

// importing the flash external interface:  
import flash.external.ExternalInterface;  
// the function:  
function pedirAnunciante(codigoAnunciante) {  
// many codes here…  
}  
// the addCallBack method:  
ExternalInterface.addCallback(“pedirAnunciante”, this, pedirAnunciante);

The HTML code:

> 

\<html xmlns=“[XHTML namespace](http://www.w3.org/1999/xhtml)” xml:lang=“en” lang=“en”\>  
\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /\>  
\<title\>interna\_javascript\</title\>  
\<script language=“JavaScript”\>  
var flash;  
//  
window.onload = function() {  
if(navigator.appName.indexOf(“Microsoft”) != -1) {  
flash = window.vitrine;  
}else {  
flash = window.document.[COLOR=Red]vitrine; [/COLOR]  
}  
}  
//  
//  
function comandaFlash(num) {  
flash.pedirAnunciante(num);  
//alert(num);  
}  
//  
\</script\>  
\</head\>  
\<body bgcolor=“#ffffff”\>  
\<object classid=“clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” codebase=“[http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0](http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0)” width=“775” height=“630” [COLOR=Red]id=“vitrine”[/COLOR] align=“middle”\>  
\<param name=“allowScriptAccess” value=“sameDomain” /\>  
\<param name=“movie” value=“interna\_javascript.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<param name=“bgcolor” value=“#ffffff” /\>  
\<embed src=“interna\_javascript.swf” [COLOR=Red]id=“vitrine” [/COLOR]quality=“high” bgcolor=“#ffffff” width=“775” height=“630” name=“interna\_javascript” align=“middle” allowScriptAccess=“sameDomain” type=“application/x-shockwave-flash” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” /\>  
\</object\>  
\<br\>  
\<input type=“Button” value=“Anunciante 508” name=“flashInfoButton” [COLOR=Red]onClick=“javascript:comandaFlash(508);”[/COLOR] style=“width:100px;” /\>  
\<br\>  
\<input type=“Button” value=“Anunciante 49” name=“flashInfoButton” [COLOR=Red]onClick=“javascript:comandaFlash(49);”[/COLOR] style=“width:100px;” /\>  
\<br\>  
\<input type=“Button” value=“Anunciante 427” name=“flashInfoButton” [COLOR=Red]onClick=“javascript:comandaFlash(427);” [/COLOR]style=“width:100px;” /\>  
\<br\>  
\</html\>
