[SWFObject] external interface problems

nyls info at nyls.nl
Mon Oct 16 07:21:23 PDT 2006


mmm.. when I browse in IE I see a javascript error before the page is
refreshed ?? 

Is that when you set the cookie ??? and after setting the cookie you
navigate to a different page ? 

Difficult to track the error when the page is refreshed. 

Nyls





-----Oorspronkelijk bericht-----
Van: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] Namens Maurice Moore
Verzonden: Monday, October 16, 2006 4:06 PM
Aan: swfobject at lists.deconcept.com
Onderwerp: Re: [SWFObject] external interface problems

hi Nyls,

here is the link

http://bmewaste.com.au

as I said, fine in firefox but IE gives errors.

thanks
Maurice


hi all,

i have read the posts about the updated version of 1.4.4 which is what i
am using.

i have a simple nav swf in a .net page. the nav swf is embedded with
this code

<script type="text/javascript">
   // <![CDATA[
   var fo = new SWFObject("/swf/navigation.swf", "nav", "771", "75",
"8", "#FFFFFF");
   fo.write('flash_container');
   // ]]>
</script>

and the .as file i include for the external interface is this

import flash.external.ExternalInterface;
/*
* CookieBroker Class to manage javascript cookies within the flash movie
*/
class CookieBroker
{
	//
	private static var write_cookie:String = "function set_cookie(name,
value, path) {  var cookie = name + \"=\" + escape(value) + \"; path=\"
+ escape(path); document.cookie = cookie; }";
	//
	private static var get_cookie:String = "function
get_cookie(cookie_name) { var results =
document.cookie.match(cookie_name + '=(.*?)(;|$)'); if (results) return
(unescape(results[1])); else return null; }";
	//
	private static var remove_cookie:String = "function
removeCookie(name){var cookie = name + \"=\";cookie += '; expires=Fri,
02-Jan-1970 00:00:00 GMT';document.cookie = cookie;}";
	//
	public static function SetCookie(name:String, value:String,
path:String):Void
	{
		ExternalInterface.call(write_cookie, name, value, path);
	}
	//
	public static function GetCookie(name:String):Object
	{
		return ExternalInterface.call(get_cookie, name);
	}
	//
	public static function DeleteCookie(name:String):Void
	{
		ExternalInterface.call(remove_cookie, name);
	}
}

when i run the page in FF there are no problems, but in IE i get three
errors.

1. 'nav' is undefined @ line 0
2. 'nav' is undefined @ line 0
3. 'nav' is undefined @ line 55

any ideas please?

regards,

Maurice
Click2Install Software


_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list