<?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>All I don&#039;t know &#187; Flash</title>
	<atom:link href="http://blog.derraab.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.derraab.com</link>
	<description>About Flash™, Flex™, software development and my computer. And JavaScript.</description>
	<lastBuildDate>Sat, 26 Nov 2011 18:31:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Removing comments in CSS, HTML and ECMAScript (JavaScript)</title>
		<link>http://blog.derraab.com/2011/11/26/removing-comments-in-css-html-and-ecmascript-javascript/</link>
		<comments>http://blog.derraab.com/2011/11/26/removing-comments-in-css-html-and-ecmascript-javascript/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 18:31:36 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=767</guid>
		<description><![CDATA[While working on an Adobe AIR based source code editor I was looking for an easy way to remove comments from different kind of source codes. What first seemed like an easy regular expression turned out to be much more &#8230; <a href="http://blog.derraab.com/2011/11/26/removing-comments-in-css-html-and-ecmascript-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While working on an Adobe AIR based source code editor I was looking for an easy way to remove comments from different kind of source codes. What first seemed like an easy regular expression turned out to be much more complex because comment pre- and suffixes can also occur in string literals or regular expressions and our old friend Internet Explorer allows <a href="http://en.wikipedia.org/wiki/Conditional_Comments" title="http://en.wikipedia.org/wiki/Conditional_Comments" target="_blank"><code>HTML</code> conditional comments and <code>JavaScript</code> conditional compilation</a>. Great.</p>
<p>First I had a look at <a href="http://developer.yahoo.com/yui/compressor/" title="http://developer.yahoo.com/yui/compressor/" target="_blank"><code>YUICompressor</code>s</a> source code and <a href="http://code.google.com/intl/en-EN/speed/page-speed/" title="http://code.google.com/intl/en-EN/speed/page-speed/" target="_blank">Google Page Speed</a> but then I decided to port a script for <a href="http://james.padolsey.com/javascript/removing-comments-in-javascript" title="http://james.padolsey.com/javascript/removing-comments-in-javascript" target="_blank">removing <code>JavaScript</code> comments created by James Padolsey</a>.</p>
<p>I just improved the recognition for regular expressions a little and since this code should work with all <code>ECMAScript</code> based source codes I named my class <code>ECMAScriptParser</code> instead of <code>JavaScriptParser</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package de.<span style="color: #006600;">superclass</span>.<span style="color: #006600;">parser</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/**
     * @author Markus Raab (superclass.de | blog.derRaab.com)
     */</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ECMAScriptParser
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">/**
         * Removes inline and block comments from an ECMAScript source string. 
         * 
         * This is a port of James Padolsey     with an slightly improved RegExp recognition.
         * @see: http://james.padolsey.com/javascript/removing-comments-in-javascript
         * 
         * @param ecmaScript        ECMAScript source string
         * @param removeCondComp    Optional (default=false) - Whether to remove Internet Explorers JavasScript conditional compilation comments or not.   
         * @return                    ECMAScript source string without comments
         */</span>
        <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> removeComments<span style="color: #66cc66;">&#40;</span> ecmaScript : <span style="color: #0066CC;">String</span>, removeCondComp : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">String</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> modeSingleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeDoubleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeRegExp            : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeBlockComment    : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeLineComment        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeCondComp        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>; 
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> vector : Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span> = Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'__'</span> + ecmaScript + <span style="color: #ff0000;">'__'</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
                vector.<span style="color: #006600;">fixed</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> c : <span style="color: #0066CC;">int</span> = vector.<span style="color: #0066CC;">length</span>;
&nbsp;
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">string</span> : <span style="color: #0066CC;">String</span> = vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span>;
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeRegExp <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeRegExp = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeSingleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeSingleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeDoubleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeDoubleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeBlockComment <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeLineComment<span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #0066CC;">string</span> = vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span>;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #66cc66;">||</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\r</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeLineComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeCondComp <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'@'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeCondComp = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeDoubleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeSingleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span> removeCondComp <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'@'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeCondComp = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
&nbsp;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeLineComment = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> k : <span style="color: #0066CC;">int</span> = i - <span style="color: #cc66cc;">1</span>; <span style="color: #000000; font-weight: bold;">true</span>; k-- <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #0066CC;">string</span> = vector<span style="color: #66cc66;">&#91;</span> k <span style="color: #66cc66;">&#93;</span>;
                        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">&#41;</span>
                        <span style="color: #66cc66;">&#123;</span>
                            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'='</span> <span style="color: #66cc66;">&#41;</span>
                            <span style="color: #66cc66;">&#123;</span>
                                modeRegExp = <span style="color: #000000; font-weight: bold;">true</span>;
                            <span style="color: #66cc66;">&#125;</span>
                            <span style="color: #b1b100;">break</span>;
                        <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
            <span style="color: #b1b100;">return</span> vector.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">slice</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2</span>, -<span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Allright &#8211; CSS doesn&#8217;t allow inline or conditional comments so I removed this script functionality and created a <code>CSSParser</code> class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package de.<span style="color: #006600;">superclass</span>.<span style="color: #006600;">parser</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/**
     * @author Markus Raab (superclass.de | blog.derRaab.com)
     */</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CSSParser
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">/**
         * Removes comments from a CSS string. 
         * 
         * This is a shrinked port of James Padolseys script.
         * @see: http://james.padolsey.com/javascript/removing-comments-in-javascript
         * 
         * @param css                CSS string
         * @return                    CSS string without comments
         */</span>
        <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> removeComments<span style="color: #66cc66;">&#40;</span> css : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">String</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> modeSingleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeDoubleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeBlockComment    : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> vector : Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span> = Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'__'</span> + css + <span style="color: #ff0000;">'__'</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
                vector.<span style="color: #006600;">fixed</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> c : <span style="color: #0066CC;">int</span> = vector.<span style="color: #0066CC;">length</span>;
&nbsp;
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">string</span> : <span style="color: #0066CC;">String</span> = vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span>;
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeSingleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeSingleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeDoubleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeDoubleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeBlockComment <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeDoubleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeSingleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
&nbsp;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
            <span style="color: #b1b100;">return</span> vector.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">slice</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2</span>, -<span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Good. Lastly I extended the code to remove all comments within <code>HTML</code> source code, which can also contain <code>JavaScript</code> and of course <code>CSS</code>. This is the <code>HTMLParser</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package de.<span style="color: #006600;">superclass</span>.<span style="color: #006600;">parser</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/**
     * @author Markus Raab (superclass.de | blog.derRaab.com)
     */</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HTMLParser
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">/**
         * Removes all HTML, CSS and ECMAScript comments from a HTML string.
         * 
         * This is an extended port of James Padolseys script with an improved RegExp recognition.
         * @see: http://james.padolsey.com/javascript/removing-comments-in-javascript
         * 
         * @param html                        HTML string
         * @param removeHTMLCondComment        Optional (default=false) - Whether to remove Internet Explorers HTML conditional comments or not.
         * @param removeJSCondComp            Optional (default=false) - Whether to remove Internet Explorers JavasScript conditional compilation comments or not.
         * @return                            HTML string without comments
         */</span>
        <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> removeComments<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">html</span> : <span style="color: #0066CC;">String</span>, removeHTMLCondComment : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>, removeJSCondComp : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">String</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> modeSingleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeDoubleQuote        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeRegExp            : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeBlockComment    : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeLineComment        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> modeJSCondComp        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> modeHTMLComment        : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #000000; font-weight: bold;">var</span> modeHTMLCondComment    : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> vector : Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span> = Vector.<span style="color: #66cc66;">&lt;</span>String<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'__'</span> + <span style="color: #0066CC;">html</span> + <span style="color: #ff0000;">'__'</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
                vector.<span style="color: #006600;">fixed</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> c : <span style="color: #0066CC;">int</span> = vector.<span style="color: #0066CC;">length</span>;
&nbsp;
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">string</span> : <span style="color: #0066CC;">String</span> = vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span>;
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeRegExp <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeRegExp = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeSingleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeSingleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeDoubleQuote <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeDoubleQuote = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeBlockComment <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'/'</span><span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeLineComment<span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #0066CC;">string</span> = vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span>;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #66cc66;">||</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\r</span>'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeLineComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeJSCondComp <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'@'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i - <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeJSCondComp = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeHTMLComment <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #808080; font-style: italic;">// --&gt; </span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'&gt;'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
&nbsp;
                        modeHTMLComment = <span style="color: #000000; font-weight: bold;">false</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> modeHTMLCondComment <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'i'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'f'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">']'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'&gt;'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// if]--&gt; </span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeHTMLCondComment = <span style="color: #000000; font-weight: bold;">false</span>;
                        i += <span style="color: #cc66cc;">5</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&lt;'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'!'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'-'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// &lt;!--</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span> removeHTMLCondComment <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'['</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'i'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">6</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'f'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// &lt;!--[if</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeHTMLCondComment = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #b1b100;">else</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeHTMLComment = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'&quot;'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeDoubleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    modeSingleQuote = <span style="color: #000000; font-weight: bold;">true</span>;
                    <span style="color: #b1b100;">continue</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span> removeJSCondComp <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&amp;&amp;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'@'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        modeJSCondComp = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'*'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
&nbsp;
                        modeBlockComment = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> vector<span style="color: #66cc66;">&#91;</span> i + <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> === <span style="color: #ff0000;">'/'</span> <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        vector<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">''</span>;
                        modeLineComment = <span style="color: #000000; font-weight: bold;">true</span>;
                        <span style="color: #b1b100;">continue</span>;
                    <span style="color: #66cc66;">&#125;</span>
&nbsp;
                    <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> k : <span style="color: #0066CC;">int</span> = i - <span style="color: #cc66cc;">1</span>; <span style="color: #000000; font-weight: bold;">true</span>; k-- <span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #0066CC;">string</span> = vector<span style="color: #66cc66;">&#91;</span> k <span style="color: #66cc66;">&#93;</span>;
                        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> <span style="color: #66cc66;">!</span>== <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">&#41;</span>
                        <span style="color: #66cc66;">&#123;</span>
                            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">string</span> === <span style="color: #ff0000;">'='</span> <span style="color: #66cc66;">&#41;</span>
                            <span style="color: #66cc66;">&#123;</span>
                                modeRegExp = <span style="color: #000000; font-weight: bold;">true</span>;
                            <span style="color: #66cc66;">&#125;</span>
                            <span style="color: #b1b100;">break</span>;
                        <span style="color: #66cc66;">&#125;</span>
                    <span style="color: #66cc66;">&#125;</span>
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
            <span style="color: #b1b100;">return</span> vector.<span style="color: #0066CC;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">slice</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2</span>, -<span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Let me know if I made a mistake but it seems to work quite well. Or do you know a good library that already does this kind of optimizations?</p>
<p>Well, that&#8217;s it for now. Have fun coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/11/26/removing-comments-in-css-html-and-ecmascript-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari Flash Player detection problems with ClickToFlash</title>
		<link>http://blog.derraab.com/2011/06/06/safari-flash-player-detection-problems-with-clicktoflash/</link>
		<comments>http://blog.derraab.com/2011/06/06/safari-flash-player-detection-problems-with-clicktoflash/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 10:52:39 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash in Browser]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=609</guid>
		<description><![CDATA[I really like the concept of blocking Flash, mainly because I don&#8217;t see these unwanted, crappy developed Flash adds sucking performance, but also because it&#8217;s a nice way to recognise Flash parts in websites. You&#8217;ll have your own reasons. Safari &#8230; <a href="http://blog.derraab.com/2011/06/06/safari-flash-player-detection-problems-with-clicktoflash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I really like the concept of blocking Flash, mainly because I don&#8217;t see these unwanted, crappy developed Flash adds sucking performance, but also because it&#8217;s a nice way to  recognise Flash parts in websites. You&#8217;ll have your own reasons.</p>
<p>Safari is, except for testing purposes, my browser of choice, but I was having trouble on different websites accessing Flash content because the Flash plugin was not detected correctly. Since I had to <a href="http://blog.derraab.com/2011/02/10/the-hitchhikers-guide-to-a-flash-player-update/">update the Flash Player on my system</a> again, I decided to figure out what the problem is.</p>
<p>According to <a href="http://playerversion.com/">Playerversion.com</a> an older Flash Player version &#8211; <code>MAC 10,0,45,0</code> &#8211; was found first, then the display switched to my installed Flash version &#8211; <code>MAC 10,3,181,14 (Debug player)</code>.</p>
<p>I used the Flash Player Uninstaller but Flash Player version <code>MAC 10,0,45,0</code> was still displayed in Safari.</p>
<p>After some research I figured out that <a href="http://clicktoflash.com/">ClickToFlash</a> doesn&#8217;t display the correct Flash Player version and therefore doesn&#8217;t work in all Flash detection scripts. Just check <code>Safari - Help - Installed Plugins and search for "Flash"</code> and you&#8217;ll see that <a href="http://clicktoflash.com/">ClickToFlash</a> simulates somehow an outdated Flash Player version (seems to be hardcoded).</p>
<p>So until <a href="http://clicktoflash.com/">ClickToFlash</a> will be updated displaying the correct installed Flash Player version I&#8217;ll use <a href="http://safariadblock.com/">AdBlock For Safari</a>. More Flash but less problems &#8211; hopefully. <img src='http://blog.derraab.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/06/06/safari-flash-player-detection-problems-with-clicktoflash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFK11 &#8211; beyond tellerrand notes</title>
		<link>http://blog.derraab.com/2011/04/08/ffk11-beyond-tellerrand-notes/</link>
		<comments>http://blog.derraab.com/2011/04/08/ffk11-beyond-tellerrand-notes/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 22:03:46 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash on iOS]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[iPhone / iPad]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=578</guid>
		<description><![CDATA[I&#8217;m still not sure if &#8220;beyond tellerrand&#8221; is a subtitle or will become the new brand for the one and only Flashforum conference here in germany. Sascha Wolter and Marc Thiele did a great job as always and even I &#8230; <a href="http://blog.derraab.com/2011/04/08/ffk11-beyond-tellerrand-notes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still not sure if &#8220;<a href="http://ffk11.beyondtellerrand.com/">beyond tellerrand</a>&#8221; is a subtitle or will become the new brand for the one and only <a href="http://www.flashforum.de/">Flashforum</a> conference here in germany. <a href="http://www.wolter.biz/">Sascha Wolter</a> and <a href="http://www.marcthiele.com/">Marc Thiele</a> did a great job as always and even I never went to another conference, FFK seems still to be a special one. Again I was lucky listening to some really cool stuff.</p>
<p>Interestingly most of my <a href="http://blog.derraab.com/2010/04/20/ffk10-flashforum-conference-notes/">last year notes</a> are still up to date, which doesn&#8217;t help if you don&#8217;t keep them in mind. So I think it&#8217;s a good idea to read my own notes from time to time. <img src='http://blog.derraab.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>That&#8217;s what I became aware of this time:</p>
<p><strong>AIR 2.6</strong></p>
<ul>
<li>Lee Brimelow mentioned AIR 2.6 on iOS is faster than on Android!  Yeah.</li>
<li>Adobe is working hard on increasing performance near to native code.</li>
<li>Installing a runtime seems to be annoying for Android users, so Adobe is thinking about compiling for Android like for iOS. Which might bring some extra performance as well.</li>
<li>I asked Lee Brimelow about A<strong>IR on Windows Phone 7</strong> and he said something like &#8220;Adobe is currently not working on that and it would be a lot of work&#8221;. Well, of course Microsoft is not interested having AIR on their system, but it would be a really important platform for all of us. So in my opinion Adobe at least has a small team checking out what&#8217;s possible. What do you think about Windows Phone 7 and AIR support?</li>
</ul>
<p><strong>Flex Builder 4.5</strong></p>
<ul>
<lI>You can get Flex SDK 4.5 already, but there&#8217;s also a way to join the private pre-release program to get early access to Flex Builder 4.5. Just visit <a href="http://www.surveymonkey.com/s/flexprerelease">http://www.surveymonkey.com/s/flexprerelease</a>. They are working on some useful stuff and it might be a good idea to test some of the new features.</li>
<li>Deepa Supramaniam mentioned spark MXML skins have performance issues on mobile devices. That&#8217;s why they created pure ActionScript spark skins for mobile applications. Hopefully, within the private beta Flex SDKs, we&#8217;ll find some great improvements: <a href="http://www.riagora.com/2011/03/preview-of-flex-on-ios/">http://www.riagora.com/2011/03/preview-of-flex-on-ios/</a>.</li>
</ul>
<p><strong>NUI</strong></p>
<ul>
<li><a href="https://www.xing.com/profile/Wolfgang_Henseler">Wolfgang Henseler</a> (<a href="http://vimeo.com/18400281">Talk I missed at FFK10</a>)  opened my mind according <a href="http://en.wikipedia.org/wiki/Natural_user_interface">NUI</a>.</li>
<li>Don&#8217;t think of apps on mobile devices but of services allowing you reaching your goal faster than a website.</li>
<li>Think about providing services, combining them, rethinking them.</li>
<li>Use less design and let objects provide their functionalities (e.g. tap on image to get some options).</li>
<li>My brain is very busy with that NUI thing. E. g. he mentioned the <a href="http://siri.com/">Siri</a> iPhone app. It&#8217;s not about how it looks like (not so cool) but how it works! Combining lots of possibilities with a really easy interface (speech) . He was also talking about &#8220;in body technology&#8221; (sensors and stuff like that.) and <a href="http://www.tedmed.com/">http://www.tedmed.com/</a></li>
<li>After Dennis Ippels Kinect (<a href="http://openkinect.org">OpenKinect</a> / <a href="http://www.primesense.com/">http://www.primesense.com/</a>) introduction I finally know something about the magic behind this device as well.</li>
</ul>
<p><strong>Molehill</strong></p>
<ul>
<li><a href="http://tinyurl.com/molehilldemos">http://tinyurl.com/molehilldemos</a>. What can I say. Molehill performance is stunning (for the web).</li>
<li>And keep in mind that you need to set <code>wmode="direct"</code> within your HTML settings! Otherwise you won&#8217;t get hardware acceleration.</li>
<li>Molehill itself is way to low level for most of us. So we&#8217;ll use 3D frameworks as we did before.</li>
<li><a href="http://away3d.com/">Away 3D </a>currently seems to be the weapon of choice.</li>
<li><a href="http://www.derschmale.com/">David Lenaerts</a> gave us some real insights. Thanks, man!</li>
<li>And if you&#8217;re using FDT you should check out: <a href="http://blog.powerflasher.de/macht-euer-fdt-molehill-ready/">http://blog.powerflasher.de/macht-euer-fdt-molehill-ready/</a> (german).</li>
</ul>
<p><strong>Additional useful links:</strong></p>
<ul>
<li><a href="http://www.appannie.com/">http://www.appannie.com/</a></li>
<li><a href="http://flixel.org/">http://flixel.org/</a></li>
<li><a href="http://pushbuttonengine.com/">http://pushbuttonengine.com/</a> (like last year!;)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/04/08/ffk11-beyond-tellerrand-notes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>#FFK11</title>
		<link>http://blog.derraab.com/2011/04/05/ffk11/</link>
		<comments>http://blog.derraab.com/2011/04/05/ffk11/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 21:54:57 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=572</guid>
		<description><![CDATA[Contact me if you&#8217;re there: @derRaab]]></description>
			<content:encoded><![CDATA[<p><a href="http://ffk11.beyondtellerrand.com"><img src="http://blog.derraab.com/wp-content/uploads/2011/04/ffk11_468x60.jpg" alt="" title="ffk11_468x60" width="468" height="60" class="alignnone size-full wp-image-573" /></a><br />
Contact me if you&#8217;re there: <a href="https://twitter.com/derraab">@derRaab</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/04/05/ffk11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS development with AIR 2.6 using FDT and my new friend ANT</title>
		<link>http://blog.derraab.com/2011/04/04/ios-development-with-air-2-6-using-fdt-and-my-new-friend-ant/</link>
		<comments>http://blog.derraab.com/2011/04/04/ios-development-with-air-2-6-using-fdt-and-my-new-friend-ant/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 22:21:55 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash on iOS]]></category>
		<category><![CDATA[iPhone / iPad]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=557</guid>
		<description><![CDATA[Adobe recently released AIR 2.6 with improved iOS support, so I finally had to get into using ADT with ANT. My editor of choice is FDT so I wanted to do as less extra work as possible. Mainly because I&#8217;m &#8230; <a href="http://blog.derraab.com/2011/04/04/ios-development-with-air-2-6-using-fdt-and-my-new-friend-ant/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Adobe recently released AIR 2.6 with improved iOS support, so I finally had to get into using ADT with ANT. My editor of choice is FDT so I wanted to do as less extra work as possible. Mainly because I&#8217;m no terminal-guy. I need a clean GUI holding my hand while setting up workspaces, linking libraries and stuff like that. In other words, command line and compiler arguments are freaking me out. <img src='http://blog.derraab.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I read a lot of blogposts and articles (see link list on the bottom of this post) but most of them compile SWFs using ANT, which means setting source path and stuff like that as command line arguments. But hey, FDT does this already during my daily workflow, so to me it seems natural reusing this within the iOS packaging process.</p>
<p>So I won&#8217;t comment a lot what I came up with because all of this can be read on one of the sites below, but show you simply a screenshot of my &#8220;IOSAIRTest&#8221; workspace structure and of course the ANT files. Notice that I&#8217;m not into having different directories for debug, publish, testing and so. I like to have all source files clean and separated by file type (would have an mxml folder too):</p>
<p><a href="http://blog.derraab.com/wp-content/uploads/2011/04/AIRTestWorkspace.jpg"><img src="http://blog.derraab.com/wp-content/uploads/2011/04/AIRTestWorkspace.jpg" alt="" title="AIRTestWorkspace" width="310" height="446" class="alignnone size-full wp-image-555" /></a></p>
<p>You will find the most interesting files in src/ant. Let&#8217;s start with <code>local.properties</code> which just defines the SDK path:</p>

<div class="wp_syntax"><div class="code"><pre class="ant" style="font-family:monospace;">FLEX_HOME=/Users/{USERNAME}/Path/To/FlexSDKs/4.5.0.17689_AIR_2.6
MXMLC=${FLEX_HOME}/bin/mxmlc
ADT=${FLEX_HOME}/bin/adt</pre></div></div>

<p>Within <code>build.properties</code> you setup all params regarding your project:</p>

<div class="wp_syntax"><div class="code"><pre class="ant" style="font-family:monospace;">app.rootdir=./../..
app.descriptor=${app.rootdir}/bin/IOSAIRTest-app.xml
app.rootfile=IOSAIRTest.swf
app.sourcedir=${app.rootdir}/src/as
app.bindir=${app.rootdir}/bin
app.source=${app.sourcedir}/de/superclass/IOSAIRTest.as
app.includes=assets icons Default.png Default-Portrait.png
&nbsp;
build.storetype=pkcs12
build.keystore=${app.rootdir}/resources/ios/iPhoneDevCert.p12
build.storepass={PASSWORD;)}
build.mobileprofile=${app.rootdir}/resources/ios/AIR_TEST.mobileprovision
build.name=IOSAIRTest.ipa
&nbsp;
fdt.projectname=AIRTest
fdt.mainclass=${app.source}
fdt.target=${app.bindir}/${app.rootfile}</pre></div></div>

<p>And <code>build.xml</code> contains four ways to create the IPA package and the according FDT tasks:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AIR export&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;local.properties&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;build.properties&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- FDT tasks</span>
&nbsp;
<span style="color: #808080; font-style: italic;">        see http://fdt.powerflasher.com/docs/FDT_Ant_Tasks#fdt.launch.application - for documentation</span>
<span style="color: #808080; font-style: italic;">        see http://fdt.powerflasher.com/docs/FDT_and_Ant_Tutorial#Your_First_Task:_Compiling_.26_JRE_Error - if you run into errors!</span>
<span style="color: #808080; font-style: italic;">    --&gt;</span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;FDT create SWF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fdt.launch.resetFlexCompiler</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fdt.launch.application</span></span>
<span style="color: #009900;">            <span style="color: #000066;">projectname</span>=<span style="color: #ff0000;">&quot;${fdt.projectname}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">mainclass</span>=<span style="color: #ff0000;">&quot;${fdt.mainclass}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">profile</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;${fdt.target}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">startswf</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;FDT create SWF debug&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fdt.launch.resetFlexCompiler</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fdt.launch.application</span></span>
<span style="color: #009900;">            <span style="color: #000066;">projectname</span>=<span style="color: #ff0000;">&quot;${fdt.projectname}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">mainclass</span>=<span style="color: #ff0000;">&quot;${fdt.mainclass}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">profile</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;${fdt.target}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">startswf</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- ADT tasks --&gt;</span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;iOS create IPA debug&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;FDT create SWF debug&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-package</span>
<span style="color: #009900;">                        -target ipa-debug</span>
<span style="color: #009900;">                        -storetype ${build.storetype}</span>
<span style="color: #009900;">                        -keystore ${build.keystore}</span>
<span style="color: #009900;">                        -storepass ${build.storepass}</span>
<span style="color: #009900;">                        -provisioning-profile ${build.mobileprofile}</span>
<span style="color: #009900;">                        ${app.bindir}/${build.name}</span>
<span style="color: #009900;">                        ${app.descriptor}</span>
<span style="color: #009900;">                        -C ${app.bindir} ${app.rootfile} ${app.includes}</span>
<span style="color: #009900;">            &quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;iOS create IPA test&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;FDT create SWF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-package</span>
<span style="color: #009900;">                        -target ipa-test</span>
<span style="color: #009900;">                        -storetype ${build.storetype}</span>
<span style="color: #009900;">                        -keystore ${build.keystore}</span>
<span style="color: #009900;">                        -storepass ${build.storepass}</span>
<span style="color: #009900;">                        -provisioning-profile ${build.mobileprofile}</span>
<span style="color: #009900;">                        ${app.bindir}/${build.name}</span>
<span style="color: #009900;">                        ${app.descriptor}</span>
<span style="color: #009900;">                        -C ${app.bindir} ${app.rootfile} ${app.includes}</span>
<span style="color: #009900;">            &quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;iOS create IPA ad-hoc&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;FDT create SWF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-package</span>
<span style="color: #009900;">                        -target ipa-ad-hoc</span>
<span style="color: #009900;">                        -storetype ${build.storetype}</span>
<span style="color: #009900;">                        -keystore ${build.keystore}</span>
<span style="color: #009900;">                        -storepass ${build.storepass}</span>
<span style="color: #009900;">                        -provisioning-profile ${build.mobileprofile}</span>
<span style="color: #009900;">                        ${app.bindir}/${build.name}</span>
<span style="color: #009900;">                        ${app.descriptor}</span>
<span style="color: #009900;">                        -C ${app.bindir} ${app.rootfile} ${app.includes}</span>
<span style="color: #009900;">            &quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;iOS create IPA app-store&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;FDT create SWF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-package</span>
<span style="color: #009900;">                        -target ipa-app-store</span>
<span style="color: #009900;">                        -storetype ${build.storetype}</span>
<span style="color: #009900;">                        -keystore ${build.keystore}</span>
<span style="color: #009900;">                        -storepass ${build.storepass}</span>
<span style="color: #009900;">                        -provisioning-profile ${build.mobileprofile}</span>
<span style="color: #009900;">                        ${app.bindir}/${build.name}</span>
<span style="color: #009900;">                        ${app.descriptor}</span>
<span style="color: #009900;">                        -C ${app.bindir} ${app.rootfile} ${app.includes}</span>
<span style="color: #009900;">            &quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>If you&#8217;re not sure how to get started with all this AIR 2.6 stuff because it&#8217;s currently not integrated in the Flex SDKs &#8211; follow this steps:</p>
<ul>
<li><a href="http://get.adobe.com/air/">Get Adobe AIR runtime</a></li>
<li><a href="http://www.adobe.com/products/air/sdk/">Get Adobe AIR SDK</a></li>
<li><a href="http://opensource.adobe.com/wiki/display/flexsdk/Downloads">Get fresh Flex SDK of your choice</a></li>
<li><a href="http://kb2.adobe.com/cps/495/cpsid_49532.html">Overlay AIR SDK within the downloaded Flex SDK</a></li>
<li>Set compiler argument <code>-target-player=11</code> to access the new APIs (<a href="http://blogs.adobe.com/cantrell/archives/2011/03/everything-new-in-adobe-air-2-6.html">more</a>)</li>
</ul>
<p>Loads of linked informations:</p>
<p><a href="http://blogs.adobe.com/cantrell/archives/2011/03/how-to-use-air-2-6-with-flash-builder-4.html">http://blogs.adobe.com/cantrell/archives/2011/03/how-to-use-air-2-6-with-flash-builder-4.html</a><br />
<a href="http://www.mobilerevamp.org/2010/07/30/how-to-build-your-first-air4android-application-using-fdt-and-eclipse/">http://www.mobilerevamp.org/2010/07/30/how-to-build-your-first-air4android-application-using-fdt-and-eclipse/</a><br />
<a href="https://code.google.com/p/air-on-android-with-fdt/">https://code.google.com/p/air-on-android-with-fdt/</a><br />
<a href="http://www.beautifycode.com/flex-hero-mobile-project-template-for-fdt-4-2?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+beautifycode+%28Beautify+Code+-+Web+Development+%26+Actionscript+%28EN%29%29">http://www.beautifycode.com/flex-hero-mobile-project-template-for-fdt-4-2</a><br />
<a href="http://www.beautifycode.com/publish-package-an-air-file-with-fdt4">http://www.beautifycode.com/publish-package-an-air-file-with-fdt4</a><br />
<a href="http://labs.almerblank.com/2011/03/using-ant-to-compile-a-flex-mobile-project-for-ios/">http://labs.almerblank.com/2011/03/using-ant-to-compile-a-flex-mobile-project-for-ios/</a><br />
<a href="http://va.lent.in/blog/2011/03/25/air2-6-app-for-ios/">http://va.lent.in/blog/2011/03/25/air2-6-app-for-ios/</a> (Thanks for ANT files!)<br />
<a href="http://developerartofwar.com/2011/03/24/air-2-6-on-ipad-2-in-15-mins/">http://developerartofwar.com/2011/03/24/air-2-6-on-ipad-2-in-15-mins/</a><br />
<a href="http://karoshiethos.com/2010/04/06/use-fdt-folder-path-variables-in-ant/">http://karoshiethos.com/2010/04/06/use-fdt-folder-path-variables-in-ant/</a><br />
<a href="http://fdt.powerflasher.com/docs/FDT_Ant_Tasks#fdt.launch.application">http://fdt.powerflasher.com/docs/FDT_Ant_Tasks#fdt.launch.application</a><br />
<a href="http://labs.almerblank.com/2011/03/using-ant-to-compile-a-flex-mobile-project-for-ios/">http://labs.almerblank.com/2011/03/using-ant-to-compile-a-flex-mobile-project-for-ios/</a></p>
<p>Update:<br />
<a href="http://www.blackcj.com/blog/2011/04/04/ios-android-and-blackberry-in-a-single-click-with-ant/">http://www.blackcj.com/blog/2011/04/04/ios-android-and-blackberry-in-a-single-click-with-ant/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/04/04/ios-development-with-air-2-6-using-fdt-and-my-new-friend-ant/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SWF meta tag</title>
		<link>http://blog.derraab.com/2011/04/04/swf-meta-tag/</link>
		<comments>http://blog.derraab.com/2011/04/04/swf-meta-tag/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 15:00:39 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=549</guid>
		<description><![CDATA[I&#8217;m always searching for it so here is a useful blogpost. As the latest FDT version ( Beta 4 ) does not set compiler arguments concerning SWF-size, framerate etc. by default I started using SWF-Metatags to specify these settings. I&#8217;m &#8230; <a href="http://blog.derraab.com/2011/04/04/swf-meta-tag/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m always searching for it so <a href="http://www.beautifycode.com/swf-compile-meta-tags">here is a useful blogpost</a>.</p>
<blockquote><p>As the latest FDT version ( Beta 4 ) does not set compiler arguments concerning SWF-size, framerate etc. by default I started using SWF-Metatags to specify these settings.</p>
<p>I&#8217;m talking of these things:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;910&quot;</span>, <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;610&quot;</span>, <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span>, frameRate=<span style="color: #ff0000;">&quot;40&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></pre></div></div>

<p>Just set this tag above your class opening in the one you&#8217;re going to compile. Here is a complete list of (useful) arguments you can pass in:</p>
<p>width<br />
widthPercent<br />
height<br />
heightPercent<br />
scriptTimeLimit<br />
frameRate<br />
backgroundColor</p>
<p>So basically this is the fastest way to set up common compile-arguments to your project. By the way there is no Flex-Framework required &#8211; these tags also work in pure AS3 projects.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/04/04/swf-meta-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Date.time vs. Date.setTime() getTime() performance</title>
		<link>http://blog.derraab.com/2011/03/24/date-time-vs-date-settime-gettime-performance/</link>
		<comments>http://blog.derraab.com/2011/03/24/date-time-vs-date-settime-gettime-performance/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 14:14:17 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=540</guid>
		<description><![CDATA[Using Date.setTime() and Date.getTime() is faster than Date.time. My quick speed test to determine the fastest way to get and set time values on Date objects: var date : Date = new Date&#40;&#41;; var max : Number = date.time; &#160; &#8230; <a href="http://blog.derraab.com/2011/03/24/date-time-vs-date-settime-gettime-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using <code>Date.setTime()</code> and <code>Date.getTime()</code> is faster than <code>Date.time</code>.</p>
<p>My quick speed test to determine the fastest way to get and set time values on Date objects:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">date</span> : <span style="color: #0066CC;">Date</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">max</span> : <span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">time</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">start</span> : <span style="color: #0066CC;">int</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">end</span> : <span style="color: #0066CC;">int</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">time</span> : <span style="color: #0066CC;">Number</span>;
<span style="color: #000000; font-weight: bold;">var</span> times : Vector.<span style="color: #66cc66;">&lt;</span>Number<span style="color: #66cc66;">&gt;</span> = <span style="color: #000000; font-weight: bold;">new</span> Vector.<span style="color: #66cc66;">&lt;</span>Number<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> c : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">1000000</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i : <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> times.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">max</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">start</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">time</span> = times<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span>; <span style="color: #66cc66;">&#125;</span>;
<span style="color: #0066CC;">end</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;date.time = times[ i ];&quot;</span>, <span style="color: #0066CC;">end</span> - <span style="color: #0066CC;">start</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">start</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">setTime</span><span style="color: #66cc66;">&#40;</span> times<span style="color: #66cc66;">&#91;</span> i <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>;
<span style="color: #0066CC;">end</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;date.setTime( times[ i ] );&quot;</span>, <span style="color: #0066CC;">end</span> - <span style="color: #0066CC;">start</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">start</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">time</span> = <span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">time</span>; <span style="color: #66cc66;">&#125;</span>;
<span style="color: #0066CC;">end</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;time = date.time;&quot;</span>, <span style="color: #0066CC;">end</span> - <span style="color: #0066CC;">start</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">start</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> c; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0066CC;">time</span> = <span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">getTime</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>;
<span style="color: #0066CC;">end</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;time = date.getTime();&quot;</span>, <span style="color: #0066CC;">end</span> - <span style="color: #0066CC;">start</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// Result:</span>
<span style="color: #808080; font-style: italic;">//</span>
<span style="color: #808080; font-style: italic;">// date.time = times[ i ];        381</span>
<span style="color: #808080; font-style: italic;">// date.setTime( times[ i ] );    270</span>
<span style="color: #808080; font-style: italic;">// time = date.time;            184</span>
<span style="color: #808080; font-style: italic;">// time = date.getTime();        65</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2011/03/24/date-time-vs-date-settime-gettime-performance/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone / iPad ActionScript Guide quotes</title>
		<link>http://blog.derraab.com/2010/09/17/iphone-ipad-actionscript-guide-quotes/</link>
		<comments>http://blog.derraab.com/2010/09/17/iphone-ipad-actionscript-guide-quotes/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 22:04:48 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone / iPad]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=371</guid>
		<description><![CDATA[As I mentioned here I strongly recommend to read Adobe&#8217;s Building ADOBE® AIR® Applications with the Packager for iPhone® guide or Flash Platform for iPhone. Just some ActionScript facts: ActionScript APIs unsupported on mobile devices ActionScript APIs specific to mobile &#8230; <a href="http://blog.derraab.com/2010/09/17/iphone-ipad-actionscript-guide-quotes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As I mentioned <a href="http://blog.derraab.com/2010/09/17/iphone-ipad-development-guide-quotes">here</a> I strongly recommend to read Adobe&#8217;s <a href="http://download.macromedia.com/pub/labs/packagerforiphone/packagerforiphone_devguide.pdf">Building ADOBE® AIR® Applications with the Packager for iPhone®</a> guide or <a href="http://help.adobe.com/en_US/as3/iphone/index.html">Flash Platform for iPhone</a>.</p>
<p>Just some ActionScript facts:</p>
<p><a href="http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b24b55b57a124b32b5b57-7fff.html">ActionScript APIs unsupported on mobile devices</a><br />
<a href="http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b24b55b57a124b32b5b57-7ffe.html">ActionScript APIs specific to mobile AIR applications</a><br />
<a href="http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b24b55b57a124b32b5b57-7ffd.html">ActionScript APIs of special interest to mobile application developers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2010/09/17/iphone-ipad-actionscript-guide-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone / iPad Development Guide quotes</title>
		<link>http://blog.derraab.com/2010/09/17/iphone-ipad-development-guide-quotes/</link>
		<comments>http://blog.derraab.com/2010/09/17/iphone-ipad-development-guide-quotes/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 22:04:06 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone / iPad]]></category>
		<category><![CDATA[Mobile Devices]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=328</guid>
		<description><![CDATA[Since I&#8217;m diving deeper into Flash for iOS devices I strongly recommend to read Adobe&#8217;s Building ADOBE® AIR® Applications with the Packager for iPhone® guide or Flash Platform for iPhone. Beside the know how of subscribing as a Apple developer, &#8230; <a href="http://blog.derraab.com/2010/09/17/iphone-ipad-development-guide-quotes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m diving deeper into Flash for iOS devices I strongly recommend to read Adobe&#8217;s <a href="http://download.macromedia.com/pub/labs/packagerforiphone/packagerforiphone_devguide.pdf">Building ADOBE® AIR® Applications with the Packager for iPhone®</a> guide or <a href="http://help.adobe.com/en_US/as3/iphone/index.html">Flash Platform for iPhone</a>.</p>
<p>Beside the know how of subscribing as a Apple developer, obtaining certificates and so on I think this informations are quite valuable but easy to forget:</p>
<p><strong>iPhone icon and initial screen images</strong></p>
<p>The iPhone adds a glare effect to the icon&#8230; To remove this default glare effect, add the UIPrerenderedIcon key to the InfoAdditions element in the application descriptor file&#8230;</p>
<p>All iPhone applications display an initial image while the application loads on the iPhone. You define the initial image in a PNG file named Default.png stored in the main development directory&#8230; The Default.png file is 320 pixels wide by 480 pixels tall, regardless of the initial orientation of the application or whether it is full-screen or not.</p>
<p>The iPhone displays its status bar over the 20 pixel-wide rectangle at the top or left of the default image.</p>
<p>For iPad support, you can define images for each supported initial orientation (Default-Portrait, Default-PortraitUpsideDown, Default-PortraitLandscapeLeft, Default-PortraitLandscapeRight.png)&#8230; Initial screen images for the iPad are 768 pixels wide and 1024 pixels high.</p>
<p><strong>iPhone application settings</strong></p>
<p>There must be way more settings than this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;iPhone<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;InfoAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">&lt;key&gt;UIStatusBarStyle&lt;/key&gt;</span>
<span style="color: #339933;">&lt;string&gt;UIStatusBarStyleBlackOpaque&lt;/string&gt;</span>
<span style="color: #339933;">&lt;key&gt;UIRequiresPersistentWiFi&lt;/key&gt;</span>
<span style="color: #339933;">&lt;string&gt;NO&lt;/string&gt;</span>
<span style="color: #339933;">]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/InfoAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/iPhone<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><strong>Debugging an iPhone application</strong></p>
<p>Debugging the iPhone App over Wi-Fi is possible and GPU rendering diagnostics can be activated at compile time.</p>
<p>Continue reading about more specific ActionScript notes <a href="http://blog.derraab.com/2010/09/17/iphone-ipad-actionscript-guide-quotes">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2010/09/17/iphone-ipad-development-guide-quotes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPad says hello to Flash community</title>
		<link>http://blog.derraab.com/2010/09/16/ipad-says-hello-to-flash-community/</link>
		<comments>http://blog.derraab.com/2010/09/16/ipad-says-hello-to-flash-community/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 08:30:48 +0000</pubDate>
		<dc:creator>derRaab</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone / iPad]]></category>
		<category><![CDATA[Mobile Devices]]></category>

		<guid isPermaLink="false">http://blog.derraab.com/?p=319</guid>
		<description><![CDATA[Hello iPad. Maybe Apple denied compiling Apps with Flash because they just had problems delivering enough iPads to the Flash community? Since customer requests grow and a new version of iPad seems to appear on the horizon I decided to &#8230; <a href="http://blog.derraab.com/2010/09/16/ipad-says-hello-to-flash-community/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello iPad. Maybe Apple denied compiling Apps with Flash because they just had problems delivering enough iPads to the Flash community? <img src='http://blog.derraab.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Since customer requests grow and a new version of iPad seems to appear on the horizon I decided to get one of the 1. gen. iPads for testing purposes. I&#8217;m looking forward developing parallel solutions for the web and the iPad / iPhone and I see myself fighting against system limitations like the old days where we had to test our Flash 4 projects on PCs much slower than current mobile devices.</p>
<p>Ride it baby!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.derraab.com/2010/09/16/ipad-says-hello-to-flash-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

