Index: /CKEditor/branches/prototype/_source/plugins/flash/dialogs/flash.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/flash/dialogs/flash.js	(revision 2894)
+++ /CKEditor/branches/prototype/_source/plugins/flash/dialogs/flash.js	(revision 2895)
@@ -23,9 +23,10 @@
 CKEDITOR.dialog.add( 'flash', function( editor ){
 {
-	// Load image preview.
-	var showPreview = true;
-	var uploadAction = 'nowhere.php';
-	var regexSize = /^\s*(\d+)((px)|\%)?\s*$/i;
-	var regexValidSize = /^(\d+)\%?$|^$/i;
+	const PARAM = 1,
+	OBJECT = 2,
+	EMBED = 4;
+	
+	var regexSize = /^\s*(\d+)((px)|\%)?\s*$/i,
+	regexValidSize = /^(\d+)\%?$|^$/i;
 
 	var previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>'+
@@ -34,17 +35,32 @@
 		'<span id="previewContainer"></span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. </div></div>';
 
-	var addChange = function( name, input ){
+	var addChange = function( name, input, type ){
 		var dialog = input.getDialog();
-		
+		var result = false;
+
 		//Don't load before onShow.
 		if ( !dialog.allowOnChange )
 			return 0;
 
-		if ( input.getValue() != '' || input.isChanged() )
-		{
-			dialog.changedAttibutes[ 'flash' ][ name ] = input.getValue();
-			return true;
-		}
-		return false;
+		if ( type & PARAM )
+			if ( input.getValue() != '' || input.isChanged() )
+			{
+				dialog.changedAttibutes[ 'PARAM' ][ name ] = input.getValue();
+				result = true;
+			}
+		if ( type & OBJECT )
+			if ( input.getValue() != '' || input.isChanged() )
+			{
+				dialog.changedAttibutes[ 'OBJECT' ][ name ] = input.getValue();
+				result = true;
+			}
+		if ( type & EMBED )
+			if ( input.getValue() != '' || input.isChanged() )
+			{
+				dialog.changedAttibutes[ 'EMBED' ][ name ] = input.getValue();
+				result = true;
+			}
+		
+		return result;
 	};
 
@@ -52,5 +68,4 @@
 	{
 		var dialog = input.getDialog();
-
 		//Don't load before onShow.
 		if ( !dialog.allowOnChange )
@@ -63,5 +78,4 @@
 	{
 		var dialog = input.getDialog();
-
 		//Don't load before onShow.
 		if ( !dialog.allowOnChange )
@@ -75,5 +89,4 @@
 		if ( !dialog.editObj[ 'preview' ] )
 			return 1;
-
 		// Check value
 		var aMatch  =  value.match( regexSize );
@@ -99,7 +112,7 @@
 
 		// Read height.
-		if ( dialog.editObj[ 'fakeimage' ].getAttribute( 'height' ) )
-		{
-			var aMatchH  =  dialog.editObj[ 'fakeimage' ].getAttribute( 'height' ).match( regexSize );
+		if ( dialog.editObj[ 'flash' ].getAttribute( 'height' ) )
+		{
+			var aMatchH  =  dialog.editObj[ 'flash' ].getAttribute( 'height' ).match( regexSize );
 			if ( aMatchH )
 			{
@@ -112,7 +125,7 @@
 
 		// Read width.
-		if ( dialog.editObj[ 'fakeimage' ].getAttribute( 'width' ) )
-		{
-			var aMatchW  =  dialog.editObj[ 'fakeimage' ].getAttribute( 'width' ).match( regexSize );
+		if ( dialog.editObj[ 'flash' ].getAttribute( 'width' ) )
+		{
+			var aMatchW  =  dialog.editObj[ 'flash' ].getAttribute( 'width' ).match( regexSize );
 			if ( aMatchW )
 			{
@@ -125,5 +138,5 @@
 
 		// Read styles.
-		var aMatchW  =  dialog.editObj[ 'fakeimage' ].$.style.width.match( regexSize );
+		var aMatchW  =  dialog.editObj[ 'flash' ].$.style.width.match( regexSize );
 		if ( aMatchW )
 		{
@@ -132,8 +145,9 @@
 				aMatchW[1] += '%';
 			widthText = aMatchW[1];
-			dialog.changedAttibutes[ 'flash' ][ 'width' ] = widthText;
+			dialog.changedAttibutes[ 'OBJECT' ][ 'width' ] = widthText;
+			dialog.changedAttibutes[ 'EMBED' ][ 'width' ] = widthText;
 			dialog.dimensionsInStyle[ 'width' ] = true;
 		}
-		var aMatchH  =  dialog.editObj[ 'fakeimage' ].$.style.height.match( regexSize );
+		var aMatchH  =  dialog.editObj[ 'flash' ].$.style.height.match( regexSize );
 		if ( aMatchH )
 		{
@@ -142,5 +156,6 @@
 				aMatchH[1] += '%';
 			heightText = aMatchH[1];
-			dialog.changedAttibutes[ 'flash' ][ 'height' ] = heightText;
+			dialog.changedAttibutes[ 'OBJECT' ][ 'height' ] = heightText;
+			dialog.changedAttibutes[ 'EMBED' ][ 'height' ] = heightText;
 			dialog.dimensionsInStyle[ 'height' ] = true;
 		}
@@ -157,10 +172,5 @@
 	{
 		this.saveSelection();
-		this.editMode[ 'fakeimage' ] = true;
-		this.editObj[ 'fakeimage' ] = element;
-
-
-		//TODO: this.editObj[ 'flash' ] = getRealElement (element);
-
+		this.editObj[ 'flash' ] = CKEDITOR.plugins.fakeobjects.restoreElement( element );
 
 		// Fill out all fields.
@@ -195,70 +205,33 @@
 
 	return {
-		title : editor.lang.flash.properties,
+		title : editor.lang.flash.title,
 		minWidth : 450,
 		minHeight : 400,
-		onOk : function()
-		{
-			this.allowOnChange = true;
-
-			// Create a new fakeimage.
-			if ( !this.editMode[ 'fakeimage' ] )
-			{
-				this.editObj[ 'fakeimage' ] = editor.document.createElement( 'img' );
-
-				this.editObj[ 'fakeimage' ].setAttribute ( '_cke_flash', 'true' );
+		onLoad : function()
+		{
+			if ( editor.config.pluginConfig.flash.uploadTab == false )
+				this.hidePage( 'Upload' );		//Hide Upload tab.
+
+			if ( editor.config.pluginConfig.flash.showAdvancedTab == false )
+				this.hidePage( 'advanced' );		//Hide Advanded tab.
+
+			if ( editor.config.pluginConfig.flash.showPropertiesTab == false )
+				this.hidePage( 'advanced' );		//Hide Proporties tab.
 				
-				// TODO: where is spacer.gif? (problem with path to spacer.gif)
-				this.editObj[ 'fakeimage' ].setAttribute ( 'src' ,'spacer.gif' );
-				
-				//TODO: Move ....somewhere (problem with path to flashlogo.gif)
-/*
-.cke_flash
-{
-	border: #a9a9a9 1px solid;
-	background-position: center center;
-	background-image: url(images/flashlogo.gif);
-	background-repeat: no-repeat;
-	width: 80px;
-	height: 80px;
-}
-*/
-				this.editObj[ 'fakeimage' ].setStyle ( 'class', 'cke_flash' );
-			}
-			
-			// Create a new flash object.
-			if ( !this.editMode[ 'fakeimage' ] )
-			{
-				this.editObj[ 'flash' ] = editor.document.createElement( 'embed' );
-				
-				// TODO: this.editObj[ 'fakeimage' ].setRealemenet( this.editObj[ 'flash' ] );
-			}
-
-			// Set flash attributes.
-			this.editObj[ 'flash' ].setAttributes( this.changedAttibutes[ 'flash' ] );
-
-			// Set STYLE dimensions.
-			if ( this.dimensionsInStyle[ 'width' ] == true )
-			{
-				this.editObj[ 'flash' ].setStyle( 'width',  this.changedAttibutes[ 'flash' ][ 'width' ] + 'px' );
-				this.editObj[ 'fakeimage' ].setStyle( 'width',  this.changedAttibutes[ 'flash' ][ 'width' ] + 'px' );
-			}
-			if ( this.dimensionsInStyle[ 'height' ] == true )
-			{
-				this.editObj[ 'flash' ].setStyle( 'height',  this.changedAttibutes[ 'flash' ][ 'height' ] + 'px' );
-				this.editObj[ 'fakeimage' ].setStyle( 'height',  this.changedAttibutes[ 'flash' ][ 'height' ] + 'px' );
-			}
-
-			// Insert a new fakeimage.
-			if ( this.editMode[ 'fakeimage' ] == false )
-			{
-				// It doesn't work with IE.
-				this.restoreSelection();
-				this.clearSavedSelection();
-				editor.insertElement( this.editObj[ 'fakeimage' ] );
-			}
-			this.allowOnChange = false;		// Don't load onChange before onShow.
-
-			return true;
+			if ( editor.config.pluginConfig.flash.browseServer == false )
+				this.getContentElement( 'info', 'browse' ).getElement().hide();
+		},	
+		onHide : function()
+		{
+			if ( this.editObj[ 'preview' ] )
+				this.editObj[ 'preview' ].setAttribute( 'src', '' );
+
+			this.editObj[ 'preview' ] = false;
+
+			// Don't call onChange before onShow.
+			this.allowOnChange = false;
+
+			// Pop the default values from default value set that are pushed in onShow().
+			this.popDefault();
 		},
 		onShow : function()
@@ -268,5 +241,5 @@
 
 			this.editObj = new Array();
-			this.editObj[ 'fakeimage' ] = false;
+			this.editObj[ 'fakeobject' ] = false;
 			this.editObj[ 'preview' ] = false;
 			this.editObj[ 'flash' ] = false;
@@ -274,8 +247,10 @@
 			// Default: create a new element.
 			this.editMode = new Array();
-			this.editMode[ 'fakeimage' ] = false;
-
+			this.editMode[ 'fakeobject' ] = false;
+	
 			this.changedAttibutes = new Array();
-			this.changedAttibutes[ 'flash' ] = new Array();
+			this.changedAttibutes[ 'PARAM' ] = new Array();
+			this.changedAttibutes[ 'OBJECT' ] = new Array();
+			this.changedAttibutes[ 'EMBED' ] = new Array();
 
 			this.dimensionsInStyle = new Array();
@@ -292,13 +267,14 @@
 			if ( ranges.length == 1 )
 			{
-				element = false;
 				ranges[0].enlarge( CKEDITOR.ENLARGE_ELEMENT );
 				rangeRoot = ranges[0].getCommonAncestor( true );
-				
-				elementImg = rangeRoot.getAscendant( 'img', true );
-				if ( elementImg && elementA.getAttribute( '_cke_flash' ) )
+				var element = rangeRoot.getAscendant( 'img', true );
+				if ( element && element.getAttribute( '_cke_real_element_type' ) && element.getAttribute( '_cke_real_element_type' ) == 'flash' )
 				{
-					loadElements.apply( this, [ editor, selection, ranges, elementImg ] );
-					selection.selectElement( elementImg );
+					this.editMode[ 'fakeobject' ] = true;
+					this.editObj[ 'fakeobject' ] = element;
+					element = CKEDITOR.plugins.fakeobjects.restoreElement( this.editObj[ 'fakeobject' ] );
+					loadElements.apply( this, [ editor, selection, ranges, element ] );
+					selection.selectElement( this.editObj[ 'fakeobject' ] );
 					this.saveSelection();
 				}
@@ -309,28 +285,65 @@
 			this.pushDefault();
 			this.getContentElement( 'info', 'txtUrl' ).focus();
-		},		
-		onLoad : function()
-		{
-			if ( editor.config.imageUpload == false )
-				this.hidePage( 'Upload' );		//Hide Upload tab.
-
 		},	
-		onHide : function()
-		{
-			if ( this.editObj[ 'preview' ] )
-				this.editObj[ 'preview' ].setAttribute( 'src', '' );
-
-			this.editObj[ 'preview' ] = false;
-
-			// Don't call onChange before onShow.
-			this.allowOnChange = false;
-
-			// Pop the default values from default value set that are pushed in onShow().
-			this.popDefault();
+		onOk : function()
+		{
+			this.allowOnChange = true;
+
+			// Create a new fakeobject.
+			if ( !this.editMode[ 'fakeobject' ] )
+			{
+				this.editObj[ 'object' ] = editor.document.createElement( 'object' );
+				this.editObj[ 'embed' ] = editor.document.createElement( 'embed' );
+			}
+			
+			// Create a new flash object.
+			if ( !this.editMode[ 'fakeobject' ] )
+			{
+				this.editObj[ 'flash' ] = editor.document.createElement( 'embed' );
+				
+				// TODO: this.editObj[ 'fakeobject' ].setRealemenet( this.editObj[ 'flash' ] );
+			}
+
+			// Set flash attributes.
+		//	this.editObj[ 'flash' ].setAttributes( this.changedAttibutes);
+
+			// Set STYLE dimensions.
+			if ( this.dimensionsInStyle[ 'width' ] == true )
+			{
+				this.editObj[ 'object' ].setStyle( 'width',  this.changedAttibutes[ 'OBJECT' ][ 'width' ] + 'px' );
+				this.editObj[ 'fakeobject' ].setStyle( 'width',  this.changedAttibutes[ 'OBJECT' ][ 'width' ] + 'px' );
+			}
+			if ( this.dimensionsInStyle[ 'height' ] == true )
+			{
+				this.editObj[ 'object' ].setStyle( 'height',  this.changedAttibutes[ 'OBJECT' ][ 'height' ] + 'px' );
+				this.editObj[ 'fakeobject' ].setStyle( 'height',  this.changedAttibutes[ 'OBJECT' ][ 'height' ] + 'px' );
+			}
+
+			// Insert a new fakeobject.
+			if ( this.editMode[ 'fakeobject' ] == false )
+			{
+				// Append EMBED as child.
+				this.editObj[ 'object' ].append( this.editObj[ 'embed' ] );
+				this.editObj[ 'fakeobject' ] = CKEDITOR.plugins.fakeobjects.protectElement( this.editObj[ 'object' ] );
+
+				//alert( decodeURIComponent( this.editObj[ 'fakeobject' ].getAttribute( '_cke_protected_html' ) ));
+
+				// It doesn't work with IE.
+				this.restoreSelection();
+				this.clearSavedSelection();
+				editor.insertElement( this.editObj[ 'fakeobject' ] );
+			}
+			else
+			{
+				CKEDITOR.plugins.fakeobjects.updateFakeElement( this.editObj[ 'fakeobject' ], this.editObj[ 'object' ] );
+			}
+			this.allowOnChange = false;		// Don't load onChange before onShow.
+
+			return true;
 		},
 		contents : [
 			{
 				id : 'info',
-				label : editor.lang.flash.infoTab,
+				label : editor.lang.common.generalTab,
 				accessKey : 'I',
 				elements :
@@ -357,6 +370,6 @@
 										validate: function()
 										{
-											addChange( 'src', this );
-											addChange( '_cke_saved_url', this );
+											addChange( 'movie', this, PARAM );
+											addChange( 'src', this, EMBED );
 											return true;
 										},
@@ -372,5 +385,5 @@
 										onClick : function()
 										{
-											//this.getDialog().setValueOf( "info", "txtUrl", "http://www.fckeditor.net/images/demo_screenshot.gif" );
+											this.getDialog().setValueOf( "info", "txtUrl", "http://www.w3schools.com/flash/mouse.swf" );
 										}
 									}
@@ -381,5 +394,5 @@
 					{
 						type : 'hbox',
-						widths : [ '20%', '20%', '60%' ],
+						widths : [ '25%', '25%', '25%', '25%', '25%' ],
 						children :
 						[
@@ -388,4 +401,5 @@
 								id : 'txtWidth',
 								label : editor.lang.flash.width,
+								'default' : editor.config.pluginConfig.flash.defaultValues.width,
 								onChange : function()
 								{
@@ -397,5 +411,5 @@
 									if ( aMatch )
 									{
-										addChange( 'width', this );
+										addChange( 'width', this, OBJECT | EMBED );
 										return true;
 									}
@@ -408,4 +422,5 @@
 								id : 'txtHeight',
 								label : editor.lang.flash.height,
+								'default' : editor.config.pluginConfig.flash.defaultValues.height,
 								onChange : function()
 								{
@@ -417,5 +432,5 @@
 									if ( aMatch )
 									{
-										addChange( 'height', this );
+										addChange( 'height', this, OBJECT | EMBED );
 										return true;
 									}
@@ -425,6 +440,44 @@
 							},
 							{
-								type : 'html',
-								html : '<div></div>'
+								type : 'text',
+								id : 'txtHSpace',
+								label : editor.lang.flash.hSpace,
+								'default' : editor.config.pluginConfig.flash.defaultValues.hSpace,
+								onChange : function()
+								{
+									onChange( this );
+								},
+								validate: function()
+								{
+									var aMatch  =  this.getValue().match( regexValidSize );
+									if ( aMatch )
+									{
+										addChange( 'hSpace', this, OBJECT | EMBED );
+										return true;
+									}
+									alert( editor.lang.common.validateNumberFailed );
+									return false;
+								}
+							},
+							{
+								type : 'text',
+								id : 'txtVSpace',
+								label : editor.lang.flash.vSpace,
+								'default' : editor.config.pluginConfig.flash.defaultValues.vSpace,
+								onChange : function()
+								{
+									onChange( this );
+								},
+								validate: function()
+								{
+									var aMatch  =  this.getValue().match( regexValidSize );
+									if ( aMatch )
+									{
+										addChange( 'vSpace', this, OBJECT | EMBED );
+										return true;
+									}
+									alert( editor.lang.common.validateNumberFailed );
+									return false;
+								}
 							}
 						]
@@ -453,5 +506,5 @@
 						id : 'upload',
 						label : editor.lang.common.upload,
-						action : uploadAction,
+						action : editor.config.pluginConfig.image.uploadAction,
 						size : 38
 					},
@@ -465,4 +518,184 @@
 			},
 			{
+				id : 'properties',
+				label : editor.lang.flash.propertiesTab,
+				elements :
+				[
+					{
+						type : 'hbox',
+						widths : [ '50%', '50%' ],
+						children :
+						[
+							{
+								id : 'cmbScale',
+								type : 'select',
+								label : editor.lang.flash.scale,
+								'default' : editor.config.pluginConfig.flash.defaultValues.scale,
+								style : 'width : 100%;',
+								items :
+								[
+									[ editor.lang.common.notSet , ''],
+									[ editor.lang.flash.scaleAll, 'showall' ],
+									[ editor.lang.flash.scaleNoBorder, 'noborder' ],
+									[ editor.lang.flash.scaleFit, 'exactfit' ]
+								],
+								validate : function()
+								{
+									addChange( 'scale', this, PARAM | EMBED );
+									return true;
+								}
+							},
+							{
+								id : 'cmbAccess',
+								type : 'select',
+								label : editor.lang.flash.access,
+								'default' : editor.config.pluginConfig.flash.defaultValues.access,
+								style : 'width : 100%;',
+								items :
+								[
+									[ editor.lang.common.notSet , ''],
+									[ editor.lang.flash.accessAlways, 'always' ],
+									[ editor.lang.flash.accessSameDomain, 'samedomain' ],
+									[ editor.lang.flash.accessNever, 'never' ]
+								],
+								validate : function()
+								{
+									addChange( 'allowscriptaccess', this, PARAM | EMBED );
+									return true;
+								}
+							}
+						]
+					},
+					{
+						type : 'hbox',
+						widths : [ '50%', '50%' ],
+						children :
+						[
+							{
+								id : 'cmbWmode',
+								type : 'select',
+								label : editor.lang.flash.windowMode,
+								'default' : editor.config.pluginConfig.flash.defaultValues.windowMode,
+								style : 'width : 100%;',
+								items :
+								[
+									[ editor.lang.common.notSet , ''],
+									[ 'window' ],
+									[ 'opaque' ],
+									[ 'transparent' ]
+								],
+								validate : function()
+								{
+									addChange( 'wmode', this, PARAM );
+									return true;
+								}
+							},
+							{
+								id : 'cmbQuality',
+								type : 'select',
+								label : editor.lang.flash.quality,
+								'default' : editor.config.pluginConfig.flash.defaultValues.quality,
+								style : 'width : 100%;',
+								items :
+								[
+									[ editor.lang.common.notSet , ''],
+									[ 'best' ],
+									[ 'high' ],
+									[ 'autohigh' ],
+									[ 'medium' ],
+									[ 'autolow' ],
+									[ 'low' ]
+								],
+								validate : function()
+								{
+									addChange( 'quality', this, PARAM | EMBED );
+									return true;
+								}
+							},
+						]
+					},
+					{
+						type : 'hbox',
+						widths : [ '50%', '50%' ],
+						children :
+						[
+							{
+								id : 'cmbAlign',
+								type : 'select',
+								label : editor.lang.flash.align,
+								'default' : editor.config.pluginConfig.flash.defaultValues.align,
+								style : 'width : 100%;',
+								items :
+								[
+									[ editor.lang.common.notSet , ''],
+									[ editor.lang.image.alignLeft , 'left'],
+									[ editor.lang.image.alignAbsBottom , 'absBottom'],
+									[ editor.lang.image.alignAbsMiddle , 'absMiddle'],
+									[ editor.lang.image.alignBaseline , 'baseline'],
+									[ editor.lang.image.alignBottom , 'bottom'],
+									[ editor.lang.image.alignMiddle , 'middle'],
+									[ editor.lang.image.alignRight , 'right'],
+									[ editor.lang.image.alignTextTop , 'textTop'],
+									[ editor.lang.image.alignTop , 'top']
+								],
+								validate : function()
+								{
+									addChange( 'align', this, OBJECT | EMBED );
+									return true;
+								}
+							},
+							{
+								type : 'html',
+								html : '<div></div>',
+							}
+						]
+					},
+					{
+						type : 'checkbox',
+						id : 'chkMenu',
+						label : editor.lang.flash.chkMenu,
+						checked : editor.config.pluginConfig.flash.defaultValues.menu,
+						validate : function()
+						{
+							addChange( 'menu', this, PARAM | EMBED );
+							return true;
+						}
+					},
+					{
+						type : 'checkbox',
+						id : 'chkPlay',
+						label : editor.lang.flash.chkPlay,
+						checked : editor.config.pluginConfig.flash.defaultValues.play,
+						validate : function()
+						{
+							addChange( 'play', this, PARAM | EMBED );
+							return true;
+						}
+					},
+					{
+						type : 'checkbox',
+						id : 'chkLoop',
+						label : editor.lang.flash.chkLoop,
+						checked : editor.config.pluginConfig.flash.defaultValues.loop,
+						validate : function()
+						{
+							addChange( 'loop', this, PARAM | EMBED );
+							return true;
+						}
+					},
+					{
+						type : 'checkbox',
+						id : 'txtChkFull',
+						label : editor.lang.flash.chkFull,
+						checked : editor.config.pluginConfig.flash.defaultValues.allowfullscreen,
+						validate : function()
+						{
+							addChange( 'allowfullscreen', this, PARAM | EMBED );
+							return true;
+						}
+					}
+				]
+			},
+			{
 				id : 'advanced',
 				label : editor.lang.common.advancedTab,
@@ -471,60 +704,5 @@
 					{
 						type : 'hbox',
-						widths : [ '25%', '25%', '25%', '25%'],
-						children :
-						[
-							{
-								id : 'cmbScale',
-								type : 'select',
-								label : editor.lang.flash.scale,
-								style : 'width : 100%;',
-								items :
-								[
-									[ '', '' ],
-									[ editor.lang.flash.scaleAll, 'showall' ],
-									[ editor.lang.flash.scaleNoBorder, 'noborder' ],
-									[ editor.lang.flash.scaleFit, 'exactfit' ]
-								],
-								validate : function()
-								{
-									addChange( 'scale', this );
-									return true;
-								}
-							},
-							{
-								type : 'checkbox',
-								id : 'txtChkPlay',
-								label : editor.lang.flash.chkPlay,
-								validate : function()
-								{
-									addChange( 'play', this );
-									return true;
-								}
-							},
-							{
-								type : 'checkbox',
-								id : 'txtChkLoop',
-								label : editor.lang.flash.chkLoop,
-								validate : function()
-								{
-									addChange( 'loop', this );
-									return true;
-								}
-							},
-							{
-								type : 'checkbox',
-								id : 'txtChkMenu',
-								label : editor.lang.flash.chkMenu,
-								validate : function()
-								{
-									addChange( 'menu', this );
-									return true;
-								}
-							},
-						]
-					},
-					{
-						type : 'hbox',
-						widths : [ '50%', '25%', '25%' ],
+						widths : [ '45%', '55%' ],
 						children :
 						[
@@ -535,5 +713,34 @@
 								validate : function()
 								{
-									addChange( 'id', this );
+									addChange( 'id', this, OBJECT | EMBED );
+									return true;
+								}
+							},
+							{
+								type : 'text',
+								id : 'txtGenTitle',
+								label : editor.lang.common.advisoryTitle,
+								'default' : editor.config.pluginConfig.flash.defaultValues.title,
+								validate : function()
+								{
+									addChange( 'title', this, OBJECT | EMBED );
+									return true;
+								}
+							}
+						]
+					},
+					{
+						type : 'hbox',
+						widths : [ '45%', '55%' ],
+						children :
+						[
+							{
+								type : 'text',
+								id : 'txtBgcolor',
+								label : editor.lang.flash.bgcolor,
+								'default' : editor.config.pluginConfig.flash.defaultValues.bgcolor,
+								validate : function()
+								{				
+									addChange( 'bgcolor', this, PARAM | EMBED );
 									return true;
 								}
@@ -543,17 +750,8 @@
 								id : 'txtGenClass',
 								label : editor.lang.common.cssClass,
-								validate : function()
-								{
-									addChange( 'class', this );
-									return true;
-								}
-							},
-							{
-								type : 'text',
-								id : 'txtGenTitle',
-								label : editor.lang.common.advisoryTitle,
-								validate : function()
-								{
-									addChange( 'title', this );
+								'default' : editor.config.pluginConfig.flash.defaultValues.cssClass,
+								validate : function()
+								{
+									addChange( 'class', this, OBJECT | EMBED );
 									return true;
 								}
@@ -563,9 +761,10 @@
 					{
 						type : 'text',
-						id : 'txtdlgGenStyle',
+						id : 'txtGenStyle',
 						label : editor.lang.common.cssStyle,
+						'default' : editor.config.pluginConfig.flash.defaultValues.cssStyle,
 						validate : function()
-						{				
-							addChange( 'style', this );
+						{
+							addChange( 'style', this, OBJECT | EMBED );
 							return true;
 						}
