<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog . sebastian martens &#187; Mozilla</title>
	<atom:link href="http://blog.sebastian-martens.de/tag/mozilla/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sebastian-martens.de</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 15:55:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Set innerHeight also for IE</title>
		<link>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/</link>
		<comments>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:49:10 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[innerHeight]]></category>
		<category><![CDATA[innerWidth]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=233</guid>
		<description><![CDATA[I&#8217;m really not a fan of popup windows within a website. But sometimes it really makes sense. For example for a little campaign which is more or less a microsite. But you want not to lose the website context. In this case i would &#8220;allow&#8221; to open the campaign in a popup window. The popup [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really not a fan of popup windows within a website. But sometimes it really makes sense. For example for a little campaign which is more or less a microsite. But you want not to lose the website context. In this case i would &#8220;allow&#8221; to open the campaign in a popup window.</p>
<p>The popup window should of course be as small as possible and should resize to the campaigns size. But because you never know which kind of Browsertoolbars the user have installed ( and you don&#8217;t want to disallow all tool- and browserbars ) you can&#8217;t really set the window size, because the IE does not support the innerHeight or innerWidth attribute of the window-element.<br />
<span id="more-233"></span><br />
Mozilla based browsers do support it and resize the complete window that way, that all content is fully shown. The following script checks the browsers scroll attibute to resize the IE browser window step by step. Not very nice, but it works. Please let me know if there is a better way to to this. This is the first i found.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> setInnerSize<span style="color: #009900;">&#40;</span>width<span style="color: #339933;">,</span>height<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">innerWidth</span> <span style="color: #339933;">&amp;&amp;</span> window.<span style="color: #660066;">innerWidth</span><span style="color: #339933;">!=</span><span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     	window.<span style="color: #660066;">innerWidth</span> <span style="color: #339933;">=</span> width<span style="color: #339933;">;</span>
     	window.<span style="color: #660066;">innerHeight</span> <span style="color: #339933;">=</span> height<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
     	run <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
     	runHeight <span style="color: #339933;">=</span> height<span style="color: #339933;">;</span>
     	runWidth <span style="color: #339933;">=</span> width<span style="color: #339933;">;</span>
&nbsp;
     	window.<span style="color: #660066;">resizeTo</span><span style="color: #009900;">&#40;</span> runWidth<span style="color: #339933;">,</span> runHeight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     	<span style="color: #000066; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span> run  <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      		window.<span style="color: #660066;">scrollTo</span><span style="color: #009900;">&#40;</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      		scrollV <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">?</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">:</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollTop</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      		scrollH <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">?</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">:</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> scrollH <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> runWidth <span style="color: #339933;">=</span> runWidth<span style="color: #339933;">+</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> scrollV <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> runHeight <span style="color: #339933;">=</span> runHeight<span style="color: #339933;">+</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
&nbsp;
      		window.<span style="color: #660066;">resizeTo</span><span style="color: #009900;">&#40;</span> runWidth<span style="color: #339933;">,</span> runHeight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>  <span style="color: #009900;">&#40;</span>scrollV<span style="color: #339933;">+</span>scrollH<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #CC0000;">10</span> <span style="color: #009900;">&#41;</span> run <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
     	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>swfInputs: Solving Mozilla + Transparent Mode + Win + Special Chars within inputs</title>
		<link>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/</link>
		<comments>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/#comments</comments>
		<pubDate>Fri, 29 May 2009 19:30:43 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[inputs]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[opaque]]></category>
		<category><![CDATA[Player]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[swfInputs]]></category>
		<category><![CDATA[transparent mode]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wmode]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=159</guid>
		<description><![CDATA[As you probably know the Flash Player uses three different types of modes an Flash movie is embedded in the browser window. Its is set via the wmode parameter in the embed or param tag. &#60;param name=&#34;wmode&#34; value=&#34;transparent&#34; /&#62; &#60;embed wmode=&#34;transparent&#34; ... With the transparent mode you can influence the relation between the Flash movie [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know the Flash Player uses three different types of modes an Flash movie is embedded in the browser window. Its is set via the <em>wmode</em> parameter in the embed or param tag.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;
  &lt;embed wmode=&quot;transparent&quot; ...</pre></div></div>

<p>With the transparent mode you can influence the relation between the Flash movie an the surrounding HTML. If the set the wmode to window the Flash movie will always lay on top of the rest of the page. This is absolutly helpfull if your application is &#8220;standalone&#8221;, means the only center of user interaction or if you have an full window application ( at least with full screen ).<br />
But often you have other HTML elements around the Flash movie which are at the same level of user interaction and might be as important as the Flash movie ( Best example might by fly-out menus which has to overlay all other content. Or maybe confirm messages which are not realized by the JavaScript confirm-dialog ). If you use <em>wmode</em> window html elements will always behind the Flash movie (setting the html z-index has no effect ), so there is no real interaction between HTML/JavaScript an the Flash movie. For this you need <em>wmode</em> equals <em>transparent</em>.<br />
<span id="more-159"></span><br />
wmode transparent allows an equal mixture between Flash and HTML/ JavaScript. Just as the parameters sounds, the Flash movie will also have an transparent background and let the behind HTML shine through. Attention: The transaparent background is expensive in performance. Use it carefully.<br />
The third mode after <em>window</em> and <em>transparent</em> is <em>opaque</em>. The opaque also allows the mix of Flash and HTML/ JavaScript, but has now transparent background.</p>
<p>Since the introduction of these two modes (<em>transparent, opaque</em>) there is a bug with Mozilla based Browsers and textfields on Window plattforms. If you try to enter special character &#8211; famoused example is the @ &#8211; in text fields it wont work. This is very uncomfortable if you want to have a user login where you use e-mail adresses as username ( @see <a  href="http://bugs.adobe.com/jira/browse/FP-479">Adobe Bug Base</a> ).</p>
<h3>swfInput</h3>
<p>My solution to solve this issue is called swfInputs. It uses the ExternalInterface class of the Flash player. swfInputs is a an AS3 which extends the Flex TextInput class. It communicates with an JavaScript class. This will create normal HTML Inputfields and places it exactly above the original Flash Inputfield.<br />
On entering text in the overlay-HTML-Inputfield the text will be transfered via ExternalInterface into the Flash movie and the corresponding Flash Inputfield. For the Flash application this mechanism is transparent because the access to the field and change events on the input field will still work.</p>
<p>The JavaScript class will only generate the overlay input field if its necessary, means on the Mozilla-Windows-Combination. Other browsers will use the normal Flash movie inputs.</p>
<p>The styles (height, width, border, colors ) which you set on the Flash Input will be transfered to the HTML-Input and set via CSS styles. For further styling like background images you could of course also use standard CSS.</p>
<p>swfInputs also support multiple Flash movies within on HTML page and have an &#8220;point-to-point&#8221; connection between the overlaying HTML-Input and the Flash-Input. So there is no general keylogger on the complete HTML page, which might cause problems with your JavaScript functions. This also means that you could have different Flash movies on one page ( which might also communicate to each other via LocalConnection ) where each movie could have its own TextInputs.</p>
<h3>What to do in your code?</h3>
<p>swfInputs consists of two parts:</p>
<ul>
<li>The SWFTextInput AS3 Class (which create the connection to the JavaScript class)</li>
<li>and the swfInputs JavaScript Class (which handles the creation and HTML communication)</li>
</ul>
<p>To activate the JavaScript part you just need to insert two script-tags into the HTML code and call the constructor method. At the moment swfInputs uses the dojoToolkit JavaScript library for position calculation and basic connection handling. I looking forward to remove this need of dojo to reduce the filesize.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;../javascript/dojo.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../javascript/swfInputs.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
			swfInputs.init('swfInputTestcase');
&lt;/script&gt;</pre></div></div>

<p>The String-value int the constructor call is the channel-name. This is optional if you just use on single instance within the HTML-page.</p>
<p>Within you Flash/ Flex application you have to use the SWFTextInput class for textfields instead of TextInput. The SWFTextInput class uses the <a  href="/2009/03/how-to-handle-massive-externalinterface-calls-jscallstack/">JSCallStack</a> to optimize the JavaScript communiaction ( which could be a lot on fast typing, so its recommanded to use it ).</p>
<p>A basic Flash/ Flex app could look like this. You see there is nothing very special instead of the <strong><em>swfInputs:SWFTextInput</em></strong> class.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
	layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> backgroundAlpha=<span style="color: #ff0000;">&quot;0.5&quot;</span> <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;#674523&quot;</span>
	initialize=<span style="color: #ff0000;">&quot;init()&quot;</span> xmlns:swfInputs=<span style="color: #ff0000;">&quot;com.nonstatics.swfInputs.*&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">Alert</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clickHandler<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
				Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;swfInput01: &quot;</span>+swfInput01.<span style="color: #0066CC;">text</span>+<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
						   <span style="color: #ff0000;">&quot;swfInput02: &quot;</span>+swfInput02.<span style="color: #0066CC;">text</span>+<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
						   <span style="color: #ff0000;">&quot;swfInput03: &quot;</span>+swfInput03.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:VBox x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>mx:TextInput <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#674523&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{ swfInput01.text + swfInput02.text }&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput01&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#ff0000&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Verdana&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput02&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#00ffff&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Arial&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput03&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#0000ff&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Times&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Senden&quot;</span> click=<span style="color: #ff0000;">&quot;clickHandler()&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;/</span>mx:VBox<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<h3>Download Files (swfInputs 1.0)</h3>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swftextinput.as">SWFTextInput.as</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swfinputs.js">swfInputs.js</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swfinputtestproject.zip">SWFInputs Eclipse Testproject (ZIP)</a></p>
<p>Please feal free to leave some comments and let me know if its helpful or what should be done for future releases.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

