<?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>kohactive &#187; Flash</title>
	<atom:link href="http://www.kohactive.com/html/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kohactive.com/html</link>
	<description>kohactive  interactive design and marketing</description>
	<lastBuildDate>Mon, 23 Aug 2010 21:26:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AS3 MailChimp Library</title>
		<link>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/</link>
		<comments>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:32:23 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MailChimp]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=123</guid>
		<description><![CDATA[One of our latest projects required MailChimp integration through Flash AS3, while we couldn't find anything that worked properly, we found a nice and easy way to build our own class.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp.jpg"><img class="alignnone size-full wp-image-124" title="mailchimp" src="http://www.kohactive.com/html/wp-content/uploads/mailchimp.jpg" alt="" width="535" height="235" /></a></p>
<p>While building our awesome new website, we wanted to ensure that users could easily subscribe to our newsletter through the Flash version, without having to be redirected anywhere else. Convenience is king, and we wanted to deliver it!</p>
<p>We use <a href="http://www.mailchimp.com/">MailChimp</a>, the best email marketing platform available! And luckily, they have a great API to work with. Through Flash, we were able to add subscribers to our list and also return any results, i.e. error or success.</p>
<p>While searching Google I found an article by <a href="http://christiancox.com/?p=29">Christian Cox </a>on MailChimp’s API and AS2, but that wasn’t enough.  We needed a nice AS3 version of the code. So Justin and I put together this nice, simple code that should work for anyone. If I had more time I would definitely make a class.. Perhaps later this month.</p>
<pre><code lang="as3">
//api and list id keys
var _api:String = "MAIL_CHIMP_API_KEY_HERE";
var _listID:String = "LIST_ID_HERE";

//text box handler
emailAddress.text = "email address";
emailAddress.tabIndex = 1;
emailAddress.addEventListener(FocusEvent.FOCUS_IN, txtFocusIn);
emailAddress.addEventListener(FocusEvent.FOCUS_OUT, txtFocusOut);

function txtFocusIn(e:FocusEvent) {
        emailAddress.text = "";
}
function txtFocusOut(e:FocusEvent) {
        if (emailAddress.text == "") {
                emailAddress.text = "email address";
        }
}

//button setup
submitBtn.buttonMode = true;
submitBtn.addEventListener(MouseEvent.CLICK, submitForm);

function submitForm(e:Event) {

        var email:String = emailAddress.text;

        //check if valid
        if (isValidEmail(email)) {

                //set response text
                responseText.text = "sending...";

                //disable the submit button
                submitBtn.removeEventListener(MouseEvent.CLICK, submitForm);

                //setup POST
                var variables:URLVariables = new URLVariables("method=listSubscribe&amp;amp;output=xml&amp;amp;apikey=" + _api + "&amp;amp;id=" + _listID + "&amp;amp;email_address=" + email + "&amp;amp;merge_vars=");
                var request:URLRequest = new URLRequest();
                request.url = "http://api.mailchimp.com/1.2/?method=listSubscribe";
                request.method = URLRequestMethod.POST;
                request.data = variables;

                var loader:URLLoader = new URLLoader();
                loader.dataFormat = URLLoaderDataFormat.VARIABLES;
                loader.addEventListener(Event.COMPLETE, completeHandler);

                try {
                        trace("loading...");
                        responseText.text = "loading...";
                        loader.load(request);
                }
                catch(error:Error) {
                        trace("unable to load URL");
                        responseText.text = "Oh, that's embarassing. something went wrong, please try again. Thanks!";
                        trace(e.target.data);
                }
                function completeHandler(e:Event) {
                        var _t:String = unescape(e.target.data); //decode the uri

                        var _xml:XMLList = new XMLList(_t); //parse the xml
                        trace(_xml.@type);
                        if (_xml.@type == "array") { //check to see if there is an error
                                trace(_xml.error);
                                responseText.text = _xml.error;
                                resetForm();
                        } else if (_xml.@type == "boolean") { //check to see if successfully added
                                trace("successfully added to list");
                                responseText.text = "You have beeen successfully added to our list. Thank you!";
                                resetForm();
                        }
                }

        } else {
                trace ("email invalid");
        resetForm ();
                responseText.text = "invalid email!";
        }

}

//validate given email
function isValidEmail(_e:String):Boolean {
        var exp:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
    return exp.test(_e);
}

//reset the form elements
function resetForm(){
        submitBtn.addEventListener(MouseEvent.CLICK, submitForm);
        emailAddress.text = "email address";

}
</code>
</pre>
<p>Done and done. Pretty easy, right? You can also download the <a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp_api.zip">mailchimp_api</a>.</p>
<p><span class="post_update">UPDATE: A new version has been created that includes First and Last Name data collection [<a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp_api_1.3.zip">mailchimp_api_1.3</a>].</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Why Apple Hates Flash</title>
		<link>http://www.kohactive.com/html/think/why-apple-hates-flash/</link>
		<comments>http://www.kohactive.com/html/think/why-apple-hates-flash/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:16:10 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Think]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=37</guid>
		<description><![CDATA[The launch of the iPad had the entire tech world on it's feet but the absence of Flash support has many people wondering why the hell Apple hates Flash.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/ipad.jpg"><img class="alignnone size-full wp-image-40" title="ipad" src="http://www.kohactive.com/html/wp-content/uploads/ipad.jpg" alt="" width="535" height="235" /></a></p>
<p>When the iPhone first launched without Flash enabled browsers it was not a big deal at all. How can you expect that little device to handle some of the interactive flash sites you see nowadays. Even with the release of iPhone OS 3.x.x it&#8217;s not that big of a deal. Most people use their iPhone for web, mail and those awesome apps. But when the iPad came out without a flash enabled browser it seemed like this Apple vs. Flash battled ragged on. Here is my perspective on the issues.</p>
<p>First off, the iPhone&#8217;s memory and cache just can&#8217;t handle some flash which is alright, especially considering that the iPhone is not a primary web surfing device. The iPad, on the other hand, is exactly that: it&#8217;s &#8220;the best way to experience the web, email, photos and video. Hands down&#8221;. That&#8217;s a pretty bold statement to begin with, but what makes it more interesting is this device doesn&#8217;t support Flash. How are you suppose to experience the web without flash? No Hulu, no Pandora, no interactive websites, and consequently, almost half the web is inaccessible.</p>
<p>Over the past year or so, we&#8217;ve been playing around with the idea of developing web based iPhone apps, primarily in Flash. We figured that Apple would eventually support Flash, considering the technological advances made in the iPhone. When the iPad came out without Flash and Steve Jobs openly admitted that Adobe is &#8220;lazy&#8221;, we realized this Apple was not going to support Flash for a while (if ever). Consequently, our dreams were shattered.</p>
<p>How does web based Flash applications effect the iPhone? It&#8217;s simple, if we could develop iPhone apps in Flash, that were accessible via Mobile Safari, then anyone could make an iPhone app, regardless of Apple&#8217;s App Store approval. Furthermore, these apps would be free, which means Apple makes no money. Developers and companies could probably profit off of advertising, but regardless, Apple makes no money.</p>
<p>To a company like Apple, and any other corporation, money is the bottom line. They need to monetize on their products. With an app store that makes no money, there is no reason to continue support. Apple makes most of their money off of the App store, and that is why they push the iPhone so aggressively. Without an App Store there would be no reason to support the device or the operating system, unless of course, you want the iPhone to go up to regular Apple product prices. Nobody wants that.</p>
<p>Apple has never been a fan of allowing third parties to develop with their software. The App store was one of the biggest moves they&#8217;ve mad in decades and they did it for profit. The iPad follows in the footsteps of the iPhone, with access to the App store and tons of paid resources. Enabling Flash on either device opens up the OS to thousands of new web applications.</p>
<p>The next year or so we really show us how this battle is going to end. Perhaps Google can save Flash. That&#8217;s a discussion soon to come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/think/why-apple-hates-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
