Greetings

Sorry for the long title, but I wanted you to know what you were in for. Actually I've seen similar topics but try as I might, I can't tweek the examples to work for me.

Here is what I have. OK... still new with AS, but I have a Website were you change the content of a DIV with a link. You do this with Javascript:
Code:
function switchContent(obj) {

		obj = (!obj) ? 'content1' : obj;

		var contentDivs = document.getElementById('center').getElementsByTagName('div');
		for (i=0; i<contentDivs.length; i++) {
			if (contentDivs[i].id && contentDivs[i].id.indexOf('content') != -1) {
				contentDivs[i].className = 'hide';
			}
		}
		document.getElementById(obj).className = '';
	
	}
Then I set the DIV's like so:

Code:
<div id="center">
  	<!--start content1 - home -->
    <div id="content1">
      Content for  id "content1" Goes Here    </div>
      <!--end content1 - home -->
      <!--start content2 - info -->
    <div id="content2" class="hide">
    Content for  id "content2" Goes Here    </div>
      <!--end content2 - info -->
      <!--start content3 - work -->
    <div id="content3" class="hide">Content for  id "content3" Goes Here</div>
      <!--end content3 - work -->
      <!--start content4 - contact -->
    <div id="content4" class="hide">Content for  id "content4" Goes Here</div>
      <!--end content4 - contact -->  
    <!--start bottom -->
    <div id="bottom"></div>
      <!--end bottom -->
  </div>
  <!--end content -->
Now getting this to work with a basic link like so:

Code:
<a href="#" onClick="switchContent('content3'); return false;">link2</a>
...is no sweat, BUT when I try to place my custom Flash SWF button file in there, no dice.

I've found a way to do this using ExternalInterface. However I'm unsure about the way to call it.

If my Javascript is a a function called 'switchContent' saved in a file named 'switchContent.js' saved in a directory named 'Scripts' saved in a directory that contains the html file, what should the AS look like then?

on (press) {
import flash.external.ExternalInterface;
ExternalInterface.call("switchContent", "center");
}

OR...

on (press) {
import flash.external.ExternalInterface;
ExternalInterface.call("switchContent", "content");
}

btw, I've tried both and neither are working currently.

OR... should I just put the javascript in the head tag?

And am I right in putting the AS in the first frame of a actions layer on the main timeline of my movieclip button? HELP!!!

Thanks in advance.