# Addressing flash objects in safari (external interface)

**URL:** <https://forum.kirupa.com/t/addressing-flash-objects-in-safari-external-interface/262018>\
**Category:** Uncategorized\
**Created:** [June 2, 2008, 5:27pm UTC](https://forum.kirupa.com/t/addressing-flash-objects-in-safari-external-interface/262018 "2008-06-02T17:27:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redSkyBurning](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@redSkyBurning](https://forum.kirupa.com/u/redSkyBurning)\
**Post date:** [June 2, 2008, 5:27pm UTC](https://forum.kirupa.com/t/addressing-flash-objects-in-safari-external-interface/262018/1 "2008-06-02T17:27:44Z")

</div>

hey actionscripters-

Working on a site that uses external interface to control the appearence of a number of buttons, setting color and text. The whole deal works fine in Firefox and IE (after vigorous debuggging), but I can’t seem to address the objects correctly in safari. The swfs are hard coded in and I’m using a function to find the reference to the object and then using an EI addcallback to set the values.

Here some javascript for the main functions:

```auto

function getMovieName(movieName) {
   if (window[movieName]) {
        if (window[movieName].id != undefined){
            //alert("explorer! window id: "+window[movieName].id);
            return window[movieName];
        } else {
            //alert("safari! window id: "+x.id);
            x = window[movieName];
            return x;
        }
   }
   else if (document[movieName]){
        //alert("firefox! document id: "+document[movieName].id);    
       return document[movieName];
   }
   else {
        alert("other");
   }
   
}

function setSwfColor(){
    var color = "<?php echo $skinColor; ?>";
    var headerTxt = "<?php echo $headerTxt; ?>";
    getMovieName("headerSwf").setBtn(color,headerTxt);
    getMovieName("btnSwf1").setBtn(color,"Home",false,"index.php?page=home");
    getMovieName("btnSwf2").setBtn(color,"Learn More",false,"index.php?page=learn");
    getMovieName("btnSwf3").setBtn(color,"Why Turn Key?",false,"index.php?page=why");
    getMovieName("btnSwf4").setBtn(color,"Who Is <?php echo $firstName; ?>?",false,"index.php?page=about");
    getMovieName("btnSwf5").setBtn(color,"myBiz News",true,"index.php?page=news");
    getMovieName("signUpSwf").setBtn(color);
    //alert("header set");
    getMovieName("arrowSwf").setBtn(color,"Take The Tour","<?php echo $mibLink;?>");
    
}

```

Here’s an example of one of the flash objects:

```auto

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="764" HEIGHT="146" id="headerSwf">
<PARAM NAME=movie VALUE="<?php echo $baseHref; ?>flash/dynoHeader.swf">
<param name=&#8217;allowScriptAccess&#8217; value=&#8217;always&#8217;/>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="<?php echo $baseHref; ?>flash/dynoHeader.swf" quality=high bgcolor=#FFFFFF WIDTH="764" HEIGHT="146" NAME="headerSwf" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />
</OBJECT>

```

This is what I’m on currently but I’ve tried everything I can think of to reference the object in the safari fork of getMovieName (document.getElementById, window[movieName], etc) but no luck! Currently safari error consol reads “Value undefined (result of expression getMovieName(“headerSwf”).setBtn) is not object.” I’m no javascript wizard, but I know enough to get by 95% of the time. What am I doing wrong here? Any help will be very much appreciated!

---

<div class="post-metadata">

**Author:** ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)\
**Post date:** [June 3, 2008, 3:17pm UTC](https://forum.kirupa.com/t/addressing-flash-objects-in-safari-external-interface/262018/2 "2008-06-03T15:17:24Z")

</div>

Well Adobe says External Interface will work on…

Internet Explorer 5.0 and higher  
Windows

Netscape 8.0 and higher  
Windows  
Macintosh

Mozilla 1.7.5 and higher  
Windows  
Macintosh

Firefox 1.0 and higher  
Windows  
Macintosh

Safari 1.3 and higher

Macintosh
