<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<description>Marcelo Volmaro on Programming, User Experience and anything else</description>
		<link>http://www.extremefx.com.ar</link>
		<title>Extreme|FX</title>
		<docs>http://www.rssboard.org/rss-specification</docs>
		<lastBuildDate>Thu, 17 Oct 2013 00:00:00 </lastBuildDate>
		<item>
			<title>Downgrading a Nuget package</title>
			<link>http://www.extremefx.com.ar/blog/downgrading-a-nuget-package</link>
			<description>For my own reference: How to downgrade a nuget package after a previous upgrade broke my VS solution. Instructions inside :)</description>
			<guid>http://www.extremefx.com.ar/blog/downgrading-a-nuget-package</guid>
			<pubDate>Thu, 17 Oct 2013 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>Today I had a problem where I had blindly upgraded EF to version 6 across an entire solution, only to find out that the version was incompatible 
with the current MySql provider</p>

<p>Due to time constraints, instead of trying to revert back the changes from the repository/merge with the other work already in progress
 to fix the problems, I decided to roll back EF to the previous version. So, I started to mess out with the nuget package manager console.</p>

<p>First I needed to get a list of projects that have a reference to the nuget package:</p>

<pre><code>$projects = Get-Project -All | Select @{ Name="ProjectName";Expression={$_.ProjectName}}, @{Name="Has";Expression={Get-Package EntityFramework -Project $_.Name}}</code></pre>

<p>Then, I uninstalled the package:</p>

<pre><code>projects | select { Uninstall-Package EntityFramework -ProjectName $_.ProjectName -Force }</code></pre>

<p>It's worth noting the use of the <em>Force</em> switch here. 
That can be quite dangerous as it can break other packages 
(see <a href="http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Uninstall-Package">NuGet Docs</a>)</p>

<p>Finally, installed the new one:</p>

<pre><code>$projects | select { Install-Package EntityFramework -Version 5.0.0 -ProjectName $_.ProjectName }</code></pre>

<p>And that's it. That solved my problem and now I can continue working where I left...</p>
]]></content:encoded>
		</item>
		<item>
			<title>Creating a Culturally Customized Website</title>
			<link>http://www.extremefx.com.ar/blog/creating-a-culturally-customized-website</link>
			<description>Cultural customization is a fundamental step for reaching a global audience with your website, and should be completed as part of website translation and website localization. While many website owners treat this step as optional, it should be treated as integral.
Website cultural customization can do a lot to validate your presence on the web with your target locale and ensure the effectiveness of your website to locale specific users. Cultural adaption involves perception, symbolism and behavior.</description>
			<guid>http://www.extremefx.com.ar/blog/creating-a-culturally-customized-website</guid>
			<pubDate>Thu, 06 Oct 2011 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>
	"Human-Computer Interaction (HCI) research shows that successful interaction depends on more than just using the correct
	language. 
Interaction is also dependent upon the culturally embedded meaning of objects such as icons, and metaphors such as the desktop,
	or the shopping cart (Bourges-Waldegg & Scrivener, 1998; French & Smith, 2000)".
</p>

<p>View complete article here: 
<a href="http://blog.globalizationpartners.com/culturally-customized-website.aspx" target="_blank">Creating a Culturally Customized Website</a></p>

]]></content:encoded>
		</item>
		<item>
			<title>Website Internationalization and Accessibility</title>
			<link>http://www.extremefx.com.ar/blog/website-internationalization-and-accessibility</link>
			<description>The World Wide Web is capable of living up to its name: by being accessible to everyone in the world. This is more or less true, as there are still many web users whose needs aren’t adequately met. The Word Wide Web Consortium (W3C) has several recommendations on how to make a webpage accessible by users, not only with disabilities, but also by users that do not speak English.</description>
			<guid>http://www.extremefx.com.ar/blog/website-internationalization-and-accessibility</guid>
			<pubDate>Thu, 21 Jul 2011 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>The World Wide Web is capable of living up to its name: by being accessible to everyone in the world. This is more or less
	true, as there are still many web users whose needs aren't adequately met. The Word Wide Web Consortium (<a href="http://www.w3.org/">W3C</a>)
	has several recommendations on how to make a webpage accessible by users, not only with disabilities, but also by users
	that do not speak English.</p>

<p>View complete article here: 
<a href="http://blog.globalizationpartners.com/internationalization-and-accessibility.aspx" target="_blank">Website Internationalization and Accessibility</a></p>

]]></content:encoded>
		</item>
		<item>
			<title>Website Localization with Ektron – Part 2</title>
			<link>http://www.extremefx.com.ar/blog/website-localization-with-ektron-part-2</link>
			<description>Setting up correct Locales, adding Lang attributes and localizing hard-coded images are among the technical steps detailed in this final blog in this 2-part series on Website Localization with Ektron CMS.</description>
			<guid>http://www.extremefx.com.ar/blog/website-localization-with-ektron-part-2</guid>
			<pubDate>Fri, 27 Aug 2010 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>View complete article here: 
<a href="http://blog.globalizationpartners.com/localization-with-ektron-part-2.aspx" target="_blank">Website Localization with Ektron – Part 2</a></p>

]]></content:encoded>
		</item>
		<item>
			<title>Website Localization with Ektron – Part 1</title>
			<link>http://www.extremefx.com.ar/blog/website-localization-with-ektron-part-1</link>
			<description>This is the Part 1 (of 2) on &quot;Website Localization with Ektron Web CMS&quot;. In this part I will discuss how to correctly setup a multilingual website within Ektron and also provide some additional information about website localization in general.

