Hello!
I've made a flash banner that's being used for navigation in my Wordpress header. I'm trying to get the Log Out button to function correctly though, and it's giving me some trouble.
What I've tried is making a FlashVar named logout_url. The contents of this FlashVar are:
<?php echo wp_logout_url( get_bloginfo('url') )); ?>
I have the contents of this FlashVar getting passed to the swf file, which uses the following ActionScript 3 code to first call the FlashVar and then place it into the Log Out button:
var logout_url:String = flashvars.logout_url;
this.user_logged_in_button.addEventListener(MouseEvent.CLICK,user_logged_in_function);
function user_logged_in_function(event:MouseEvent):void{
navigateToURL(new URLRequest(flashvars.logout_url), "_self");
}
When I view my site, I can View Source and see the URL being generated just fine as the FlashVar, including the _wpnonce and redirect info. I've even pasted the same PHP into a normal text link on the page for testing purposes, and it functions perfectly. However, the Log Out button in the flash banner is not working correctly. It's taking me to a page that simply says:
You are attempting to log out of YourSiteName
Please try again.
Like I said, when I View Source I can see that the entire URL is indeed being generated in the FlashVar. For some reason that I can't explain though, the Log Out button in the swf is not working the way that the regular text link does, when both the FlashVar and the text link use identical code. It's as if only the _wpnonce part of the URL is failing to be passed to Flash, although I can't say with certainty that that's exactly what's going on and causing this.
Does anybody have any ideas as to what the problem might be? I'm totally stumped.