Index: /CKEditor/branches/features/adobeair/AIRSandboxFrame.html
===================================================================
--- /CKEditor/branches/features/adobeair/AIRSandboxFrame.html	(revision 4297)
+++ /CKEditor/branches/features/adobeair/AIRSandboxFrame.html	(revision 4297)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title></title>
+</head>
+<body ></body>
+</html>
Index: /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js	(revision 4296)
+++ /CKEditor/branches/features/adobeair/_source/plugins/wysiwygarea/plugin.js	(revision 4297)
@@ -233,5 +233,5 @@
 
 					// Creates the iframe that holds the editable document.
-					var createIFrame = function()
+					var createIFrame = function( data )
 					{
 						if ( iframe )
@@ -267,18 +267,34 @@
 								' tabIndex="-1"' +
 								' allowTransparency="true"' +
-								' src="javascript:' + encodeURIComponent( src ) + '"' +
+								// The iframe must source from a 'application sandbox' file,
+								// otherwise the dynamically linked stylesheets and scripts
+								// won't work.
+								' src="' +
+								 ( CKEDITOR.env.air ? ( CKEDITOR.basePath + 'AIRSandboxFrame.html' )
+								 : ( 'javascript:' + encodeURIComponent( src ) ) ) + '"' + 
 								'></iframe>' );
 
 						var accTitle = editor.lang.editorTitle.replace( '%1', editor.name );
 
+						if ( CKEDITOR.env.gecko || CKEDITOR.env.air )
+						{
+							// Double checking the iframe will be loaded properly(#4058).
+							iframe.on( 'load', function( ev )
+							{
+								ev.removeListener();
+								var iframeWindow = iframe.$.contentWindow;
+								// We have no nother way to change iframe content
+								// in Adobe AIR beside DOM manipulation.  
+								if( CKEDITOR.env.air )
+								{
+									var doc = new CKEDITOR.dom.document( iframeWindow.document );
+									doc.write( data );
+								}
+								contentDomReady( iframeWindow );
+							} );
+						}
+
 						if ( CKEDITOR.env.gecko )
 						{
-						// Double checking the iframe will be loaded properly(#4058).
-							iframe.on( 'load', function( ev )
-							{
-								ev.removeListener();
-								contentDomReady( iframe.$.contentWindow );
-							} );
-
 							// Accessibility attributes for Firefox.
 							mainElement.setAttributes(
@@ -339,5 +355,5 @@
 
 						frameLoaded = 1;
-
+						
 						var domDocument = domWindow.document,
 							body = domDocument.body;
@@ -427,7 +443,8 @@
 						}
 
+
 						if( CKEDITOR.env.air )
 						{
-							//prevent clicking on hyperlinks and navigating away
+							// Hyperlinks is enabled in Adobe AIR wysiwyg mode.   
 							domDocument.$.addEventListener( 'click', function( ev )
 								{
@@ -544,12 +561,13 @@
 									'</body>' +
 									'</html>' +
+									// Scripts in HTML snippets is forbidden in Adobe AIR.   
 									( !CKEDITOR.env.air ? activationScript : '' );
 
 								window[ '_cke_htmlToLoad_' + editor.name ] = data;
 								CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady;
-								createIFrame();
+								createIFrame( data );
 
 								// Opera must use the old method for loading contents.
-								if ( CKEDITOR.env.opera || CKEDITOR.env.air )
+								if ( CKEDITOR.env.opera )
 								{
 									var doc = new CKEDITOR.dom.document( iframe.$.contentWindow.document );
@@ -557,6 +575,4 @@
 								}
 
-								if( CKEDITOR.env.air )
-									contentDomReady( iframe.$.contentWindow );
 							},
 
