[SWFObject] how to load variables?

Anthony Connelly tjcdesigner at yahoo.com
Wed May 10 14:48:20 PDT 2006


I am trying to pass a variable to play an mc button on
my stage to show it selected, named tenders_btn. When
testing the function by manually declaring the
variable on the root of the stage, it works fine and
shows the mc button as selected. Like this in Flash:

var menuItem = tenders_btn;

var selectItem = function (menuItem) {
	_root.menuItem.gotoAndStop("selected");
};
selectItem(menuItem);

But when getting rid of the variable in flash and
trying SWFObject on the page as:

<script type="text/javascript"
src="swfobject.js"></script>
		
<div id="flashcontent2">
  <span class="addressItemBold">You must have
Javascript enabled and Flash 8 installed to view this
site properly</span>.</div>

<script type="text/javascript">
   var so = new SWFObject("menu_nav.swf", "mymovie",
"190", "160", "8", "#FDF6EC");
   so.addVariable("menuItem", "tenders_btn");
   so.write("flashcontent2");
</script>
               
The button does not gotoAndStop at the selected frame
when opening this page. What am I missing? Is there
code that needs to be in Flash to load these
variables? Is it something to do with quotes?



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Swfobject mailing list