When setting up a multilingual website in Ektron, there are several factors that fall outside the translation-only process that is built into the web system. Let&apos;s first set-up Ektron through the WorkArea.</description>
			<guid>http://www.extremefx.com.ar/blog/website-localization-with-ektron-part-1</guid>
			<pubDate>Fri, 06 Aug 2010 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>This is the Part 1 (of 2) on "Website Localization with Ektron Web CMS". In this part I will discuss how to correctly setup 
a multilingual website within Ektron and also provide some additional information about website localization in general.</p>

<p>View complete article here: 
<a href="http://blog.globalizationpartners.com/localization-with-ektron-part-1.aspx" target="_blank">Website Localization with Ektron – Part 1</a></p>

]]></content:encoded>
		</item>
		<item>
			<title>Website Translation, Website Localization and Website Internationalization</title>
			<link>http://www.extremefx.com.ar/blog/website-translation-website-localization-and-website-internationalization</link>
			<description>Many customers new to translation are confused by the terms &quot;translation&quot;, &quot;localization&quot; and &quot;internationalization&quot;. Although each term describes a distinct process for website projects, translation and localization are often used almost interchangeably. This blog clears up the mystery around these basic concepts.
Website translation is also known as &quot;Website Globalization&quot;. In order to &quot;translate&quot; a website into other languages you may need both Internationalization (I18N) and Localization (L10N) services.</description>
			<guid>http://www.extremefx.com.ar/blog/website-translation-website-localization-and-website-internationalization</guid>
			<pubDate>Tue, 22 Jun 2010 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>Many customers new to translation are confused by the terms "translation", "localization" and "internationalization". 
Although each term describes a distinct process for website projects, translation and localization are often used almost interchangeably. 
This blog clears up the mystery around these basic concepts.</p>

<p>Website translation is also known as "Website Globalization". In order to "translate" a website into other languages 
you may need both Internationalization (I18N) and Localization (L10N) services.</p>

<p>View complete article here: 
<a href="http://blog.globalizationpartners.com/website-translation-localization-and-internationalization.aspx" target="_blank">Website Translation, 
Website Localization and Website Internationalization</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>12 Steps to Website Globalization</title>
			<link>http://www.extremefx.com.ar/blog/12-steps-to-website-globalization</link>
			<description>Whether you are trying to launch a multilingual website to expand your products and services into new global markets or whether you are trying to increase your company&apos;s global operational efficiencies by developing multilingual extranets and …</description>
			<guid>http://www.extremefx.com.ar/blog/12-steps-to-website-globalization</guid>
			<pubDate>Fri, 30 Apr 2010 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>Whether you are trying to launch a multilingual website to expand your products and services into new global markets 
or whether you are trying to increase your company's global operational efficiencies by developing multilingual extranets 
and intranets, website globalization is a requirement to make either a reality. You must translate (globalize) your website 
to empower your web presence to effectively communicate, conduct and complete international e-commerce.</p>

<p>Website translation is also known as "website globalization". In order to truly "translate" a website into other languages you 
may need both internationalization (I18N) and localization (L10N) services.</p>

<p><strong>View complete article:</strong> 
<a href="http://blog.globalizationpartners.com/12-steps-to-website-globalization.aspx" target="_blank">12 Steps to Website Globalization</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Preconditionals and postconditionals checks</title>
			<link>http://www.extremefx.com.ar/blog/preconditionals-and-postconditionals-checks</link>
			<description>How many times you found yourself writing preconditions before executing some code (like argument validation) and post-conditions (validating some result before returning the value/using on another function)?So, for example:if (arg == null) throw … </description>
			<guid>http://www.extremefx.com.ar/blog/preconditionals-and-postconditionals-checks</guid>
			<pubDate>Tue, 31 Mar 2009 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>How many times you found yourself writing preconditions before executing some code (like argument validation) 
and post-conditions (validating some result before returning the value/using on another function)?</p>

<p>So, for example:</p>

<pre><code class="actionscript">if (arg == null) throw new ArgumentError("arg can not be null");
if (!(arg is IInterface)) throw new ArgumentError("arg must be of type IInterface");
....
if (ret == null) throw new Error("Something went wrong!");
return ret;</code></pre>

<p>That&rsquo;s good practice, but when you have to validate several conditions the code starts to look messy. 
For that reason, I created a couple of helper classes that takes cares of the job, providing a nice fluent typing.</p>

<h2>Pre-conditional checking examples:</h2>

<pre><code class="actionscript">requiresNumber(pIndex, "pIndex").isLessThan(_size);
requires(pCollection, "pCollection").isNotNull();
requiresString(pKey, "key").isNotNullOrEmpty();
requires(pValue, "value").isNotNull();
requires(pNode._parent, "node").isNotSameAs(this, "You cannot attach a node to itself").isTypeOf(TreeNode);</code></pre>

<h2>Post-conditional checking examples:</h2>
<pre><code class="actionscript">ensuresBool(ExternalInterface.available, "ExternalInterface is not available.").isTrue();
ensures(_entries[pOldKey]).isNotNull("Key ["+pOldKey+"] does not exists.");
ensuresNumber(days).isLessOrEqualThan(10675199, "Invalid number of days: "+days);</code></pre>

<h3>Usage</h3>
<p>You have 6 specific conditional checks (Array, Boolean, Date, Number, String) and one general. 
You access the conditionals by using either the requires[Type] functions or ensures[Type] functions.</p>

