I’ve been trying to tackle this problem for hours now and am becoming ever more frustrated.
I have a flash file that takes up the entire browser window, except for the bottom of the window where I have HTML Buttons that on rollover were meant to trigger animations on the island.
Basically there are 7 buildings on the flash file that when hovered over create a glow effect, these buttons are related to the HTML Buttons which when rolled over are suppose to trigger each other (rollover a building, the corresponding HTML button looks pressed in, and vice versa)
Unfortunately I can’t seem to get the Javascript to successfully call the Flash File, I have taken code online and reproduced it to no success.
**
In the Flash File:**
import flash.external.ExternalInterface;
var all:Array = new Array(greencenter,yogacenter,mediacenter,metaphysicalcenter,travelcenter,shoppingcenter,wellnesscenter);
ExternalInterface.addCallback('sendTextToFlash', getTextFromJavaScript);
function getTextFromJavaScript(str):void {
all[str].gotoAndPlay(2);
water.alpha = 1;
}
// The water.alpha = 1 was an attempt to make (Anything appear but neither are working)
In the javascript file:
$(document).ready(function(){
$(".green > a").hover(function(){ setCurrentPage(1); });
function setCurrentPage(newPage) {
SendDataToFlashMovie(newPage);
}
function getFlashMovieObject(movieName){
if (window.document[movieName]){
return window.document[movieName];
}
if (navigator.appName.indexOf('Microsoft Internet')==-1){
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf(”Microsoft Internet”)!=-1)
{
return document.getElementById(movieName);
}
}
function SendDataToFlashMovie(newPage){
var flashMovie=getFlashMovieObject('island');
alert(flashMovie);
flashMovie.sendTextToFlash(newPage);
}
});
// This is successfully alerting the flashMovie as far as I can tell.
This is in the HTML:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="island" title="island">
<param name="movie" value="fla/site.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="js/expressInstall.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="fla/site.swf" width="100%" height="100%">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swliveconnect" value="true" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="js/expressInstall.swf" />
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
I’ve been trying different things for hours but something isn’t connecting properly and I am at a loss to what. Does anyone see anything missing!?
HELP!