Posts Tagged ‘javascript’

On a particular Dolphin CMS setup I was working with, my Flash illustration was overlapping the DHTML drop-down menu, so that I couldn’t see all of that menu. That menu was a necessity to run the site cleanly, so I had to find some means of getting the Flash and DHTML to play well together.

So, in searching Google for something to the effect of “Flash z-order”, I ultimately came to some pages explaining that the more recent browsers/browser versions came equipped with capabilities which allow Flash swfs to operate alongside DHTML elements as if the two were meant to work together.

Basically, the code calling the Flash swf just needs to state something to the effect of <param value="opaque" name="wmode" />.

The following is the precise code used to call my particular swf, reformers.swf:

<object height="150" width="920"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param value="/media/reformers.swf" name="src" />
<param value="opaque" name="wmode" />
<embed height="150" width="920"
wmode="opaque" src="/media/reformers.swf"
type="application/x-shockwave-flash"></embed>
</object>

I’m not sure how long this site will be in its current state, but for now at least, the following link should illustrate the meshing of the DHTML and Flash swf.

http://haveatulip.com

I really needed to be able to contain MXML markup code in my Flex blog, yet Wordpress MU (Multi-user) has some HTML and Javascript filtering in effect for security purposes. Since my blogs aren’t used by others, I figured it would be safe to disable that functionality, but it really is not the easiest thing to achieve.

I searched on Google and found a blog dealing with the matter at http://dev.robertmao.com/2007/07/18/get-rid-of-boring-wpmus-post-htmljavascript-filtering/. Since the blogger’s English wasn’t the greatest, I figured I can offer similar information here, hopefully, in a way that is easier to understand.

To achieve this, a very slight modification of one of WPMU’s (Wordpress Multi-user) PHP files, kses.php, which resides in the wp-include folder, will be necessary to achieve this. Using any plain text editor with a basic search function should suffice to edit the file.

Doing a simple text search of wp-include/kses.php for the word “filtering” should yield something similar to the following:

1028
1029
1030
1031
1032
1033
1034
1035
1036
function kses_init_filters() {
	// Normal filtering.
	add_filter('pre_comment_content', 'wp_filter_kses');
	add_filter('title_save_pre', 'wp_filter_kses');
 
	// Post filtering
	add_filter('content_save_pre', 'wp_filter_post_kses');
	add_filter('excerpt_save_pre', 'wp_filter_post_kses');
	add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

To remove the HTML/Javascript filtering, just comment out the add_filter lines below the // Post filtering by inserting a set of // backslashes, resulting in the following:

1028
1029
1030
1031
1032
1033
1034
1035
1036
function kses_init_filters() {
	// Normal filtering.
	add_filter('pre_comment_content', 'wp_filter_kses');
	add_filter('title_save_pre', 'wp_filter_kses');
 
	// Post filtering
	//add_filter('content_save_pre', 'wp_filter_post_kses');
	//add_filter('excerpt_save_pre', 'wp_filter_post_kses');
	//add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

As of this writing, the version of WPMU is 2.6.3, so these lines will reflect that version, though the search for the keyword “filtering” should still yield similar results in other versions.