<p>The &ldquo;requires&rdquo; functions requires at least one parameter: the value you want to check. 
You can also pass a second parameter that represents the &ldquo;name&rdquo; of that value 
(you usually use &ldquo;requires&rdquo; to validate method arguments).</p>

<p>The conditions may have different number of parameters (depending on what are you checking). 
The last one is an additional string you may want to attach to the error description.</p>

<p>The &ldquo;ensures&rdquo; functions are similar to &ldquo;requires&rdquo;. Ensures needs at least one parameter (the value). 
The second argument is an additional message you may want to attach to the complete validation process, 
and the third one is the &ldquo;name&rdquo; of the variable you are checking.</p>

<p>This library is part of my flash framework. You can download it from <a href="http://code.google.com/p/efxflashsource/">Google Code</a></p>

<p><strong>Note:</strong> There is a bug on the FlexSDK4 that does not let me compile the full library as a .swc, 
nor create the documentation (If you are interested: <a href="http://bugs.adobe.com/jira/browse/SDK-20251">bug</a>). 
You have to download the library from the SVN repository. I will post a new ZIP file when the bug gets fixed.</p>
]]></content:encoded>
		</item>
		<item>
			<title>Method overloading in flash</title>
			<link>http://www.extremefx.com.ar/blog/method-overloading-in-flash</link>
			<description>As you may already know, it is not possible to have the same method with different signatures in flash (also known as method overloading).For example, on c# you may have the same function that does different things depending on the argument count …</description>
			<guid>http://www.extremefx.com.ar/blog/method-overloading-in-flash</guid>
			<pubDate>Fri, 27 Mar 2009 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>As you may already know, it is not possible to have the same method with different signatures in flash (also known as method overloading).</p>

<p>For example, on c# you may have the same function that does different things depending on the argument count/arguments types. 
The only limitation is that you can not have a method with the same signature (and different return type, for example).</p>

<p>So, this are perfectly valid method declarations:</p>

<pre><code class="actionscript">class Datetools {
	public function minus (date:Date):Timespan { ... }
	public function minus (span:Timespan):Date { ... }
}</code></pre>

<p>And the compiler then chooses the right one based on usage.</p>

<p>Now, how to do this in actionscript? The most used method is to add a switch/if statement inside the function and 
try to match the parameters. It is not only cumbersome but also hard to maintain.</p>

<p>So, using a little of black magic here and there, I present here my method overloader class.</p>

