Hello!
I have made a navigation banner in flash for a blog site, but the banner is giving me trouble in Internet Explorer. The Flash file has two buttons, one for “Log In” and one for “Log Out”, that are supposed to be visible/invisible depending on whether or not the user is logged in to the blog or not. To achieve this, I have set up a Param tag that checks to see if the user is logged in or not, and then reports this true or false data to the Flash movie as being either “1” or “0” in the form of a variable. The Actionscript in Flash then uses this data to make one button visible, and the other not visible.
This is working perfectly in Firefox, but for some reason in Internet Explorer (tested in IEv8) both buttons are visible at all times. Both Firefox and Internet Explorer are running the same version of FlashPlayer (v10). Here is the code that I’m using… can you please let me know if you see what might be causing this problem?
First, the code in the .php file:
<object width="100%" height="100%"><param name="movie" value="http://www.beingray.net/blog/wp-content/uploads/topbanner.swf">
<PARAM NAME=FlashVars VALUE="is_user_logged_in=<?php echo(is_user_logged_in() ? "1" : "0"); ?>">
<param name="allowScriptAccess" value="always">
<embed src="http://www.beingray.net/blog/wp-content/uploads/topbanner.swf" width="100%" height="100%" allowScriptAccess="always" salign="tr" FlashVars="is_user_logged_in=<?php echo(is_user_logged_in() ? "1" : "0"); ?>"></embed></object>
[is_user_logged_in() is a function of Wordpress, which is powering the entire site. This seems to work fine, as the code correctly shows a value of 0 or 1 after loading the site and viewing the page source, both while logged in and while logged out. Plus, as I’ve said, the entire banner works perfectly in Firefox too.]
Second, the Actionscript code (which is in its own layer in the first and only frame of the timeline):
function loaderComplete(myEvent:Event)
{
var flashVars=this.loaderInfo.parameters;
if (flashVars.is_user_logged_in == "0")
{
this.user_logged_out_button.visible = true;
this.user_logged_in_button.visible = false;
}
else
{
this.user_logged_out_button.visible = false;
this.user_logged_in_button.visible = true;
}
}
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
//The following two buttons are for Log In and Log Out.
this.user_logged_in_button.addEventListener(MouseEvent.CLICK,user_logged_in_function);
function user_logged_in_function(event:MouseEvent):void{
navigateToURL(new URLRequest("http://beingray.net/blog/wp-login.php?action=logout&_wpnonce=3046ba8c96"), "_self");
}
this.user_logged_out_button.addEventListener(MouseEvent.CLICK,user_logged_out_function);
function user_logged_out_function(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.beingray.net/blog/wp-login.php"), "_self");
}
//The rest of the buttons are for other links not related to the problem at hand... or at least I dno't think they're related.
this.sitemain_button.addEventListener(MouseEvent.CLICK,sitemain_function);
function sitemain_function(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.beingray.net"), "_self");
}
this.archives_button.addEventListener(MouseEvent.CLICK,archives_function);
function archives_function(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.beingray.net/blog/?page_id=4"), "_self");
}
this.blogmain_button.addEventListener(MouseEvent.CLICK,blogmain_function);
function blogmain_function(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.beingray.net/blog"), "_self");
}
To check it out online, you can go to beingray.net/blog where it’s already up and running. For me, sometimes when I clear all of my data from Internet Explorer it will display correctly upon the first visit to the page… but then if I click on any of the links, the buttons go buggy again.
I would immensely appreciate any and all help that I can get with this problem! I’m very new to this Flash stuff and don’t even know what could potentially cause a fluke difference between browsers like this. Why would both buttons always be visible in Internet Explorer when things work as intended in Firefox? Thank you very much to all those who take the time to read this, and an extra special thanks to those who offer their help. 