# Javascript Integeration

**URL:** <https://forum.kirupa.com/t/javascript-integeration/179698>\
**Category:** Uncategorized\
**Created:** [February 22, 2006, 12:16pm UTC](https://forum.kirupa.com/t/javascript-integeration/179698 "2006-02-22T12:16:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcancert](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kcancert](https://forum.kirupa.com/u/kcancert)\
**Post date:** [February 22, 2006, 12:16pm UTC](https://forum.kirupa.com/t/javascript-integeration/179698/1 "2006-02-22T12:16:27Z")

</div>

Hi,

This is really blowing up my brains Please HELP. Somebody Please help me ☹

The Javascript integeration in flash8 has totally changed. There are some few more steps to follow. I went through the online help available on [macromedia.com](http://macromedia.com) and also I tried to read many other explanations but being a newBee to actionScripts, I could not figure out the

externalInterface and addCallback

Can anyOne please help. In myCase I have tried something fancy like the browsershake into an animation.

1. The html page of my animation contains the following script -

\<SCRIPT LANGUAGE=“JavaScript1.2”\>  
function shake\_xy(n) {  
if (self.moveBy) {  
for (i = 10; i \> 0; i–) {  
for (j = n; j \> 0; j–) {  
self.moveBy(0,i);  
self.moveBy(i,0);  
self.moveBy(0,-i);  
self.moveBy(-i,0);  
}  
}  
}  
}  
function shake\_x(n) {  
if (self.moveBy) {  
for (i = 10; i \> 0; i–) {  
for (j = n; j \> 0; j–) {  
self.moveBy(i,0);  
self.moveBy(-i,0);  
}  
}  
}  
}  
function shake\_y(n) {  
if (self.moveBy) {  
for (i = 10; i \> 0; i–) {  
for (j = n; j \> 0; j–) {  
self.moveBy(0,i);  
self.moveBy(0,-i);  
}  
}  
}  
}  
//–\>  
\</SCRIPT\>  
[CENTER]\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_[/CENTER]

The frame in flash where I need the browser to shake has the following script -

getURL(“javascript:shake\_x(20)”);

I would just like to know how to make it work in flash8 using the externalInterface and addCallback. I have the sourceFIles [here](http://www.kcalpesh.com/browsershake.zip)

Thanks,  
Regards:)

---

<div class="post-metadata">

**Author:** ![kcancert](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kcancert](https://forum.kirupa.com/u/kcancert)\
**Post date:** [March 24, 2006, 6:07am UTC](https://forum.kirupa.com/t/javascript-integeration/179698/2 "2006-03-24T06:07:06Z")

</div>

> [@devonair](#):
>
> From what I’ve read (and experienced) the External API, doesn’t work with Internet Explorer. There are a few user comments posted at the livedocs page, but no response from Adobe, so I don’t know if they’re working on this or not. Be nice if they were… So, if you’re testing in IE, that could be one problem…  
> The next thing I see, is that, not only are you using the wrong syntax, but the function you’re calling isn’t the name of the function you wrote… that could be another huge problem…  
> I would suggest trying something simple - like just copying and pasting an example script from the help file [http://livedocs.macromedia.com/flash/8/main/00002203.html](http://livedocs.macromedia.com/flash/8/main/00002203.html) and see if that works in the browser you’re using… If it does, then you could just adjust the script so it calls your own function… If it doesn’t, well, you could try another browser (I don’t know if anything but IE supports that shaking thing though)…
> 
> In any case, if anyone knows a workaround to the IE bug, please let us know…

Yup You are right. I am trying once again. … .:?)