<pre><code class="actionscript">package extremefx.tools {
	/**
	 * @author Marcelo Volmaro
	 */
	 public final class Overloader {
	 	private var _methods:Object;
	 	
	 	public function Overloader(pTarget:Object, pFnc:String) {
	 		_methods = {};
	 		pTarget[pFnc] = _exec;
	 	}
	 	
	 	public function overload(pFunction:Function, ...args):void {
	 		_methods[args.join(")] = new Fnc(pFunction, args);
		}
		
		public function unoverload(...args):Boolean {
			return delete _methods[args.join(")];
		}
		
		private function _exec(...args):* {		
			var l:int = args.length, h:String = ", theF:Fnc;
			
			for(var i:int = 0; i &lt; l;i++){
				if (args[i] == null) continue;
				h += args[i].constructor;
			}
			
			//an exact match was found, use this.
			if ((theF = _methods[h])) return theF.f.apply(null, args);
			
			var bestMatch:int = -1,
			fnc:Function = null;
			
			for each(theF in _methods){
				if (theF.l != l) continue;//match number of arguments
				var m:int = 0;
				for (var j:uint = 0; j &lt; l; j++){
					if (args[j] is theF.a[j]) m++;//find out which method has the best match
				}
				
				if (m &gt; bestMatch){
					bestMatch = m;
					fnc = theF.f;
				}
			}
			
			return (fnc == null) ? null : fnc.apply(null, args);
		}
	}
}

final class Fnc {
	public var f:Function;
	public var a:Array;
	public var l:uint;
	public function Fnc(pF:Function, args:Array){
		f = pF;
		a = args;
		l = args.length;
	}
}</code></pre>

<h2>How to use?</h2>

<p>Simple. You need to instantiate a new Overloader class, passing as arguments the target object and the name 
of the function you want to overload. The overloaded function must be defined as a variable of type &ldquo;Function&rdquo;. 
The Overloader class will assign then the method that will check for arguments and calls the appropiate function.</p>

<pre><code class="actionscript">public function main():void {
	var o:Overloader = new Overloader(this, "testFnc");
	o.overload(_testO1, String);
	o.overload(_testO2, String, Boolean);
	o.overload(_testO3, Number);
	o.overload(_testO4, Function, Number);
	o.overload(_testO5, DummyTest, Number);
	
	trace(testFnc("A String"));//A String
	trace(testFnc("A String", true));//A String:true
	trace(testFnc("A String", false));//A String:false
	trace(testFnc(123.456));//123.456
	trace(testFnc(_testO1, 123.456));//Function plus:123.456
	trace(testFnc(this, 123.456));//Class [object DummyTest] plus:123.456
}

private function _testO1(pString:String):String {
	return pString;
}

private function _testO2(pString:String, pBool:Boolean):String {
	return pString + ":"+ pBool;
}

private function _testO3(pNumber:Number):Number {
	return pNumber;
}

private function _testO4(pFunction:Function, pNumber:Number):String {
	return "Function plus:"+pNumber;
}

private function _testO5(pClass:DummyTest, pNumber:Number):String {
	return "Class "+pClass+" plus:"+pNumber;
}

public var testFnc:Function;</code></pre>

<p>I&rsquo;d tried to make it bulletproof. If the specified parameter combination does not exist on the registered function list, 
the overloader will try to find out the best match from all the available functions, or at least one of the available functions. 
Please note that since flash player does runtime checking on the argument types, an exception may be thrown if the player can not do 
a type convert on the arguments (int, uint and numbers are convertibles, for example).</p>

<p>Hope you like it and as always, comments are welcomed!.</p>
]]></content:encoded>
		</item>
		<item>
			<title>Flash internationalization library</title>
			<link>http://www.extremefx.com.ar/blog/flash-internationalization-library</link>
			<description>This library will help you to internationalize your flash application. It supports localization of numbers, date/time, percentages and strings. It can also parse back numbers and date/time formats on a specific locale into flash internal …</description>
			<guid>http://www.extremefx.com.ar/blog/flash-internationalization-library</guid>
			<pubDate>Mon, 21 Apr 2008 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>This library will help you to internationalize your flash application. It supports localization of numbers, date/time, 
percentages and strings. It can also parse back numbers and date/time formats on a specific locale into flash internal formats.</p>

<h2>Details</h2>

<p>Most of the code is well documented. I choose to follow the .net c# conventions for formatting as is the one I use the most.</p>

<p>There is also a resource management class that will let you manage language-specific resources, 
like strings and bitmaps. The resource manager uses the standard XLIFF format and it supports trans-unit nodes as well as bin-unit nodes.</p>

<p>Bin-unit nodes can have external or internal content. External content can be anything that flash supports natively like text files, 
xml, sound, video and images. External content will be loaded at runtime after the XLIFF file is parsed.</p>

<p>Internal content can only be images.</p>

<p>The library also supports text pluralization. For the library to know a string is a pluralized string, 
the string &ldquo;[I18N]&rdquo; must precede the list of pluralization&rsquo;s.</p>

<p>ex: [I18N]|{0} file deleted.|{0} files deleted.</p>

<p>The number of plurals will depend on the language. Most languages uses two forms, singular used for one only, 
but other languages have more that one plural form (and others, like some of the Asian family, have no distinction between 
the singular and plural form).</p>

<p>For example, Polish uses e.g. plik (file) this way:</p>

<ul>
	<li>0 plik&oacute;w</li>
	<li>1 plik</li>
	<li>2-4 pliki</li>
	<li>5-21 plik&oacute;w</li>
	<li>22-24 pliki</li>
	<li>25-31 plik&oacute;w</li>
	<li>etc.</li>
</ul>

<p>And so on. Plural forms must be sorted like in real life. So, the singular first (if exists) and then the plurals.</p>

<p>The source code has a demo application that uses all the features the framework has. 
Please check that demo and the documentation for more information.</p>

<h3>TODO / Missing</h3>
<ul>
	<li>Calendars: Gregorian calendar and all its derivated works (Japanese, Julian, Korean, Taiwan, ThaiBuddhist). 
	All the Lunar Calendars are not implemented. Also, the UmAlQuraCalendar it's not implemented at all.</li>
	<li>HijriCalendar: Again, I implemented the algorithm, but I&rsquo;m not sure if it works correctly. 
	Need to check how the addHijriDate parameter works, if this parameter is the same as hijriAdjustment in .net, 
	and if the calendar works at all.</li>
	<li>Native digits on the NumberFormatInfo is implemented but currently the system does not replace digits on the output string. 
	Need to check with someone that knows Arabic on how this works.</li>
	<li>Collation tables (tables used for correct string sorting based on the language sorting rules) are not implemented. 
	Not sure if I will be able to implement this feature, as they are pretty big. The collation table for the Japanese language 
	only is a 9mb binary file.</li>
	<li>Bi-Di algorithm (have a rought version working, need to test against all the test cases).</li>
	<li>Inline node parsing on XLIFF files (to correctly handle inline tags, like bold, italic, links, etc).</li>
</ul>

<p>Source code and downloads at: <a href="http://code.google.com/p/efxflashsource">GoogleCode</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Flashxed</title>
			<link>http://www.extremefx.com.ar/blog/flashxed</link>
			<description>Flashxed is a puzzle game in which your goal is to move similar blocks together, which causes them to disappear. Once all the blocks are gone, you&amp;rsquo;ve solved the level and you&amp;rsquo;re presented with a new level to solve.</description>
			<guid>http://www.extremefx.com.ar/blog/flashxed</guid>
			<pubDate>Mon, 10 Sep 2007 00:00:00 </pubDate>
			<content:encoded><![CDATA[<h2>How to play:</h2>
<p>Flashxed is a puzzle game in which your goal is to move similar blocks together, which causes them to disappear. 
Once all the blocks are gone, you&rsquo;ve solved the level and you&rsquo;re presented with a new level to solve. 
You move blocks by pressing the mouse on them and dragging to either the right or left. 
If an empty space is encountered, &ldquo;gravity&rdquo; takes over and the blocks fall towards the bottom.</p>

<object type="application/x-shockwave-flash" data="/images.axd?src=flashxed.swf" width="320" height="320" class="block-center">
	<param name="movie" value="/images.axd?src=flashxed.swf" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#000000" />
	<param name="menu" value="false" />
</object>
]]></content:encoded>
		</item>
		<item>
			<title>Pazzo Francesco</title>
			<link>http://www.extremefx.com.ar/blog/pazzo-francesco</link>
			<description>You have to exit from every room by hiding all the platforms. Only when you have hidden all the platforms you can advance to the next level. To make things more difficult, you must complete a level before a timer ends.</description>
			<guid>http://www.extremefx.com.ar/blog/pazzo-francesco</guid>
			<pubDate>Tue, 03 Jul 2007 00:00:00 </pubDate>
			<content:encoded><![CDATA[<h2>How to play:</h2>
<p>You have to exit from every room by hiding all the platforms. Only when you have hidden all the platforms you can advance to the next level. 
To make things more difficult, you must complete a level before a timer ends.</p>

<p>Pazzo can jump in eight directions (up, down, left, right and up-left, up-right, down-left &amp; down-right) and his jump can be short or long. 
Use them wisely to advance from level to level.</p>

<p><strong>Cursor keys:</strong> standard jump.<br /><strong>Shift+cursor:</strong> long jump.</p>

<object type="application/x-shockwave-flash" data="/images.axd?src=pf_efrd.swf" width="640" height="448" class="block-center">
	<param name="movie" value="/images.axd?src=pf_efrd.swf" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#000000" />
	<param name="menu" value="false" />
</object>

]]></content:encoded>
		</item>
		<item>
			<title>Blocks</title>
			<link>http://www.extremefx.com.ar/blog/blocks</link>
			<description>Clear the screen by clicking two or more adjacent blocks of the same color.</description>
			<guid>http://www.extremefx.com.ar/blog/blocks</guid>
			<pubDate>Mon, 02 Jul 2007 00:00:00 </pubDate>
			<content:encoded><![CDATA[<h2>How to play:</h2>
<p>Clear the screen by clicking two or more adjacent blocks of the same color.</p>

<div class="videoWrapper" style="padding-bottom: 73.94%;"><object type="application/x-shockwave-flash" data="/images.axd?src=blocks.swf">
	<param name="movie" value="/images.axd?src=blocks.swf" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#000000" />
	<param name="menu" value="false" />
</object></div>
]]></content:encoded>
		</item>
		<item>
			<title>Fixing Flash External Interface inside Form on Internet Explorer</title>
			<link>http://www.extremefx.com.ar/blog/fixing-flash-external-interface-inside-form-on-internet-explorer</link>
			<description>Tried to use External Interface on a flash object inside an HTML form in Internet Explorer without any luck?. You know you actually can... right? No?. Follow this steps to fix that nasty EI under IE :)</description>
			<guid>http://www.extremefx.com.ar/blog/fixing-flash-external-interface-inside-form-on-internet-explorer</guid>
			<pubDate>Fri, 23 Feb 2007 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>As you all may know (or may not), if you want to use External Interface on a flash object that lives inside an "HTML" form, it will not work.</p>

<p>I will show you a simple test:</p>

<pre><code class="html">&lt;form&gt;
	&lt;object id="flashElement1" width="256" height="64" data="files/bug4.swf" type="application/x-shockwave-flash"&gt;
		&lt;param name="movie" value="files/bug4.swf" /&gt;
		&lt;param name="allowScriptAccess" value="always" /&gt;
	&lt;/object&gt;
	&lt;p&gt;&lt;a onclick="document.getElementById('flashElement1').testFunction(); return false;" href="#"&gt;Click to test&lt;/a&gt;&lt;/p&gt;
&lt;/form&gt;</code></pre>

<p>First of all, you will get a javascript error saying that the element &ldquo;flashElement1&rdquo; is undefined. 
And while in the flash window you will see the &ldquo;CallBack added Ok&rdquo;, if you click on the &ldquo;Click to test&rdquo; link 
you will get another error saying that the Object doesn&acute;t support that property or method.</p>

<p><strong>Why?:</strong> Easy. The way the javascript bridge with flash was coded is really awful. 
In IE, every time you add an &ldquo;ID&rdquo; attribute to an "HTML" element, that element is added to the &ldquo;window&rdquo; 
element so you can access it directly using window.elementID&hellip; but if you place the element inside an "HTML" form, 
the element is added to the form element (document.forms[0].elementID if you have only one form) and not window element. 
I suppose the person who did the bridge knowns nothing about this&hellip; I will not get into the details here, but you can believe me: 
The bridge it&acute;s screaming for a rewriting.</p>

<p><strong>How?:</strong> Well, this will depend on how are you embedding the object on the "HTML" page.</p>
<p>If you use <a href="http://blog.deconcept.com/swfobject/">SwfObject</a> you should add the following line after the 
line 105 (the line that reads n.innerHTML = this.getSWFHTML();):</p>

<pre><code class="javascript">if(!(navigator.plugins &amp;&amp; navigator.mimeTypes.length)) 
	window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));</code></pre>
	
