[SWFObject] filter functions out of params/variables when writing to page

Geoff Stearns geoff at deconcept.com
Sat Oct 21 08:15:59 PDT 2006


i guess i never saw that as a problem... unless you are adding a ton  
of extra stuff to the native js object (which should be frowned upon  
anyway) it should be fine.

does it really matter if you have an extra empty var in the root of  
your flash movie?


On Oct 21, 2006, at 3:07 AM, Olivier Pichon wrote:

> Can I make a small suggestion:
>
> When looping through the params or variables to write them out to  
> the page (generating the html code), is it possible to check that  
> the value is not a function?
>
> We tend to use several js utilities that augment the Object class  
> (we use json.js, for instance, that adds the 'tojsonstring' to all  
> objects). However, the functions added to the Object class get  
> output as both a <param> tag and an an extra entry in the flashvars  
> attribute value when the SWF HTML code is generated.
>
> getVariablePairs could simply be rewritten as:
>  getVariablePairs: function(){
> 		var variablePairs = new Array();
> 		var key;
> 		var variables = this.getVariables();
> 		for(key in variables){
> 			var value = variables[key];
> 			if ( typeof value != 'function')
> 				variablePairs.push(key +"="+ value);
> 		}
> 		return variablePairs;
> Same for the 2 portions of code in getSWFHTML() that write the params.
>
> Best regards,
>
> Olivier
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20061021/d9e38739/attachment-0005.htm>


More information about the Swfobject mailing list