<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>curiousminds</title>
	<atom:link href="http://curiousmindsmedia.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://curiousmindsmedia.wordpress.com</link>
	<description>Like nailing Jell-o to a tree!</description>
	<lastBuildDate>Thu, 17 Dec 2009 19:47:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='curiousmindsmedia.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9178910a5b3033927bf3457377d130c8?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>curiousminds</title>
		<link>http://curiousmindsmedia.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://curiousmindsmedia.wordpress.com/osd.xml" title="curiousminds" />
		<item>
		<title>Creating an augmented reality site using Papervision 3d and FLARtoolkit. Part 2: Listening for Events and Animating the Scene</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/12/17/creating-an-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-2-listening-for-events-and-animating-the-scene/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/12/17/creating-an-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-2-listening-for-events-and-animating-the-scene/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 19:45:06 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[FLARtoolkit]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[PV3D]]></category>
		<category><![CDATA[paperVision3d]]></category>
		<category><![CDATA[theater]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=540</guid>
		<description><![CDATA[Welcome back for part 2. In the first tutorial I went over how to set up your project, create a PV3D object to attach, and call the functions that will attach this object to your marker (if you haven&#8217;t read part 1 yet, check it out below). In part 2, I will go over how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=540&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome back for part 2. In the first tutorial I went over how to set up your project, create a PV3D object to attach, and call the functions that will attach this object to your marker (if you haven&#8217;t read part 1 yet, check it out below). In part 2, I will go over how to listen for when the marker is detected (and undetected). We will also look at how the animation is triggered and stopped.</p>
<p><span id="more-540"></span></p>
<p>Now that we have the basic setup, the next step is to animate our PV3D scene. For almost all Flash animations, I use <a title="TweenLite" href="http://blog.greensock.com/tweenlite/" target="_blank">TweenLite</a> or <a title="TweenMax" href="http://blog.greensock.com/tweenmax/" target="_blank">TweenMax</a>, they are really great tweening engines with a lot of features. The best part? They are free. Back in MainDisplay.as, I set up public functions that would animate the various objects I had set up earlier. Working from our previous example variable of &#8220;_introFlash1&#8243;, here is the initial animation function that gets called (obviously this is just the start of the animation for example purposes. Yours can be as complex as you want):</p>
<blockquote><p>public function startAni():void {<br />
TweenLite.to(_introFlash1, .5, {alpha:1, onComplete:nextAni});<br />
TweenLite.to(_introFlash1, .5, {scale:1, overwrite:0});<br />
}</p></blockquote>
<p>Just a simple scale in and alpha in, from the starting values we set previously. Another nice thing about this tween class is that it is easy to call an &#8220;onComplete&#8221; function when the animation finishes. In this way you can trigger sequential animations easily. Fun stuff. At this point you can also write your function to stop the animation. It basically reverses the stopping animation by tweening back to the original values:</p>
<blockquote><p>public function stopAni():void {<br />
TweenLite.to(_introFlash1, .5, {alpha:0, onComplete:aniDone});<br />
TweenLite.to(_introFlash1, .5, {scale:.01, overwrite:0});<br />
}</p></blockquote>
<p>Ok, now that those functions are ready, we want to set up our listeners that check to see if our marker is detected. If it is, then we attach our PV3D object and animate it. When I first set about doing this, I had it set up so that the animation would play while the marker continued to be detected. However, this sometimes caused the animation to not play smoothly. What I ended up doing was making it so that once the marker was detected and the object attached, the detection would stop and the animation would play through. Once the animation was done, the marker detection would start up again. Another issue with the marker detection was that it tends to be very sensitive. Although you can adjust this sensitivity somewhat, I still found it to be too twitchy &#8211; the instant the marker was undetected it would fire an undetection event, even thought he marker was still clearly still there. To remedy this, I set a timer that gets triggered by the undetection event. This way there would be some needed wiggle room to give the user a more consistent experience. Let&#8217;s take a look at how these listeners and timers come into play. But first, let&#8217;s set up our custom events. In most AS projects, you will find it helpful to create custom events and this one is no different. So create a new Actionscript file (I named mine &#8220;FlarEvents&#8221;) and declare your new events:</p>
<blockquote><p>public class FlarEvents extends Event {<br />
public static const SCENE_ANIMATED_IN:String = &#8220;scene_animated_in&#8221;; //fired when scene has finished animating in<br />
public static const SCENE_ANIMATED_OUT:String = &#8220;scene_animated_out&#8221;; //fired when scene has finished animating out<br />
public static const FLAR_DETECTED:String = &#8220;flar_detected&#8221;; //fired when the marker is detected<br />
public static const FLAR_UNDETECTED:String = &#8220;flar_undetected&#8221;; //fired when the marker is undetected<br />
public function FlarEvents(type:String,bubbles:Boolean=false,cancelable:Boolean=false) {<br />
super(type,bubbles,cancelable);<br />
}<br />
}</p></blockquote>
<p>Back in &#8220;FlarSpace.as&#8221;, we first declare some variables:</p>
<blockquote><p>private var _played:Boolean = false; //tells if the animation has played<br />
private var _detected:Boolean = false; //tells if the marker has been detected<br />
private var _undetectTimer:Timer = new Timer(0, 8); //sets a timer for when the marker is undetected</p></blockquote>
<p>Now to set up some listeners:</p>
<blockquote><p>this.addEventListener(Event.ENTER_FRAME, mainEventListener);</p></blockquote>
<p>This listener is our main listener that renders the PV3D scene and constantly checks to see if the marker is detected. Let&#8217;s check it out.</p>
<blockquote><p>private function mainEventListener(e:Event):void {<br />
_capture.draw(_myVideo); //constantly redraws the video feed from our webcam<br />
try {<br />
//the _detector.getConfidence() comparison value (0.6 in my file) is the threshold the FLARtoolkit uses to detect<br />
//the marker via the webcam. Try adjusting this value to make it more or less sensitive.<br />
if (_detector.detectMarkerLite(_raster,128)&amp;&amp;_detector.getConfidence()&gt;0.6) {<br />
_detector.getTransformMatrix(_trans); //get the 3d position our marker<br />
_mainContainer.setTransformMatrix(_trans); //set our PV3D object to the position of our marker<br />
_renderer.renderScene(_scene3D, _cam3D, _viewPort); //render our PV3D scene<br />
this.dispatchEvent(new Event(Events.FLAR_DETECTED)); //dispatch the FLAR_DETECTED event into the event flow<br />
_detected=true; //marker has been detected, set _detected to true<br />
}<br />
//this checks if the detection falls below a certain threshold, I had good luck with 0.3.<br />
//It also check to verify that the animation has played.<br />
if (_detector.detectMarkerLite(_raster,128)&amp;&amp;_detector.getConfidence()&lt;0.3&amp;&amp;_played==true) {<br />
_detected = false; //we have lost the marker, set _detected to false<br />
_undetectTimer.start(); //start the undetection timer<br />
}<br />
} catch (e:Error) {<br />
}<br />
}</p></blockquote>
<p>The second two listeners listen for two of the custom Events that I created.</p>
<blockquote><p>this.addEventListener(Events.FLAR_DETECTED, flarDetected);<br />
this.addEventListener(Events.FLAR_UNDETECTED, flarUndetected);</p></blockquote>
<p>Let&#8217;s take a look at the functions that are triggered by these events:</p>
<blockquote><p>private function flarDetected(evt:Event):void{<br />
this.removeEventListener(Events.FLAR_DETECTED, flarDetected); //remove the FLAR_DETECTED calling event listener<br />
this.removeEventListener(Event.ENTER_FRAME, mainEventListener); //remove the main event listener<br />
this.addEventListener(Event.ENTER_FRAME, aniEventListener); //add a new event listener to listen for the starting animation to finish.<br />
_main.startAni1(); //call our public function to start the animation back in our MainDisplay class*.<br />
//*Remember, _main is our instantiation of this class that we added to our _mainContainer FLARBaseNode object in part 1.<br />
}<br />
private function flarUndetected(evt:Event):void{<br />
this.removeEventListener(Events.FLAR_UNDETECTED, flarUndetected); //remove the FLAR_UNDETECTED calling event listener<br />
this.removeEventListener(Event.ENTER_FRAME, mainEventListener); //remove the main event listener<br />
this.addEventListener(Event.ENTER_FRAME, aniEventListener); //add a new event listener to listen for the ending animation to finish.<br />
_main.stopAni1(); //call our public function to stop the animation back in our MainDisplay class.<br />
}</p></blockquote>
<p>What we are doing is removing the main event listener and setting up an alternate animation event listener. Here is what that looks like:</p>
<blockquote><p>private function aniEventListener(e:Event):void{<br />
_renderer.renderScene(_scene3D, _cam3D, _viewPort); //continue to render our PV3D scene<br />
_mainContainer.setTransformMatrix(_trans); //set our PV3D to the last position of our marker<br />
}</p></blockquote>
<p>We are still triggering two of the behaviors in the main event listener: to make sure our PV3D object continues to be rendered, and place it at the last marker position. What&#8217;s missing is the constant marker detection, which tends to slow the animation down as mentioned above.</p>
<p>Now let&#8217;s take a look at the undetection logic. First, add a listener to the timer that is triggered when the timer ends:</p>
<blockquote><p>_undetectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, undetectTimerDone);</p></blockquote>
<p>Then simply start the timer when the undetection event occurs (this is in our main event listener).</p>
<blockquote><p>_undetectTimer.start();</p></blockquote>
<p>And finally, the resulting function:</p>
<blockquote><p>private function undetectTimerDone(evt:TimerEvent):void{<br />
_undetectTimer.stop(); //stop the timer<br />
_undetectTimer.reset(); //reset it for later use<br />
this.dispatchEvent(new Event(Events.FLAR_UNDETECTED)); //dispatch the FLAR_UNDETECTED event into the event flow<br />
}</p></blockquote>
<p>By providing a delay in firing this event, we can ensure that it isn&#8217;t fired too quickly.</p>
<p>Ok, almost done. As of now we have the animation event listener taking care of the rendering and we are playing our animation. When the animation finishes, we want to turn the main event listener back on so that our object can once again be attached to the position of our marker. A couple of new event listeners should do the trick:</p>
<blockquote><p>_main.addEventListener(Events.SCENE_ANIMATED_IN, aniIn); //listen for our custom event that is triggered when the initial animation finishes<br />
_main.addEventListener(Events.SCENE_ANIMATED_OUT, aniOut); //listen for our custom event that is triggered when the ending animation finishes</p></blockquote>
<p>And the corresponding functions:</p>
<blockquote><p>private function aniIn(event:Event):void{<br />
_played=true; //set out played variable to true<br />
this.addEventListener(Event.ENTER_FRAME, mainEventListener); //start our main event listener back up again<br />
this.removeEventListener(Event.ENTER_FRAME, aniEventListener); //remove our animation event listener<br />
this.addEventListener(Events.FLAR_UNDETECTED, flarUndetected); //re-start the FLAR_UNDETECTED event listener<br />
}<br />
private function aniOut(event:Event):void{<br />
_played=false; //set our played variable to false<br />
this.addEventListener(Event.ENTER_FRAME, mainEventListener); //start our main event listener back up again<br />
this.removeEventListener(Event.ENTER_FRAME, aniEventListener); //remove our animation event listener<br />
this.addEventListener(Events.FLAR_DETECTED, flarDetected); //re-start the FLAR_DETECTED event listener<br />
}</p></blockquote>
<p>These functions should be pretty self-expalnatory, and are called from our MainDisplay class, like so:</p>
<blockquote><p>this.dispatchEvent(new Event(Events.SCENE_ANIMATED_IN)); //intro animation is done, dispatch the SCENE_ANIMATED_IN event into the event flow<br />
this.dispatchEvent(new Event(Events.SCENE_ANIMATED_OUT)); //ending animation is done, dispatch the SCENE_ANIMATED_OUT event into the event flow</p></blockquote>
<p>By structuring your project like this, you can keep all of your PV3D objects and animations in one file and all of your FLAR detection and listeners in another. They are simply linked together via event listeners. I hope this helps you with your next project. Happy coding!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/540/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=540&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/12/17/creating-an-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-2-listening-for-events-and-animating-the-scene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating an Augmented Reality App using Papervision3D and FLARtoolkit. Part 1: Setting Up</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/12/04/creating-a-jersey-boys-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-1-setting-up/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/12/04/creating-a-jersey-boys-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-1-setting-up/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 19:05:02 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[FLARtoolkit]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[PV3D]]></category>
		<category><![CDATA[paperVision3d]]></category>
		<category><![CDATA[theater]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=522</guid>
		<description><![CDATA[This project began when we found out that our client was going to be printing some paper fans to give away at Jersey Boys shows throughout the country. They were looking for something interesting to put on the fans, a link to a new site that fans would visit. We came up with the idea [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=522&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div id="attachment_523" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.jerseyboysinfo.com/3D/"><img class="size-full wp-image-523 " title="JB3D" src="http://curiousmindsmedia.files.wordpress.com/2009/12/jb3d.jpg?w=480&#038;h=300" alt="Jersey Boys 3D" width="480" height="300" /></a><p class="wp-caption-text">Jersey Boys 3D</p></div>
<p>This project began when we found out that our client was going to be printing some paper fans to give away at <em>Jersey Boys</em> shows throughout the country. They were looking for something interesting to put on the fans, a link to a new site that fans would visit. We came up with the idea of printing a marker on the fans that could then be used at a specific website in order to produce a 3d, augmented reality image via the user&#8217;s webcam. We got the go-ahead on the project and the fans were sent for printing. The timeline was set and work began.<br />
<a title="Jersey Boys 3D" href="http://www.jerseyboysinfo.com/3D/" target="_blank">Click here</a> to view the final project online and try it out for yourself. Read on to learn about our design process and setting up the project in AS3.</p>
<p><span id="more-522"></span>Before doing any coding or asset creation on the project, we started with storyboards in order to come up with ideas of what we wanted to happen when the viewer held up the fan to their webcams. We ended up doing two versions and then combining ideas from both into one. Here is the final storyboard we used, along with description text and arrows to indicate movement (yes, we went old school and hand-drew the graphics):</p>
<p style="text-align:left;">
<div id="attachment_526" class="wp-caption aligncenter" style="width: 358px"><a href="http://www.jerseyboysinfo.com/3D/"><img class="size-full wp-image-526 " title="storyboard" src="http://curiousmindsmedia.files.wordpress.com/2009/12/storyboard.jpg?w=348&#038;h=300" alt="Storyboard for Jersey Boys 3d project" width="348" height="300" /></a><p class="wp-caption-text">Storyboard for Jersey Boys 3d project</p></div>
<p style="text-align:left;">After walking the client through our storyboard, we got the ok to build it out. Now the real work began. We started by looking into the technologies that we would be using in the project. We had done some work with Papervision (http://blog.papervision3d.org/) in the past so we were familiar with how it worked. We made sure we had the latest version of Papervision 3d (via SVN <a title="PV3D SVN" href="http://papervision3d.googlecode.com/svn/trunk/as3/trunk/" target="_blank">here</a>) and set up our file structure for the project. Next we downloaded the FLARtoolkit files, available <a title="FLARtoolkit" href="http://www.libspark.org/svn/as3/FLARToolKit/trunk" target="_blank">here</a>, the technology we would use to attach our 3d Flash movie onto the marker on the fan in 3d space. After downloading and placing these files into our project, we got to work.</p>
<p>We start by creating an Actionscript file that would handle the attachment of the 3d object to the marker. So fire up Flash or Flex and start a new Actionscript file (I am naming mine &#8220;MainFlar.as&#8221;). First things first, the imports.<br />
To start, import all of the flash classes we will need (be sure and change the paths to match the class structure of your project):</p>
<blockquote>
<p style="text-align:left;">import flash.display.BitmapData;<br />
import flash.display.Sprite;<br />
import flash.events.Event;<br />
import flash.media.Camera;<br />
import flash.media.Video;<br />
import flash.utils.ByteArray;<br />
import flash.display.StageQuality;<br />
import flash.filters.ColorMatrixFilter;<br />
import flash.utils.Timer;<br />
import flash.events.TimerEvent;</p>
</blockquote>
<p style="text-align:left;">Next, all of the Papervision 3D classses:</p>
<blockquote>
<p style="text-align:left;">import org.papervision3d.lights.PointLight3D;<br />
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;<br />
import org.papervision3d.materials.utils.MaterialsList;<br />
import org.papervision3d.objects.primitives.Cube;<br />
import org.papervision3d.render.BasicRenderEngine;<br />
import org.papervision3d.render.LazyRenderEngine;<br />
import org.papervision3d.scenes.Scene3D;<br />
import org.papervision3d.view.Viewport3D;<br />
import org.papervision3d.objects.DisplayObject3D;<br />
import org.papervision3d.events.RendererEvent;</p>
</blockquote>
<p style="text-align:left;">And finally, all of the FLARtoolkit classes:</p>
<blockquote>
<p style="text-align:left;">import org.libspark.flartoolkit.core.FLARCode;<br />
import org.libspark.flartoolkit.core.param.FLARParam;<br />
import org.libspark.flartoolkit.core.raster.rgb.FLARRgbRaster_BitmapData;<br />
import org.libspark.flartoolkit.core.transmat.FLARTransMatResult;<br />
import org.libspark.flartoolkit.detector.FLARSingleMarkerDetector;<br />
import org.libspark.flartoolkit.pv3d.FLARBaseNode;<br />
import org.libspark.flartoolkit.pv3d.FLARCamera3D;</p>
</blockquote>
<p style="text-align:left;">Ok, now we need to create 2 files in order for the code to have something to detect: 1) the pattern file. This is a .pat file that is basically a representation of the marker you are using. They are online services that will generate this file for you when you upload your marker file, <a href="http://flash.tarotaro.org/blog/2009/07/12/mgo2/" target="_blank">here</a> is one. There is also an air app to do this, available <a href="http://saqoosha.net/lab/FLARToolKit/MarkerGenerator/MakerGenerator.air" target="_blank">here</a>. 2) The &#8220;camera_para.dat&#8221; file. This is a binary file that is used to calibrate your webcam. For this you should be fine just using the one that comes bundled with the fLARtooolkit.</p>
<p style="text-align:left;">Back in our MainFlar.as file, we now need to embed these 2 files for use in the project, and create classes for them (don&#8217;t forget to change the paths to match those of your project):</p>
<blockquote>
<p style="text-align:left;">[Embed(source="../assets/pattern/marker.pat",mimeType="application/octet-stream")]<br />
private var _MarkerPattern:Class;</p>
<p>[Embed(source="../assets/camera_para.dat",mimeType="application/octet-stream")]<br />
private var _CameraParameters:Class;</p></blockquote>
<p style="text-align:left;">Ok, now to set up your variables (these will be explained below):</p>
<blockquote>
<p style="text-align:left;">//vars for the camera to capture the video stream<br />
private var _myCamera:Camera;<br />
private var _myVideo:Video;<br />
private var _capture:BitmapData;</p>
<p>//FLAR vars that will detect and attach our marker<br />
private var _cameraParams:FLARParam;<br />
private var _markerPattern:FLARCode;<br />
private var _raster:FLARRgbRaster_BitmapData;<br />
private var _detector:FLARSingleMarkerDetector;<br />
private var _cam3D:FLARCamera3D;</p>
<p>//PV3D vars<br />
private var _scene3D:Scene3D;<br />
private var _viewPort:Viewport3D;<br />
private var _mainContainer:FLARBaseNode;<br />
private var _renderer:LazyRenderEngine;<br />
private var _trans:FLARTransMatResult;</p>
<p>//our PV3D Display Object that contains all of our 3d objects<br />
private var _main:MainDisplay=new MainDisplay();</p></blockquote>
<p>Ok, now that that is set up, we need to create a Papervison 3D object that we can use to attach to the marker.<br />
I used a MainDisplay class (see above) that extends the DisplayObject3D PV3D class. That way I could add various elements to my display and have one central class to keep everything in. I separated each element I would need into a separate class that I would then add to the MainDisplay class. For example, I created  a Flashbulb class that creates a spotlight at a specific size. I added a public function that would then return this object to my MainDisplay class. Here is the code for the Flashbulb class:</p>
<blockquote><p>public class Flashbulb{<br />
private var _flashbulb:Sphere;<br />
private var _colorMaterial:ColorMaterial;<br />
private var _glow:GlowFilter;</p>
<p>//Initialization<br />
public function Flashbulb() {<br />
super();<br />
_colorMaterial=new ColorMaterial(0xFFFF00);<br />
_glow = new GlowFilter(0xFFFFFF, 1, 10, 10, 4, 3);<br />
_flashbulb=new Sphere(_colorMaterial,10, 10,20);<br />
_flashbulb.useOwnContainer = true;<br />
_flashbulb.filters = [_glow ];</p>
<p>}<br />
//function to return this object to my MainDisplay class<br />
public function getBulb() {<br />
return _flashbulb;<br />
}</p>
<p>}</p></blockquote>
<p>Back in MainDisplay.as, I declared the variable for the new Flashbulb object and called the function that would return this object:</p>
<blockquote><p>private var _Flash1:Flashbulb = new Flashbulb();<br />
private var _introFlash1:Sphere=_Flash1.getBulb();</p></blockquote>
<p>Then I added the _introFlash1 object to my MainDisplay.as file, placed them in their proper position and set their initial properties (which would be animated later):</p>
<blockquote><p>this.addChild(_introFlash1);<br />
_introFlash1.x=100;<br />
_introFlash1.z=200;<br />
_introFlash1.y=100;<br />
_introFlash1.scale=.01;<br />
_introFlash1.alpha=0;</p></blockquote>
<p>Another advantage of using this method was that it allowed me to create multiple instances of the Flashbulb object for use in MainDisplay.</p>
<p>Back in FlarSpace.as, I was ready to setup my camera, initialize the FLAR settings and add the MainDisplay to my marker.<br />
First I called a findCam function that looked for the user&#8217;s USB class video camera (the preferred camera for accessing the viewer&#8217;s webcam). If it wasn&#8217;t found, it would get whatever camera the user has installed and attempt to use that.</p>
<blockquote><p>private function findCam():void{<br />
for (var i:int = 0;i&lt;Camera.names.length;i++) {<br />
if (Camera.names[ i ] == &#8220;USB Video Class Video&#8221;) {<br />
_camIndex = i;<br />
_myCamera=Camera.getCamera(String(_camIndex));<br />
} else {<br />
_myCamera=Camera.getCamera();<br />
}<br />
if (i== (Camera.names.length-1)){<br />
setupCamera();<br />
}<br />
}</p>
<p>}</p></blockquote>
<p>Once a camera was found, I called the setupCamera function. This function sets up the camera and attaches it to my video object:</p>
<blockquote><p>private function setupCamera():void {<br />
//these dimensions shoudl match those of your main swf<br />
_myVideo=new Video(640,480);<br />
//look for camera object, if one is not found, display warning<br />
if (_myCamera==null) {<br />
addChild(_warning);<br />
trace(&#8220;no camera&#8221;);<br />
}<br />
//this sets the resolution and framerate of the camera<br />
_myCamera.setMode(320, 240, 15);<br />
//attach the camera to your Video object and add it to the stage<br />
_myVideo.attachCamera(_myCamera);<br />
this.addChild(_myVideo);<br />
}</p></blockquote>
<p>Next, I initialized the FLAR settings in the following functions.<br />
The first function sets it up to use the marker pattern that I had embedded earlier:</p>
<blockquote><p>private function setupFLAR():void {<br />
_cameraParams = new FLARParam();<br />
_cameraParams.loadARParam(new _CameraParameters() as ByteArray);<br />
_markerPattern=new FLARCode(16,16);<br />
_markerPattern.loadARPatt(new _MarkerPattern());<br />
_trans = new FLARTransMatResult();<br />
}</p></blockquote>
<p>The next function sets up the bitmap data that would allow the camera to detect the marker:</p>
<blockquote><p>private function setupBitmap():void {<br />
_capture=new BitmapData(640,480);<br />
_capture.draw(_myVideo);<br />
_raster=new FLARRgbRaster_BitmapData(_capture);<br />
_detector=new FLARSingleMarkerDetector(_cameraParams,_markerPattern,80);<br />
}</p></blockquote>
<p>Once I had my camera and marker all set up, it was time to set up my PV3D scene and bring in my PV3D Display Object (the &#8220;_main&#8221; var  above that was typed to the MainDisplay class I created earlier):</p>
<blockquote><p>private function setupPV3D():void {<br />
//initialize PV3D vars<br />
_scene3D = new Scene3D();<br />
_cam3D=new FLARCamera3D(_cameraParams);<br />
//initialize the FLARBaseNode container<br />
_mainContainer = new FLARBaseNode();<br />
//attach the FLARBaseNode that will attach to the marker to our PV3D scene<br />
_scene3D.addChild(_mainContainer);<br />
//initialize the PV3D Renderer<br />
_renderer=new LazyRenderEngine(_scene3D,_cam3D,_viewPort);<br />
//initialize the PV3D Viewport and add it to the stage<br />
_viewPort = new Viewport3D(640,480);<br />
this.addChild(_viewPort);<br />
//this is where we attach our _main (MainDisplay object) to the FLARBaseNode<br />
_mainContainer.addChild(_main);<br />
}</p></blockquote>
<p>That&#8217;s it for Part 1. In Part 2, we will set up the listeners that listen for when the marker is detected (and undetected). We will also get into how the animation is triggered and stopped. Tune in soon for Part 2, thanks for reading.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=522&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/12/04/creating-a-jersey-boys-augmented-reality-site-using-papervision-3d-and-flartoolkit-part-1-setting-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/12/jb3d.jpg" medium="image">
			<media:title type="html">JB3D</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/12/storyboard.jpg" medium="image">
			<media:title type="html">storyboard</media:title>
		</media:content>
	</item>
		<item>
		<title>Video animation for Times Square Nasdaq screen</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/06/26/video-animation-for-times-square-nasdaq-screen/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/06/26/video-animation-for-times-square-nasdaq-screen/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 17:04:36 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[After Effects]]></category>
		<category><![CDATA[AfterEffects]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=502</guid>
		<description><![CDATA[A client of ours, Sarah Fey, came to us with a rush video animation job. When we found out the video would be displayed on the huge Nasdaq video billboard in Time Square, we couldn&#8217;t pass it up. To watch the final video and footage from the live feed, click here. To learn more about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=502&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div class="wp-caption alignnone" style="width: 405px"><a href="http://www.curiousm.com/blog/nasdaq/"><img title="Live feed of Nasdaq screen in Times Square" src="http://www.curiousm.com/blog/medidataNasdaq300.jpg" alt="Live feed of Nasdaq screen in Times Square" width="395" height="300" /></a><p class="wp-caption-text">Still from live feed of CMM video on Nasdaq screen in Times Square 6-25-09.</p></div>
<p>A client of ours, <a title="Sarah Fey" href="http://www.sarahfey.net/" target="_blank">Sarah Fey</a>, came to us with a rush video animation job. When we found out the video would be displayed on the huge Nasdaq video billboard in Time Square, we couldn&#8217;t pass it up. To watch the final video and footage from the live feed, <a title="CMM video animation for Nasdaq screen" href="http://www.curiousm.com/blog/nasdaq/" target="_blank">click here</a>. To learn more about the process of producing the video, read on&#8230;</p>
<p><span id="more-502"></span><br />
The video was for a new company called Medidata. The client gave me approved storyboards that showed frames from the animation and approximate time codes of when animations would happen. I set up a new After Effects project and got to work. This video was a little different than other videos I have worked on due to the quirks of the Nasdaq billboard. For one thing, the video is taller than it is wide, unusual for a video. Even stranger, the video needed to be submitted to Nasdaq as 1280&#215;720 HD video, a completely different aspect ratio than the actual screen. To account for this, Nasdaq recommends first building the video in the middle area of a 1280&#215;720 comp. Then, scale the width of this comp 237% to make the edges of your comp go to the edges of the screen. This video will look very distorted but when it is put in the Nasdaq system, it will be re-scaled to appear correctly.</p>
<p>The other issue is that 3/4 of the video is partly covered by a series of windows. On the final output, these windows are masked out, so whatever is in those places on the video will be blank. This presents a challenge to text, because you want to make sure that your text is large enough to be readable even if parts are masked out by the windows. Nasdaq provided me with a handy template that you can use to see where the windows will be in the final output, and adjust your text accordingly.</p>
<p>The first thing I did after setting up the comp at the correct size and putting in the window overlay was to bring in all of the elements. The client provided me with the images of the doctor and their logo to use. For the text, I decided to do that within After Effects instead of using images for two reasons: 1) Text will appear sharper and can be scaled without loss in resolution and 2) Will be much easier to change in case the client decides to change to wording partway through.</p>
<p>From there, I began to lay out of the elements at their proper entry points on the timeline. Once that was done, I took stills from different points in the video and put them up on an HTML page so that the client could see how the video was looking. Once those were approved, I went to work on the actual animation (having done most of my recent animations via Actionscript in Flash, it was interesting to go back to timeline animation). So I got to work keyframing all of the elements, previewing them, tweaking etc. Although I had an idea of when the animations should start and stop, I always find they change slightly when you start watching the animation and get into the flow of it. My favorite part was doing the cascading wall of &#8220;data&#8221;, in which instances of the word &#8220;data&#8221; will fall from the top of the screen and eventually fill the entire screen. I used a particle effects generator to give it a random feel, and adjusted the settings until it looked like I wanted.</p>
<p>After a couple of revisions and some more timing adjustments, the video was completed, rendered and sent to Nasdaq. We were able to capture some of the live stream of it running in Times Square, very exciting to see it at its full size. You can check out the full video and the Nasdaq capture <a title="Curious Minds video animation for Nasdaq screen" href="http://www.curiousm.com/blog/nasdaq/" target="_blank">here</a>. Thanks for reading!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=502&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/06/26/video-animation-for-times-square-nasdaq-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>

		<media:content url="http://www.curiousm.com/blog/medidataNasdaq300.jpg" medium="image">
			<media:title type="html">Live feed of Nasdaq screen in Times Square</media:title>
		</media:content>
	</item>
		<item>
		<title>Advantages of Using Flash Catalyst</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/06/17/advantages-of-using-flash-catalyst/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/06/17/advantages-of-using-flash-catalyst/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 14:23:59 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[customized components]]></category>
		<category><![CDATA[graphical user interface design]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[user interface design]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=458</guid>
		<description><![CDATA[

We have been currently working on a desktop application with customized components. As you may be aware without Flash Catalyst the work flow for creating an application with customized components can be time consuming and very demanding. You can customize the components using Flex Style Explorer or customize the templates offered in Illustrator, Fireworks, Flash [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=458&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;">
<p><img class="aligncenter size-full wp-image-495" title="fcSplash" src="http://curiousmindsmedia.files.wordpress.com/2009/06/fcsplash.jpg?w=480&#038;h=233" alt="fcSplash" width="480" height="233" /></p>
<p>We have been currently working on a desktop application with customized components. As you may be aware without Flash Catalyst the work flow for creating an application with customized components can be time consuming and very demanding. You can customize the components using Flex Style Explorer or customize the templates offered in Illustrator, Fireworks, Flash or PhotoShop. However, Adobe is now bridging the gap between design and development to make it easier. Flash Catalyst Beta has just been released. Is it a disappointment or not? There are many opinions out there. In this post we will review some of the advantages of Flash Catalyst and what it has to offer.</p>
<p><span id="more-458"></span><strong>1. Faster Work Flow - <span style="font-weight:normal;">Creating a more successful work flow and saving time is money. Let the designer and developer do what they do best. This is amazing because Flash Catalyst helps tie everything together. The designer can be working on making a change to the design while the developer is developing the back end.</span></strong></p>
<p>Flash Catalyst facilitates the designer in many ways:</p>
<ul>
<li>Gives the power to create a visual appearance for an application.</li>
<li>Offers pre-defined visual components to work with while designing an application.</li>
<li>Gives the freedom to arrange the components and create a unique interface.</li>
<li>Offers the ability to create a customized appearance without a headache.</li>
<li>Gives the designer written code with behaviors without having to know any code.</li>
</ul>
<p>Flash Catalyst facilitates the developer in other ways. Like:</p>
<ul>
<li>Gives the freedom to focus on what they do best which is writing code, connecting data and communication services.</li>
<li>Offers the ability to build and run the application with a totally customized look.</li>
</ul>
<p style="text-align:center;"><img class="size-full wp-image-469 aligncenter" title="fcInterface" src="http://curiousmindsmedia.files.wordpress.com/2009/06/fcinterface.jpg?w=480&#038;h=324" alt="fcInterface" width="480" height="324" /></p>
<p><strong>2. HUD &#8211; </strong>You may be asking what is the HUD. This is a new feature offered in the Flash Catalyst interface. The HUD is the Head-Up Display. It helps assist you the user while you are creating different projects in Flash Catalyst. How? When you have a component or anything on the stage selected in Flash Catalyst the HUD tells you what is selected and options with different things you can do with it. When you are first learning Flash Catalyst it can be very helpful and save time in general. You can move the HUD to any location so it does not have to get in your way.</p>
<p><img class="size-full wp-image-470 aligncenter" title="fcHUD" src="http://curiousmindsmedia.files.wordpress.com/2009/06/fchud.jpg?w=480&#038;h=178" alt="fcHUD" width="480" height="178" /></p>
<p style="text-align:center;">
<p><strong>3. Timeline &#8211; </strong>The timeline may be confusing at first. You may have been intimidated by the timeline in Flash but they have a different kind of timeline in Flash Catalyst. The timeline allows you to create specific interactions and transitions. The timeline in Flash Catalyst is different because it does not deal with a specific object that moves along the time timeline over the application like in Flash. You do not have to worry about easing in and out. The timeline allows you the user to create and time smooth transitions. The different kinds of animation it offers is smooth, fade, move, resize, rotate and 3D transitions. The user can control when they happen with the timeline.</p>
<p><img class="size-full wp-image-471 aligncenter" title="fcTimeline" src="http://curiousmindsmedia.files.wordpress.com/2009/06/fctimeline.jpg?w=480&#038;h=131" alt="fcTimeline" width="480" height="131" /></p>
<p><strong>4. Wireframes &#8211; </strong>A large part of developing and designing an application is selling the design to the client. You do not want to get half way through the development and find out that the client is unhappy with the design or functionality of an application. In Flash Catalyst the designer can create the application with transitions and show it to the client. This paints the big picture for the client without all of the development time. Some clients need to see the big picture to completely understand the final product they will receive. In Flash Catalyst you can create wireframes or the application. Apply transitions and show the client. They can tell you their likes and dislikes before it is even handed off to the developer. This will help while working with your clients and developers.</p>
<p style="text-align:center;"><img class="size-full wp-image-472 aligncenter" title="fcComponents" src="http://curiousmindsmedia.files.wordpress.com/2009/06/fccomponents.jpg?w=309&#038;h=229" alt="fcComponents" width="309" height="229" /></p>
<p><strong>5. Illustrator, Photoshop, Fireworks &#8211; </strong>If you are designer you are probably comfortable designing with one of the above programs. I like to work a lot in Illustrator. I can create an Illustrator file with all my customized components and bring it into Flash Catalyst and then back to Illustrator to make changes. The back and forth process is very helpful. The first time I did this it felt like a miracle that would have never happened. Magic? It is so simple, right? Their are some negatives. Nothing is ever perfect. Hopefully, all of the bugs will be worked out in the next release.</p>
<p>Thanks to Flash Catalyst making customized skins just got easier. We will be developing and designing with Flash Catalyst/Flash Builder in our upcoming projects. We will keep you updated as we dive deeper into the newest Beta release and let you know if Flash Catalyst is all they say it is. Hopefully, it will not be a disappointment.</p>
<p>If you have not downloaded Flash Catalyst or if you would like further information check out the following links:</p>
<p>Download Flash Catalyst at: <a href="http://labs.adobe.com/technologies/flashcatalyst/" target="_blank">http://labs.adobe.com/technologies/flashcatalyst/</a></p>
<p><a href="http://help.adobe.com/en_US/FlashCatalyst/1.0/Using/flash_catalyst_1.0_help.pdf" target="_blank">:: Click for the Flash Catalyst Help Document ::</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/458/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=458&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/06/17/advantages-of-using-flash-catalyst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/06/fcsplash.jpg" medium="image">
			<media:title type="html">fcSplash</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/06/fcinterface.jpg" medium="image">
			<media:title type="html">fcInterface</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/06/fchud.jpg" medium="image">
			<media:title type="html">fcHUD</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/06/fctimeline.jpg" medium="image">
			<media:title type="html">fcTimeline</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/06/fccomponents.jpg" medium="image">
			<media:title type="html">fcComponents</media:title>
		</media:content>
	</item>
		<item>
		<title>Flash Builder 4 beta Released</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/06/09/flash-builder-4-beta-released/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/06/09/flash-builder-4-beta-released/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:05:47 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Apollo]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=433</guid>
		<description><![CDATA[We had been waiting in eager anticipation through the first half of this year for it to finally arrive. All indications were that we would be well adjusted to our new work flow by the time summer rolled around for sure, enjoying all the new tooling and features of Flex 4...<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=433&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We had been waiting in eager anticipation through the first half of this year for it to finally arrive. All indications were that we would be well adjusted to our new work flow by the time summer rolled around for sure, enjoying all the new tooling and features of Flex 4, round tripping some super-duper new skins with our design team via Catalyst, and improving our productivity on the whole. But as winter gave way to spring, our excitement began to wane until I had all but forgotten about the coming of this new generation of Flex. When suddenly, with almost no warning whatsoever, it was upon us&#8230; the new Flash Builder 4 beta, code named &#8216;Gumbo&#8217;.</p>
<p><span id="more-433"></span></p>
<p>Adobe&#8217;s newest attempt at reconciling its past branding snafus, is to name their new flagship IDE &#8216;Flash Builder&#8217; which for me just seemed like a bad mashup of its progenitors&#8217; names. And this at a time when the development community had fully embraced the Flex application paradigm and branding, and to a great extent, so had the better informed end users of Flex applications. I personally thought that Flex Builder had a much more appealing ring to it as well, but hey, that&#8217;s just my personal opinion.</p>
<p>But how easy it is to be critical, and from what I can tell (despite the obligatory growing pains) this release is going to be a great big step forward for our team. Allow me to elaborate some..</p>
<p>We at curious minds have recently been working on some pretty snazzy AIR apps over the last few months, and in the process gotten very adept at skinning our components and integrating our designers&#8217; work quickly and effectively. (There are a few of our  blog posts relating to these topics that are quite informative if you are interested). According to Adobe, Catalyst is going to give us even more flexibility (not a pun) and better integration than before. Our designers are going to be able to create Flex apps directly in Catalyst, and our developers can import them and get down to business integrating the UIs with data and application logic. Finally, we&#8217;ll actually be able to work in the same environment, and on the same app simultaneously! I know that for certain developers (myself very much included), this is going to make life a great deal easier, allowing us to focus on the things that we are actually good at doing. This is probably the best feature of Catalyst as I see it. The fact that the work will now flow both directions between designers and developers, instead of the &#8216;uni-directional&#8217; limitation that seems to pervade our current system.</p>
<p>Another feature that I&#8217;m completely gaga over in &#8216;Gumbo,&#8217; is the integrated network traffic monitor. What a huge help this tool is going to be in the development/debugging process! With inline tree views of XML and AMF server response data, this HTTP monitor is going to cut a lot of the nasty trace style debugging right out. Also, being able to jump directly to the line in your code that originated the RPC request is a great feature of this tool.</p>
<p>All in all, I am really excited about diving into the new IDE. I&#8217;ll post up a full report once we get a little better situated with our new software, and as always, look for great tutorials on the new generation of Adobe design/development tools.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=433&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/06/09/flash-builder-4-beta-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>
	</item>
		<item>
		<title>Embedding Irregular Fonts in Flex 3</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/06/04/embedding-irregular-fonts-in-flex-3/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/06/04/embedding-irregular-fonts-in-flex-3/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 00:28:27 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=426</guid>
		<description><![CDATA[Often in programming, what seems to be a simple task can trip you up. Yesterday I was trying to embed the font Helvetic Neue LT Com Bold 77 in a css style sheet for a project of ours. After about 20 minutes of trying different methods to get the project to compile without any errors, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=426&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Often in programming, what seems to be a simple task can trip you up. Yesterday I was trying to embed the font Helvetic Neue LT Com Bold 77 in a css style sheet for a project of ours. After about 20 minutes of trying different methods to get the project to compile without any errors, I came across the following method:<span id="more-426"></span>It turns out that with a font like the Bold 77, The typeface is already bold, so there is no need to put the fontStyle:Bold directive in the css declaration. In fact, since 77 bold already contains no bold style, and declaring it as such will throw an error. </p>
<p>Font Book on mac is a great app. Using the app&#8217;s ability to intropect on the font, you can see all of the information in each font on your computer. The most important information you can get out of Font Book is the full font name attribute. The key here is to embed the full font name attribute in the flex application. Just like this:</p>
<p>@font-face<br />
{<br />
     src: url(&#8216;path/to/embed.swf&#8217;);<br />
     fontFamily:&#8221;Helvetic Neue LT Com Bold 77&#8243;;<br />
} </p>
<p>The important thing here is that if you arre unsure of what font faces are included in any particular font, just use the full font name alone, and dont mess with anything else. </p>
<p>For Flex Builder 3 apps, we like to use the Flash Embed method of getting the font transcoded into the Flex App. The resulting file size is much lower. Just be sure to embed only the characters that you are going to need, and not the entire set.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=426&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/06/04/embedding-irregular-fonts-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>
	</item>
		<item>
		<title>Graphical User Interface Design</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/05/22/gui-design-principles/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/05/22/gui-design-principles/#comments</comments>
		<pubDate>Fri, 22 May 2009 19:34:26 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[Design Process]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[desktop application]]></category>
		<category><![CDATA[graphical user interface design]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[user interface design]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=387</guid>
		<description><![CDATA[
Currently, we are working on building a new desktop application. It all begins with good planning and beautiful design. Here are four steps with tips that will help designers design a successful application.

1. Structure
The application design should organize the user interface purposefully. All elements of the design should have meaning and be useful. The structure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=387&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignnone size-full wp-image-398" title="login" src="http://curiousmindsmedia.files.wordpress.com/2009/05/login.jpg?w=480&#038;h=300" alt="login" width="480" height="300" /></p>
<p>Currently, we are working on building a new desktop application. It all begins with good planning and beautiful design. Here are four steps with tips that will help designers design a successful application.</p>
<p><span id="more-387"></span></p>
<p><strong>1. Structure</strong><br />
The application design should organize the user interface purposefully. All elements of the design should have meaning and be useful. The structure should be based on a clear and consistent model that is recognizable to user. The application structure should be organized so that related things are together and separate unrelated things. The structure is concerned with the overall user interface architecture.</p>
<ul>
<li><strong>Planning the Structure</strong><br />
A good way to keep the application design organized and structured is to plan ahead. Start by writing an outline of all of the functionality of the application. Then create simple wire frames for the whole application. This will save you time and allows the designer, developers and client to see the big picture.</li>
</ul>
<p><strong>2. Simplicity</strong><br />
The application design should be simple. The design should make common tasks simple to do and communicate clearly to the user. Here are a few design tips that can help create simplicity:</p>
<ul>
<li><strong>Consistent Design &#8211; </strong>One of the biggest mistakes with designing an application design is creating elements that are not consistent. Keeping a consistent style throughout all elements within the application will make an user-friendly application with a successful design. The application design should use consistent component styles and behaviors. Creating consistency through out the application will reducing the need for users to rethink and remember.</li>
</ul>
<ul>
<li><strong>Choosing Color &#8211; </strong>Color should be used sparingly in applications. The problem is that some users may be color blind. If an application uses color to highlight something on a screen, then you need to do something else to make it stand out if you want these people to notice it. The colors in the application should use contrast and be used consistently throughout application.</li>
<li>When deciding on a consistent set of colors to be used throughout the application do not forget about branding. If the application is for a company that has branded colors use the branded colors. If you are starting from scratch you have more freedom. The application should not look like a rainbow of colors. Think of three to five solid colors that you will use throughout the design.  For example, on the following application design the branding of this company uses red and black. Throughout the application we have used different percentages of black to white. Here are the percentages of black colors we used:<br />
100%, 90%, 85%, 60%, 40%, 30%, 10%, 0.</li>
<li>For the highlight and rollover color the application uses  a gradient with a bright red and regular red. On the down state it uses a regular red and a dark red gradient.</li>
</ul>
<p><img class="size-full wp-image-390 alignnone" title="typography" src="http://curiousmindsmedia.files.wordpress.com/2009/05/typography.jpg?w=480&#038;h=300" alt="typography" width="480" height="300" /><br />
<strong></strong></p>
<ul>
<li><strong>Typography &#8211; </strong>For readability you should pick a sans-serif typeface with a regular/roman/medium size and a bold that is easy to read. For a general size of the font for readability you should not go below 12px for text. 12px to 14px is easy to read for labels, data grids, text inputs, and any additional content. Panel labels and titles should be larger than the main text so they stand out.</li>
</ul>
<p><strong>3. Visibility</strong><br />
The application design should keep all needed options and materials for a given task visible without distracting the user. Good designs do not overwhelm users with too many alternatives or confuse them with unneeded information. Crowded screens are difficult to understand and are difficult to use. Here are a few tips on creating a strong sense of visibility:</p>
<ul>
<li><strong>Determine Hierarchy &#8211; </strong>The visual hierarchy of the application design is important for the user. Think about what is most important and least important. The most important items should have the most emphasis and the least important should have the least emphasis. If the hierarchy and layout is designed properly the users eye should move around the application from the most important to the least important. If you do not have strong hierarchy this may make the user confused. Hierarchy can be achieved by creating contrast, size, positioning, and color.</li>
</ul>
<ul>
<li><strong>Spacing &amp; Alignment &#8211; </strong>Do not waste space. In application design space should be used wisely. Align fields effectively. When a screen has more than one editing field, you want to organize the fields in a way that is both visually appealing and efficient. This example uses labels that are left justified and the edit fields are left justified. This is a clean and efficient way to organize the fields on a screen.</li>
</ul>
<p><img class="alignnone size-full wp-image-393" title="alignment" src="http://curiousmindsmedia.files.wordpress.com/2009/05/alignment.jpg?w=480&#038;h=300" alt="alignment" width="480" height="300" /></p>
<p><strong>4. Feedback</strong><br />
The application design should keep users informed of actions. This can include errors or a changes of state in the application. Use clear and concise language familiar to users. Expect the users to make mistakes. The application design should create a user interface that the user can recover from their mistakes.</p>
<p><img class="alignnone size-full wp-image-391" title="feedback1" src="http://curiousmindsmedia.files.wordpress.com/2009/05/feedback1.jpg?w=480&#038;h=300" alt="feedback1" width="480" height="300" /><img class="alignnone size-full wp-image-392" title="feedback2" src="http://curiousmindsmedia.files.wordpress.com/2009/05/feedback2.jpg?w=480&#038;h=300" alt="feedback2" width="480" height="300" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/387/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=387&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/05/22/gui-design-principles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/login.jpg" medium="image">
			<media:title type="html">login</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/typography.jpg" medium="image">
			<media:title type="html">typography</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/alignment.jpg" medium="image">
			<media:title type="html">alignment</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/feedback1.jpg" medium="image">
			<media:title type="html">feedback1</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/feedback2.jpg" medium="image">
			<media:title type="html">feedback2</media:title>
		</media:content>
	</item>
		<item>
		<title>Warning: Filter will not render. are too large to be draw</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/05/20/warning-filter-will-not-render-are-too-large-to-be-draw/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/05/20/warning-filter-will-not-render-are-too-large-to-be-draw/#comments</comments>
		<pubDate>Wed, 20 May 2009 19:01:01 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=384</guid>
		<description><![CDATA[If you are looking at this error in your flex compiler, make sure that the DisplayObject that you are trying to add to the stage is subclassing UIComponent and not UIMovieClip. The two are nearly interchangeable, yet the UIMovieClip needs specific bounds.
Happy Coding!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=384&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you are looking at this error in your flex compiler, make sure that the DisplayObject that you are trying to add to the stage is subclassing UIComponent and not UIMovieClip. The two are nearly interchangeable, yet the UIMovieClip needs specific bounds.</p>
<p>Happy Coding!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/384/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/384/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/384/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=384&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/05/20/warning-filter-will-not-render-are-too-large-to-be-draw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>
	</item>
		<item>
		<title>Full Browser Flash with changing background color and automatic scrollbars</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/05/15/full-browser-flash-movie-with-changing-background-color-and-automatic-scrollbars/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/05/15/full-browser-flash-movie-with-changing-background-color-and-automatic-scrollbars/#comments</comments>
		<pubDate>Fri, 15 May 2009 18:28:14 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[client fun]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Full Browser]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=360</guid>
		<description><![CDATA[


 


Bowen and Company website, design by Florio Design
I finished a Flash animation for a client in which the background color of the movie fades from brown to white. The client liked it but decided that he would like the background of the browser (behind the embedded Flash movie) to change as well.
I figured the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=360&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:center;">
<div class="mceTemp mceIEcenter">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><a href="http://www.bowenandco.com/" target="_blank"><img class="size-full wp-image-378" title="bowenScreens" src="http://curiousmindsmedia.files.wordpress.com/2009/05/bowenscreens.jpg?w=515&#038;h=227" alt="Bowen and Company website, design by Florio Design" width="515" height="227" /></a> </dt>
</dl>
</div>
<p><a href="http://www.bowenandco.com/" target="_blank">Bowen and Company website</a>, design by <a href="http://www.floriodesign.com/" target="_blank">Florio Design</a></p>
<p>I finished a Flash animation for a client in which the background color of the movie fades from brown to white. The client liked it but decided that he would like the background of the browser (behind the embedded Flash movie) to change as well.</p>
<p>I figured the best solution would be to make the Flash movie full browser. So here is the solution that I came up with:</p>
<p><span id="more-360"></span></p>
<p>I set the Background (CS3) or Stage (CS4) color of the Flash movie to brown and drew a white box on the stage, converted it to a MovieClip and named it &#8220;wBox&#8221;. I moved the layer with the white box underneath my main MovieClip (named &#8220;mainMC&#8221;) in the Timeline. Now I would need to code some Actionscript that would make the white box expand to fill the browser, while the main content above would remain at a fixed size and center horizontally on the screen.</p>
<p>Here is the code I used:</p>
<p>//set the stage position<br />
stage.align = StageAlign.TOP_LEFT;<br />
//do not let any of the stage scale (keeps main MC at fixed size)<br />
stage.scaleMode = StageScaleMode.NO_SCALE;</p>
<p>//add stage resize listener (this is called when the browser or flash movie is resized)<br />
stage.addEventListener(Event.RESIZE, resizeHandler);</p>
<p>//create function that is fired when resize is triggered<br />
function resizeHandler(event:Event):void {<br />
position();<br />
}</p>
<p>//call resize function at start of movie<br />
position();</p>
<p>//this is the function that stretches the white box to fill the browser and horizontally centers the main MC.<br />
function position() {<br />
wBox.width = stage.stageWidth;<br />
wBox.height = stage.stageHeight;<br />
mainMC.x = (stage.stageWidth/2)-(mainMC.width/2);<br />
}</p>
<p>At the appropriate time in the animation, I faded the white box, revealing the brown bg below.<br />
I like using the TweenLite class, I find it is more stable than the built in AS Tweening engine. You can download it <a href="http://blog.greensock.com/tweenliteas3/" target="_blank">here</a>.<br />
Here is the fade code for the white box:</p>
<p>import gs.TweenLite;<br />
TweenLite.to(this['wBox'], .5, {alpha:1});</p>
<p>Ok, so now the background is changing color no matter what the browser size so call it done, right? Not quite. If you were to scale the browser past the dimensions of the Flash movie, no scrollbars would appear. Not good for small screens, laptops etc.</p>
<p>Basically, I wanted the Flash movie to be at 100% of the browser unless it was scaled to less than its original size, after that the browser&#8217;s scrollbars would take over. The method I had used in the past to accomplish this didn&#8217;t work in this case because of the fading bg color, so I looked for a new solution.</p>
<p>I came across a simple Javascript method that was exactly what I needed. It embeds your Flash movie at 100% width and height, but also passes in a minimum width and height parameter. If the movie is scaled past this minimum size, scrollbars will appear.<br />
<a href="http://swffit.millermedeiros.com/" target="_blank">Here is the link</a> to the Javascript source.<br />
You will also need to download <a href="http://code.google.com/p/swfobject/" target="_blank">swfobject</a>.</p>
<p>Here is the way to use the embed code:</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/swfobject.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/swffit.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
swfobject.embedSWF(&#8220;ani.swf&#8221;, &#8220;ani&#8221;, &#8220;100%&#8221;, &#8220;100%&#8221;, &#8220;9.0.0&#8243;);<br />
swffit.fit(&#8220;ani&#8221;,900,700);<br />
&lt;/script&gt;<br />
&lt;div id=&#8221;ani&#8221;&gt;swf&lt;/div&gt;</p>
<p>Hope this helps with your full browser Flash implementations!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=360&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/05/15/full-browser-flash-movie-with-changing-background-color-and-automatic-scrollbars/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>

		<media:content url="http://curiousmindsmedia.files.wordpress.com/2009/05/bowenscreens.jpg" medium="image">
			<media:title type="html">bowenScreens</media:title>
		</media:content>
	</item>
		<item>
		<title>Using the Factory Method Pattern</title>
		<link>http://curiousmindsmedia.wordpress.com/2009/05/07/using-the-factory-method-pattern/</link>
		<comments>http://curiousmindsmedia.wordpress.com/2009/05/07/using-the-factory-method-pattern/#comments</comments>
		<pubDate>Thu, 07 May 2009 19:22:13 +0000</pubDate>
		<dc:creator>curiousmindsmedia</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Apollo]]></category>
		<category><![CDATA[Design Process]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[factory class]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[mxml]]></category>

		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=351</guid>
		<description><![CDATA[ Introduction to a Classic OOP Design Pattern
Throughout my career as a developer I have had the occasion to use the Factory Method Pattern when appropriate, and grown to rely on it extensively in recent months as several projects have dictated. I find this pattern to be extremely useful in creating a loosely-coupled application architecture, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=351&subd=curiousmindsmedia&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p> Introduction to a Classic OOP Design Pattern</p>
<p>Throughout my career as a developer I have had the occasion to use the Factory Method Pattern when appropriate, and grown to rely on it extensively in recent months as several projects have dictated. I find this pattern to be extremely useful in creating a loosely-coupled application architecture, which (as we&#8217;ve all been indoctrinated) is the cornerstone of well designed apps. It is my hope that this introduction will illuminate this pattern for the uninitiated. Even if you don&#8217;t find an immediate application for the Factory Pattern, just understanding the &#8216;why&#8217; and &#8216;how&#8217; of this design can be important in grasping the importance of the &#8220;open-closed&#8221; principle, and will help you to write better code. </p>
<p>Let me start off by giving the standard text-book definition of the pattern:</p>
<p>The Factory Pattern &#8220;&#8230;define[s] an interface for creating an object, but allows the subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.&#8221; </p>
<p><span id="more-351"></span></p>
<p>Chances are that many readers out there will be quite familiar this manner of verbiage. However if you need a quick primer, this more or less states that this pattern can be used when you have the need to create objects of a varying types, and whose types cannot be known before runtime. One quick aside, I&#8217;m going to call these objects &#8216;products&#8217; as real life factories generally produce things called products, and it is always useful when dealing with abstractions to think in more concrete terms. The situation I&#8217;ve just described is common if the product you need to create depends on configuration settings, or more likely, responses to user interaction. </p>
<p>Let&#8217;s step through a likely code example together to light a proverbial fire under this otherwise sterile illustration. I&#8217;ve chosen a product that I&#8217;m currently pretty enthused about&#8230; guitars. Now everybody knows that there are about int.MAX_VALUE types of guitars in the world, and any guitar player will tell you that you can never have too many of the darn things around. So it wouldn&#8217;t be a stretch to envision an app that queries a customer for his/her desired guitar characteristics, makes up a request for said guitar, and sends it off to a guitar factory object to do the construction of the desired guitar object, right? A superlative example if I do say so. </p>
<p>For the sake of simplicity, we&#8217;re going to limit the types of guitars available to the user to &#8216;electric&#8217;, &#8216;acoustic steel-string&#8217;, and  &#8217;acoustic nylon-string&#8217;, each of these types having unique properties, and the inherent need to be constructed in different ways. They are all guitars, however, and thus share certain properties common to all guitars. We can logically represent this commonality by defining an interface called IGuitar. IGuitar might look similar to the following:</p>
<p>public interface IGuitar{<br />
<span style="white-space:pre;"> </span>function lookPretty():void;<br />
<span style="white-space:pre;"> </span>function soundIncredible():AwestruckListener;<br />
}</p>
<p>These are all of the things that our guitars need to be able to do, else we call them canoe paddles, or bits of kindling, or perhaps worse. Each guitar class that implements this interface is responsible for providing the necessary details about how it does &#8216;lookPretty&#8217; and &#8217;soundIncredible.&#8217; Now, you might ask how we are going to build all of these different types of guitar in one factory. The key to this trick is all in the implementation of the IGuitar Interface. Here is our GuitarFactory code:</p>
<p>public class GuitarFactory {<br />
    public static function buildGuitar(guitarType:String):IGuitar {<br />
  <span style="white-space:pre;"> </span>   switch(guitarType) {<br />
            case &#8216;electric&#8217;:<br />
                return new ElectricGuitar();<br />
<span style="white-space:pre;"> </span>                break;<span style="white-space:pre;"> </span><br />
            case &#8216;acoustic steel_string&#8217;:<br />
                return new AcousticSteelStringGuitar();<br />
<span style="white-space:pre;"> </span>                break;<span style="white-space:pre;"> </span><br />
            case &#8216;acoustic nylon_string&#8217;:<br />
<span style="white-space:pre;"> </span>                return new AcousticNylonStringGuitar();<br />
<span style="white-space:pre;"> </span>                 break;<br />
<span style="white-space:pre;"> </span>                  default:<br />
<span style="white-space:pre;"> </span>                        trace(guitarType + &#8216; ain&#8217;t no guitar I&#8217;ve ever heard of.&#8217;);<br />
              }<br />
        }<br />
}</p>
<p>You&#8217;ll notice that the buildGuitar method returns an instance of IGuitar, which gives us the flexibility to return any type of object that has implemented that interface. This is crucial if we intend to add more and varied types of guitars to our custom guitar shop application. For instance, we could easily add bass-guitars, balalaikas, cavaqhinhos, or any other instrument that has agreed to meet the requirements set forth in the interface. </p>
<p> </p>
<p>This example is perhaps a bit pedestrian, if not corny, but you get the idea. The main point to take away from this is the idea that you can defer creation of a given type of object until it becomes necessary to build it. This gives you a great deal of flexibility in your application, and can be extremely handy in a host of situations. Check it out for yourself.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/curiousmindsmedia.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/curiousmindsmedia.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/curiousmindsmedia.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/curiousmindsmedia.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/curiousmindsmedia.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/curiousmindsmedia.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/curiousmindsmedia.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/curiousmindsmedia.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/curiousmindsmedia.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/curiousmindsmedia.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=curiousmindsmedia.wordpress.com&blog=761820&post=351&subd=curiousmindsmedia&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://curiousmindsmedia.wordpress.com/2009/05/07/using-the-factory-method-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b4a03293314d649070e7d91619c3dd4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">curiousmindsmedia</media:title>
		</media:content>
	</item>
	</channel>
</rss>