<p>That applies to the current version of SwfObject (1.4.4).</p>
<p>If you use <a href="http://www.bobbyvandersluis.com/ufo/">UFO</a> you should add the following line after the line 230 
(the line that reads _e.innerHTML = '&lt;object classid="...):</p>

<pre><code class="javascript">if (_fo["id"]) window[_fo["id"]] = document.getElementById(_fo["id"]);</code></pre>

<p>That applies to "UFO" 3.20.</p>

<p>And if you use <a href="http://www.adobe.com/devnet/activecontent/articles/devletter.html">Adobe&acute;s Active Content</a> 
you should add the following line after the line 24 (the line that reads document.write(str);):</p>

<pre><code class="javascript">if (objAttrs["id"]) window[objAttrs["id"]] = document.getElementById(objAttrs["id"]);</code></pre>
]]></content:encoded>
		</item>
		<item>
			<title>Flash TextArea - Update 3</title>
			<link>http://www.extremefx.com.ar/blog/flash-textarea-update-3</link>
			<description>WARNING: This version should be considered BETA. It is stable enough for me, but it will surely break existing applications that depends on it.Don&amp;acute;t install this version on a production server and read the documentation!. I warned …</description>
			<guid>http://www.extremefx.com.ar/blog/flash-textarea-update-3</guid>
			<pubDate>Thu, 22 Feb 2007 00:00:00 </pubDate>
			<content:encoded><![CDATA[<h2>WARNING</h2>
<p>This version should be considered <strong>BETA</strong>. It is stable enough for me, 
but it will surely break existing applications that depends on it.</p>

<p>Don&acute;t install this version on a production server and read the documentation!. I warned you&hellip;</p>

<h3>Changes:</h3>
<ul>
	<li>Completely rewritten the javascript interface. The way the editor is placed was changed from the custom attribute to a class name.</li>
	<li>The editor is now localizable.</li>
	<li>Added Redo / Undo.</li>
	<li>Added Copy as HTML. (Right click over the text &ndash; may not work on some browsers).</li>
	<li>Added a function to determine which textareas were changed.</li>
	<li>Added the ability to create/delete folders in the file browser.</li>
	<li>Added a lot of information in the file browser.</li>
</ul>

<p>Download the latest version <a href="/files.axd?src=FlashTA.zip">FlashTA.zip</a> - 
<a href="/blog/flash-textarea-standards-compliant-xhtml-flash-editor">Read the documentation</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Flash TextArea - Update 2</title>
			<link>http://www.extremefx.com.ar/blog/flash-textarea-update-2</link>
			<description>I updated FlashTA, fixing some nasty bugs regarding image duplication (note to Adobe: please, please FIX the flash html area once and for all!).Also, i added the ability to delete a file. To delete a file, you must first select it, and then click on …</description>
			<guid>http://www.extremefx.com.ar/blog/flash-textarea-update-2</guid>
			<pubDate>Mon, 27 Nov 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>I updated FlashTA, fixing some nasty bugs regarding image duplication (note to Adobe: please, please FIX the flash html area once and for all!).</p>

<p>Also, i added the ability to delete a file. To delete a file, you must first select it, and then 
click on the &ldquo;delete&rdquo; icon at the left. A confirmation dialog will popup and if you click on Ok, the file will be deleted on the server.</p>

<p>Download the latest version <a href="/files.axd?src=FlashTA.zip">FlashTA.zip</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Black Jack</title>
			<link>http://www.extremefx.com.ar/blog/black-jack</link>
			<description>The objective is to get as close to 21 as possible without going over. The dealer has to take a card if he has 17 or more...</description>
			<guid>http://www.extremefx.com.ar/blog/black-jack</guid>
			<pubDate>Thu, 26 Oct 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[<h2>How to play:</h2>
<p>The objective is to get as close to 21 as possible without going over. The dealer has to take a card if he has 17 or more.</p>
<p>An ace counts as 1 or 11. face cards are worth 10. You can double down on your hand if you have the cash.</p>
<p>You will be dealt one card and if you win you will double your payout&hellip; of course your bet is doubled too.</p>
<p>You can take insurance if the dealer is showing an ace and you have enought cash. the insurance bet is 1/2 your original bet.</p>

<div class="videoWrapper" style="padding-bottom: 74.34%;"><object type="application/x-shockwave-flash" data="/images.axd?src=blackjack.swf">
	<param name="movie" value="/images.axd?src=blackjack.swf" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#000000" />
	<param name="menu" value="false" />
</object></div>
]]></content:encoded>
		</item>
		<item>
			<title>NN-X- Skin</title>
			<link>http://www.extremefx.com.ar/blog/nn-x-skin</link>
			<description>After my first skin and decided to make some more &amp;ldquo;original&amp;rdquo;, I made this skin.It has some elements from the first skin, but the overall look&amp;rsquo;n&amp;lsquo;feel is completely new.Download (45.83 kb)</description>
			<guid>http://www.extremefx.com.ar/blog/nn-x-skin</guid>
			<pubDate>Wed, 25 Oct 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p><img style="float: right;" src="/images.axd?src=nnx_skin.png" alt="*" />After my first skin and decided to make some 
more &ldquo;original&rdquo;, I made this skin.</p>

<p>It has some elements from the first skin, but the overall look&rsquo;n&lsquo;feel is completely new.</p>

<p><a class="download" href="/files.axd?src=nn-X-.wba">Download (45.83 kb)</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Extreme|FX Skin</title>
			<link>http://www.extremefx.com.ar/blog/extremefx-skin</link>
			<description>My first skin, based on screenshots of the Amiga QNX OS and various changes and adjust by me. Not sure if still works (for WB ver 2.x).Download (36.97 kb)</description>
			<guid>http://www.extremefx.com.ar/blog/extremefx-skin</guid>
			<pubDate>Tue, 24 Oct 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p><img style="float: right;" src="/images.axd?src=efx_skin.png" alt="*" />My first skin, based on screenshots of 
the Amiga QNX OS and various changes and adjust by me. Not sure if still works (for WB ver 2.x).</p>

<p><a class="download" href="/files.axd?src=CheloSkin.wba">Download (36.97 kb)</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Flash TextArea - Update 1</title>
			<link>http://www.extremefx.com.ar/blog/flash-textarea-update-1</link>
			<description>First round of bugfixes to Flash TextArea</description>
			<guid>http://www.extremefx.com.ar/blog/flash-textarea-update-1</guid>
			<pubDate>Fri, 18 Aug 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[<p>Thank to all who reported bugs in FlashTA. I updated the SVN and also the online zip.</p>

<h2>Bugfixes:</h2>

<ul>
	<li>If you placed an image at the very beggining of the text, sometimes the editor freezes.</li>
	<li>Problems with screen resize and text not showing, reverted back to use a scrollbar in the textarea.</li>
	<li>Fixed a lot of problems if the image file was invalid/corrupted/not available.</li>
	<li>A lot more that i don't remember right now :).</li>
</ul>

<p>Download the latest version <a href="/files.axd?src=FlashTA.zip">FlashTA.zip</a></p>
]]></content:encoded>
		</item>
		<item>
			<title>Flash TextArea - Standards compliant XHTML flash editor</title>
			<link>http://www.extremefx.com.ar/blog/flash-textarea-standards-compliant-xhtml-flash-editor</link>
			<description>FlashTA is a WYSIWYG replacement text area for html forms. While there are various implementations done in javascript, most of them don´t work in this/that browser/os combo, and every time a browser vendor makes a change, they need to update the editor so it doesn´t break on every possible combination of browsers.</description>
			<guid>http://www.extremefx.com.ar/blog/flash-textarea-standards-compliant-xhtml-flash-editor</guid>
			<pubDate>Sat, 04 Feb 2006 00:00:00 </pubDate>
			<content:encoded><![CDATA[
<h2>Introduction</h2>
<p>FlashTA is a WYSIWYG replacement text area for html forms. 
While there are various implementations done in javascript, most of them don&acute;t work in this/that browser/OS combo, 
and every time a browser vendor makes a change, they need to update the editor so it doesn&acute;t break on every possible combination of browsers.</p>

<p>FlashTA tries to overcome that problem by using flash. It also tries to adhere stricty to the xhtml specification. 
No presentation code is generated (so say bye bye to your idea of selecting text color, font face, etc).</p>

<p>FlashTA features an easy integration and multiple browser support (Mozilla, MSIE, FireFox, Opera &amp; Safari).</p>

<h2>Download</h2>
<p>Download the latest version <a href="/files.axd?src=FlashTA.zip">FlashTA.zip (176.70 kb)</a></p>

<h2>How to use</h2>

<p>FlashTA comes with 4 files:</p>

<ul>
	<li>FlashTA.swf (the editor itself)</li>
	<li>FlashFB.swf (the external file browser)</li>
	<li>fTAR.js (the javascript used to replace text areas with the flash editor)</li>
	<li>fileManager.php (example script used for image &amp; link management)</li>
</ul>

<p>Copy that files where your html files resides (or any other folder, it doesn&acute;t matter). 
You must call the fTAR.js script on any page that will be replacing text areas. 
The following line in the <code>&lt;head&gt;</code> should do the trick:</p>

<pre><code>&lt;script type="text/javascript" src="fTAR.js"&gt;&lt;/script&gt;</code></pre>

<p>To tell the script what textareas you want to be replaced, add to them the class &ldquo;efx_flashtextarea&rdquo;:</p>

<pre><code>&lt;textarea name="nameOfThisField" class="efx_flashtextarea"&gt;&lt;/textarea&gt;</code></pre>

<h3>Configuration</h3>

<p>The editor configuration is handled on the javascript file. For this, you should modify the lines that read:</p>

<pre><code>fTAR.FlashTextArea.setFilemanager('fileManager.php');
fTAR.FlashTextArea.setServerURL('http://localhost');
fTAR.FlashTextArea.useFileBrowser(true);
fTAR.FlashTextArea.setBasePath('');
fTAR.FlashTextArea.setLngFile('lang/en.xml');
fTAR.FlashTextArea.setup('FlashTA.swf', 'FlashFB.swf');</code></pre>

<h4>Explanation:</h4>
<p><strong>fTAR.setup(editor, filebrowser);</strong></p>

<ul>
	<li><strong>editor:</strong> path/name of the editor flash file. If you stored the editor on a folder called &ldquo;flashEditor&rdquo;, and the page that will use it is on the same level as the folder, the first parameter should be changed like: &ldquo;flashEditor/FlashTA.swf&rdquo;</li>
	<li><strong>filebrowser:</strong> path/name of the filebrowser flash file. If you stored the browser on a folder called &ldquo;flashEditor&rdquo;, and the page that will use it is on the same level as the folder, the first parameter should be changed like: &ldquo;flashEditor/FlashFB.swf&rdquo;.</li>
</ul>

<p>It lets you configure an input field to browse the server for a file. It&acute;s like the normal browse button, but for server side files.</p>

<p>You should add the class &ldquo;efx_browser&rdquo; to the input field to enable it to browse all files, or with 
the class &ldquo;efx_browser_images&rdquo; to enable the field to browse for images only. Of course, for this you need a 
working fileManager.php already configured.</p>

<p><strong>fTAR.FlashTextArea.setFilemanager(path to the fileManager.php file);</strong><br />This file is used by 
the file browser and the image browser. Please note that this file is used for file browsing and file uploading.</p>

<p><strong>fTAR.FlashTextArea.setServerURL(serverURL);</strong><br />Url of the server used to retrieve the images. 
Directories are allowed here.</p>

<p><strong>fTAR.FlashTextArea.setBasePath(relativePath);</strong><br />Used to prefix links &amp; images. 
The final URL of an image/link will be &ldquo;relativePath/User selected Path/User selected file&rdquo;.</p>

<p>&ldquo;serverURL/relativePath/imagename&rdquo; should point to a valid image. The editor will use that information 
to retrieve the image from the server.</p>

<p>You will also need to setup the fileManager.php script as following:</p>
<ul>
	<li><strong>diskPath:</strong> Folder on the server that holds the images/files accessible by the editor.</li>
	<li><strong>thumbPath:</strong> Folder on the server, with write permissions, in where the script will store thumbnails 
	of the user selected images, if the size of the image exceeds 210 &times; 210 px. This is to speed up the preview on the 
	filebrowser and is not a must. If you don&acute;t want thumbs to be created, simply put an empty string (&rsquo;&lsquo;).</li>
	<li><strong>ftpPath, ftpServer, ftpUser, ftpPass:</strong> If PHP is running in safe mode, a directory created through mkdir() 
	will not be assigned to you, but to the user that your host&rsquo;s server or php process is running under, 
	usually &lsquo;nobody&rsquo;, &lsquo;apache&rsquo; or &lsquo;httpd&rsquo;. In practice, this means that you can create directories, 
	even add files to them, but you can&rsquo;t delete the directory or its contents nor change permissions. This information 
	is used in that case, so the created directory can be accessed freely like any other. ftpPath needs to has the address to the starting 
	folder in where the files/images will be stored. ftpServer, ftpUser, ftpPass need to be completed with the server, username 
	and password used to access the website via FTP.</li>
</ul>

<p><strong>fTAR.FlashTextArea.useFileBrowser(true | false);</strong><br />If you don&acute;t want the filebrowser to 
be accesible from withing the editor, simply pass false to this function.</p>

<p><strong>fTAR.FlashTextArea.setLngFile(path to language file);</strong><br />Both the fileBrowser and the editor are 
localizables through an XML file. If you want to use the editor/browser in your language, take a look at the files in 
the &ldquo;lang&rdquo; folder.</p>

<p>The buttons in the editor can be configured as following:</p>

<ul>
	<li>fTAR.FlashTextAreaButtons.bold(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.italic(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.underline(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.leftAlign(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.centerAlign(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.rightAlign(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.justifyAlign(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header1(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header2(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header3(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header4(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header5(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.header6(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.bullets(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.quote(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.links(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.images(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.undo(true | false);</li>
	<li>fTAR.FlashTextAreaButtons.redo(true | false);</li>
</ul>

<p>Also, there are some methods that can be usefull:</p>

<p><strong>fTAR.FlashTextArea.updateContent();</strong><br />Forces an update of all text areas. 
Usually, the content of the &ldquo;browser&rdquo; textareas is not updated until the user press the submit button.</p>

<p>If you placed the FlashTextArea inside a tabbed UI, you must call this method prior to change the text area visibility. 
Browsers remove the flash object from the DOM when changing visibility and you will lost all the changes made.</p>

<p><strong>fTAR.FlashTextArea.getChangedAreas();</strong><br />Returns &ldquo;false&rdquo; if no textareas were changed, 
or an array of the changed textareas.</p>

<p><strong>fTAR.FlashTextArea.hasChanged(areaName);</strong><br />Returns true if the area named &ldquo;areaName&rdquo; was 
changed, false if not.</p>

<p>There are also a bunch of CSS styles that you can play with. Take a look at the source code.</p>

<h2>Known bugs and limitations:</h2>
<ul>
	<li>Sometimes in the editor, after you insert an image, the cursor changes to a small caret, and 
	all text inserted at that place will look like a bunch of dots. This is a known issue of the player 
	(at least it&acute;s known by my&hellip; bug already reported to Macromedia). The text is in there and 
	if you submit the data, the text will be in their place.</li>
</ul>

<h3>History (* fixed/changed, + added, &ndash; removed)</h3>

<ul>
	<li>+ The editor is now localizable.</li>
	<li>+ Redo / Undo.</li>
	<li>+ Copy as HTML. (Right click over the text).</li>
	<li>+ Added a way to determine what textareas were changed.</li>
	<li>- Flash automatic update if flash version &lt; 8.</li>
	<li>* Finally!, discovered a way to fix Flash&acute;s ExternalInterface on IE under forms. This simplified a lot the code.</li>
</ul>

<hr />

<ul>
	<li>*  Changed how the editor gets the text. Now it can be placed on &ldquo;tabs&rdquo; systems without loosing the content. You need to call fTAR.FlashTextArea.updateContent() before doing anything with the editor visibility.</li>
	<li>*  Fixed a lot of image duplication bugs caused by the Flash Player.</li>
	<li>+ Added the ability to delete files on the file browser.</li>
</ul>

<hr />

<ul>
	<li>*  Ported to use Macromedia Components</li>
	<li>+ Added backgroundColor</li>
	<li>*  Fixed image dissapearing bug.</li>
	<li>+ Re-added the scrollbar.</li>
	<li>*  A lot of bugfixes that i don&acute;t remember now.</li>
</ul>

<hr />

<ul>
	<li>+ Added a &ldquo;delete&rdquo; button in the insert image window.</li>
	<li>* Buttons config now works as expected.</li>
	<li>*  Fixed some problems with unicode chars under Opera 8.5+</li>
	<li>- Removed the scrollbar &ndash; Now the editor resizes itself as needed.</li>
</ul>

<hr />

<ul>
	<li>+ First launch</li>
</ul>

<p>See the complete project at <a href="http://osflash.org/flashtextarea" target="_blank">OSFlash/FlashTextArea</a></p>
]]></content:encoded>
		</item>

	</channel>
</rss>