# addCallBack Using SWF Object

**URL:** <https://forum.kirupa.com/t/addcallback-using-swf-object/203511>\
**Category:** Uncategorized\
**Created:** [October 11, 2006, 6:06pm UTC](https://forum.kirupa.com/t/addcallback-using-swf-object/203511 "2006-10-11T18:06:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewey](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dewey](https://forum.kirupa.com/u/dewey)\
**Post date:** [October 11, 2006, 6:06pm UTC](https://forum.kirupa.com/t/addcallback-using-swf-object/203511/1 "2006-10-11T18:06:44Z")

</div>

[FONT=Arial][SIZE=2]Hey All, I posted this in the Client-Side thread… but this one may be better…[/SIZE][/FONT]

[FONT=Arial][SIZE=2]I was wondering if anybody had a resource where I could find info on calling AS functions from JavaScript when using SWF Object.[/SIZE][/FONT]

[FONT=Arial][SIZE=2]Right now I have the plain old Flash code and this JavaScript function:[/SIZE][/FONT]

[LEFT][SIZE=2][COLOR=#7f0055]function [COLOR=#000000]re[/COLOR][/COLOR][/SIZE][SIZE=2]initialize() [/SIZE][SIZE=2][COLOR=#7f0055]{[/COLOR][/SIZE][/LEFT]  
[LEFT][SIZE=2][COLOR=#7f0055]if [/COLOR][/SIZE][SIZE=2](navigator.appName.indexOf([/SIZE][SIZE=2][COLOR=#8e00ff]“Microsoft”[/COLOR][/SIZE][SIZE=2]) != -1) [/SIZE][SIZE=2][COLOR=#7f0055]{[/COLOR][/SIZE][/LEFT]  
[LEFT][SIZE=2]flash = window.menubar;[/SIZE][/LEFT]  
[LEFT][SIZE=2][COLOR=#7f0055]}[/COLOR][/SIZE][/LEFT]  
[LEFT][SIZE=2][COLOR=#7f0055]else {[/COLOR][/SIZE][/LEFT]  
[LEFT][SIZE=2]flash = window.document.menubar;[/SIZE][/LEFT]  
[LEFT][SIZE=2][COLOR=#7f0055]}[/COLOR][/SIZE][/LEFT]  
[LEFT][SIZE=2]flash.runCollapseMenu();[/SIZE][/LEFT]  
[SIZE=2][COLOR=#7f0055]}[/COLOR][/SIZE]

[SIZE=2][COLOR=#7f0055][FONT=Arial][COLOR=#000000]Inside my AS file I have an ExternalInterface Callback set up to respond to runCollapseMenu…[/COLOR][/FONT][/COLOR][/SIZE]  
[SIZE=2][COLOR=#7f0055][FONT=Arial][COLOR=#000000]  
[/COLOR][/FONT][/COLOR][/SIZE]  
[SIZE=2][COLOR=#7f0055][FONT=Arial][COLOR=#000000]Obviously, now I do not have the same set up with SWF Object, so how would I go about re-writing this JS in order to work properly for me?[/COLOR][/FONT][/COLOR][/SIZE]  
[SIZE=2][COLOR=#7f0055][FONT=Arial][COLOR=#000000]Thanks,[/COLOR][/FONT][/COLOR][/SIZE]

[SIZE=2][COLOR=#7f0055][FONT=Arial][COLOR=#000000]–D[/COLOR][/FONT][/COLOR][/SIZE]
