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

<channel>
	<title>switch(case)</title>
	<atom:link href="http://blog.juanbonfante.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.juanbonfante.com</link>
	<description>Following code wherever it leads</description>
	<lastBuildDate>Mon, 23 Aug 2010 17:17:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hi-Res Printing in Flash with AlivePDF</title>
		<link>http://blog.juanbonfante.com/?p=272</link>
		<comments>http://blog.juanbonfante.com/?p=272#comments</comments>
		<pubDate>Thu, 15 Jul 2010 19:53:05 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AlivePDF]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HOW TO:]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=272</guid>
		<description><![CDATA[Printing with Flash has always been one of those nagging issues I&#8217;ve never been able to successfully defeat, using the Flash PrintJob class that is. Although I want to sit here, and tell you how awful the PrintJob class is, I&#8217;ll let you try to explore that rocky road all by yourself; When you get to the point when [...]]]></description>
			<content:encoded><![CDATA[<p>Printing with Flash has always been one of those nagging issues I&#8217;ve never been able to successfully defeat, using the Flash PrintJob class that is. Although I want to sit here, and tell you how awful the PrintJob class is, I&#8217;ll let you try to explore that rocky road all by yourself; When you get to the point when you&#8217;re trying to use PixelBender for possibly getting a better algorithm for blending from pixel to pixel, and its still not working let me know, I could&#8217;ve saved you like 2 weeks worth of hair pulling by simply telling you to use: <a title="AlivePDF" href="http://www.alivepdf.org">AlivePDF</a>.</p>
<p><span id="more-272"></span></p>
<p>Once you have the source (or swc) downloaded, and imported into a project there is one important thing to remember, since we&#8217;re doing this is PureAS3:<br />
You need to add this to your compiler arguments or it won&#8217;t work:</p>
<p>-static-link-runtime-shared-libraries=true</p>
<p>Outside of that&#8230; Here&#8217;s the Code, and a <a title="Source ZIP" href="http://blog.juanbonfante.com/examples/alivepdf/jb.alivepdfdemo.zip" target="_blank">link to download it</a>, as well as use it:</p>
<p>*Thanks to Keith Peters for <a href="http://www.minimalcomps.com/">MinimalComponents</a></p>
<p><span style="color: #ff0000;">[update] Thanks to Joe Campbell, I&#8217;ve added the create.php file that allows you to proxy your save request to a server. This can be useful for two reasons:<br />
</span></p>
<ol>
<li><span style="color: #ff0000;"> If you need to save out of Flash Player 9, this is the only route you have.</span></li>
<li><span style="color: #ff0000;">If you need to get a preview back before actually saving. I worked on a solution before that converted the output then returned a small preview png.</span></li>
</ol>
<p><object style="width: 500px; height: 700px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="700" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="base" value="http://blog.juanbonfante.com/examples/alivepdf/bin/" /><param name="src" value="http://blog.juanbonfante.com/examples/alivepdf/bin/AliveDemo.swf" /><embed style="width: 500px; height: 700px;" type="application/x-shockwave-flash" width="500" height="700" src="http://blog.juanbonfante.com/examples/alivepdf/bin/AliveDemo.swf" base="http://blog.juanbonfante.com/examples/alivepdf/bin/"></embed></object></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com.juanbonfante.blog.demos <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com.bit101.components.HBox;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.bit101.components.Label;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.bit101.components.PushButton;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.bit101.components.VBox;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.display.Display;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.display.PageMode;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Layout;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Mode;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Orientation;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Position;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Resize;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Size;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.layout.Unit;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.pdf.PDF;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.alivepdf.saving.Method;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">DisplayObject</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Graphics</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Loader</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Shape</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageAlign</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">StageScaleMode</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">FileReference</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">URLRequest</span>;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * @author jbonfante
	 *
	 * This demo is used to show the usage of AlivePDF inside of a PureAS3 file.
	 *
	 * This shows how to print both Images as well as vector art.
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> AliveDemo extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//Define wethere an image has been loaded</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _imageLoaded <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
		<span style="color: #009900;">//Define wether the vectors button has been activated</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _vectors <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #009900;">//Container for the image display</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _imageDisplay <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//Container for the vector display</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _vectorDisplay <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #009900;">//Total number of vectors</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> numVectors <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">20</span>;
		<span style="color: #009900;">//Class member for lading image</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Important: Printing container is the container that is fed into
		 * the AlivePDF instance. Anything we add to printing container gets
		 * added to the print out PDF... with some consequences, but those are
		 * beyond the scope of this tutorial
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _printingContainer <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">//PDF Class instance</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myPDF <span style="color: #000000; font-weight: bold;">:</span> PDF;
		<span style="color: #009900;">//Label</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> imgText <span style="color: #000000; font-weight: bold;">:</span> Label;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> defaultLabel <span style="color: #000000; font-weight: bold;">:</span> Label;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myVbox <span style="color: #000000; font-weight: bold;">:</span> VBox;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myPrintButton <span style="color: #000000; font-weight: bold;">:</span> PushButton;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AliveDemo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Here we set up the UI items for the class, as well
			 * as add an empty printing container to the stage.
			 *
			 * Setup the button and their listeners
			 */</span>
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_printingContainer<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span>.<span style="color: #004993;">NO_SCALE</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span>.<span style="color: #004993;">TOP_LEFT</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> aHbox <span style="color: #000000; font-weight: bold;">:</span> HBox = <span style="color: #0033ff; font-weight: bold;">new</span> HBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> myImageButton <span style="color: #000000; font-weight: bold;">:</span> PushButton = <span style="color: #0033ff; font-weight: bold;">new</span> PushButton<span style="color: #000000;">&#40;</span>aHbox, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Image&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> myVectorButton <span style="color: #000000; font-weight: bold;">:</span> PushButton = <span style="color: #0033ff; font-weight: bold;">new</span> PushButton<span style="color: #000000;">&#40;</span>aHbox, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Vector&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> myBlendButton <span style="color: #000000; font-weight: bold;">:</span> PushButton = <span style="color: #0033ff; font-weight: bold;">new</span> PushButton<span style="color: #000000;">&#40;</span>aHbox, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Blend&quot;</span><span style="color: #000000;">&#41;</span>;
			myPrintButton = <span style="color: #0033ff; font-weight: bold;">new</span> PushButton<span style="color: #000000;">&#40;</span>aHbox, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Print&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> myText <span style="color: #000000; font-weight: bold;">:</span> Label = <span style="color: #0033ff; font-weight: bold;">new</span> Label<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">null</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Alive PDF - Printing Demo - Pure AS3 | for blog.juanbonfante.com&quot;</span><span style="color: #000000;">&#41;</span>;
			myVbox = <span style="color: #0033ff; font-weight: bold;">new</span> VBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>myVbox<span style="color: #000000;">&#41;</span>;
			myVbox.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>myText<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">//myVbox.addChild(myPushButton);</span>
			myVbox.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>aHbox<span style="color: #000000;">&#41;</span>;
&nbsp;
			myImageButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, OpenImage, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			myVectorButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, OpenVector, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			myBlendButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, ShowBlend, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			defaultLabel = <span style="color: #0033ff; font-weight: bold;">new</span> Label<span style="color: #000000;">&#40;</span>myVbox,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #990000;">&quot;Please Make a Selection&quot;</span><span style="color: #000000;">&#41;</span>
			defaultLabel.<span style="color: #004993;">scaleX</span> = defaultLabel.<span style="color: #004993;">scaleY</span> = <span style="color: #000000; font-weight:bold;">3</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Activated when the Blend Button is clicked
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> ShowBlend<span style="color: #000000;">&#40;</span>event <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_imageLoaded<span style="color: #000000;">&#41;</span>_printingContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_imageDisplay<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_vectors<span style="color: #000000;">&#41;</span>_printingContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_vectorDisplay<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>_imageLoaded <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #000000; font-weight: bold;">!</span>_vectors<span style="color: #000000;">&#41;</span>myVbox.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>myVbox.<span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				myVbox.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span>;
				myPrintButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, CreatePDF, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Activated when the Vector button is clicked. Auto populates empty container and adds it to the display list
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> OpenVector<span style="color: #000000;">&#40;</span>event <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_imageLoaded<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_printingContainer.<span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span>_imageDisplay<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>_printingContainer.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>_imageDisplay<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#125;</span>
			_vectorDisplay.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">10</span>;
			_vectorDisplay.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">50</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>_vectors<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span> ;i <span style="color: #000000; font-weight: bold;">&amp;</span>lt; numVectors ;i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
					<span style="color: #6699cc; font-weight: bold;">var</span> aChild <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">DisplayObject</span> = _vectorDisplay.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>addVectors<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
					aChild.<span style="color: #004993;">x</span> = <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">450</span>;
					aChild.<span style="color: #004993;">y</span> = <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">800</span>;
				<span style="color: #000000;">&#125;</span>
				_vectors = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #000000;">&#125;</span>
			_printingContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_vectorDisplay<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>myVbox.<span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>myVbox.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span>;
			myPrintButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, CreatePDF, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #3f5fbf;">/**
		 * Function to randomly create vector drawing
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> addVectors<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">DisplayObject</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> aVector <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Shape</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Shape</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> g <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Graphics</span> = aVector.<span style="color: #004993;">graphics</span>;
			g.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> 0xFFFCCC<span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">90</span><span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">180</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">75</span><span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">13</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">return</span> aVector;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #3f5fbf;">/**
		 * Used to load the image one the image button is clicked.
		 *
		 * If the image is already loaded, it is simply displayed.
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> OpenImage<span style="color: #000000;">&#40;</span>event <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>_imageLoaded<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">url</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;assets/demo.jpg&quot;</span>;
				<span style="color: #6699cc; font-weight: bold;">var</span> req <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000000;">&#41;</span>;
&nbsp;
				_imageDisplay.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">loader</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #009900;">//addChild(_imageDisplay);</span>
				<span style="color: #004993;">loader</span>.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>, ShowImage<span style="color: #000000;">&#41;</span>;
				_imageLoaded = <span style="color: #0033ff; font-weight: bold;">true</span>;
				<span style="color: #004993;">loader</span>.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>req<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
				_printingContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_imageDisplay<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_printingContainer.<span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span>_vectorDisplay<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>_printingContainer.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>_vectorDisplay<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>myVbox.<span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>myVbox.<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span>defaultLabel<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> ShowImage<span style="color: #000000;">&#40;</span>event <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			_imageDisplay.<span style="color: #004993;">alpha</span> = <span style="color: #000000; font-weight:bold;">1</span>;
			_imageDisplay.<span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">10</span>;
			_imageDisplay.<span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">50</span>;
			<span style="color: #004993;">loader</span>.<span style="color: #004993;">scaleX</span> = <span style="color: #004993;">loader</span>.<span style="color: #004993;">scaleY</span> = .25;
			imgText = <span style="color: #0033ff; font-weight: bold;">new</span> Label<span style="color: #000000;">&#40;</span>_imageDisplay, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #990000;">&quot;Image reduced to 25%&quot;</span><span style="color: #000000;">&#41;</span>;
			_printingContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>_imageDisplay<span style="color: #000000;">&#41;</span>;
			myPrintButton.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>, CreatePDF, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * Initializes AlivePDF class member
		 * and sets up image to printed or previewed
		 * @see http://alivepdf.org for documentation
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> CreatePDF<span style="color: #000000;">&#40;</span>event <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * The PDF Contructor takes the orientation of what you intend to print (i.e. paper orientation),
			 * as well as the units you wish it to measure the paper in,
			 * and the projected dimenstion of the sheet of paper LETTER, LEGAL, A4, etc...
			 */</span>
			myPDF = <span style="color: #0033ff; font-weight: bold;">new</span> PDF<span style="color: #000000;">&#40;</span>Orientation.<span style="color: #004993;">PORTRAIT</span>, Unit.POINT, Size.LETTER<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Before we can do anything with our PDF class it needs to contain a Page.
			 */</span>
			myPDF.<span style="color: #004993;">addPage</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Used to determine how we want our information to fit on the paper.
			 *
			 * Resize takes two variables:
			 * 1: Mode - How to resize: includes FIT_TO_PAGE , NONE, RESIZE_PAGE
			 * 2: Position - How to position resized image: includes CENTERED, LEFT, RIGTH
			 */</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> resMode <span style="color: #000000; font-weight: bold;">:</span> Resize = <span style="color: #0033ff; font-weight: bold;">new</span> Resize<span style="color: #000000;">&#40;</span>Mode.FIT_TO_PAGE, Position.CENTERED<span style="color: #000000;">&#41;</span>;
			<span style="color: #3f5fbf;">/**
			 * This adds a copy of our _priting container with the descriptor set up under resMode.
			 * THis is added to the current page of the PDF (first page in this case)
			 * and gives it a x,y offseet. Which is actually modified in this case by the Position variable
			 */</span>
			myPDF.addImage<span style="color: #000000;">&#40;</span>_printingContainer, resMode,<span style="color: #000000; font-weight:bold;">20</span>,<span style="color: #000000; font-weight:bold;">30</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * setDisplayMode is used to setup how the PDF will actually open up in the
			 * respective viewer (Acrobat, Preview)
			 * and does not impact the actual print out in any ways
			 */</span>
			myPDF.setDisplayMode<span style="color: #000000;">&#40;</span>Display.REAL, Layout.SINGLE_PAGE, PageMode.USE_NONE, <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">//myPDF.setFont(IFont(FontFamily.ARIAL), 8);</span>
			<span style="color: #3f5fbf;">/**
			 * Setup  file metadata information. This is later written into the PDF headers
			 */</span>
			<span style="color: #009900;">//#######METADATA</span>
			myPDF.setAuthor<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Juan Bonfante | blog.juanbonfante.com&quot;</span><span style="color: #000000;">&#41;</span>;
			myPDF.setCreator<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;2010 © Juan Bonfante&quot;</span><span style="color: #000000;">&#41;</span>;
			myPDF.setKeywords<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Juan Bonfante, AlivePDF, Demo, PureAS3, Flex, Flash, Actionscript&quot;</span><span style="color: #000000;">&#41;</span>;
			myPDF.setTitle<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Alive PDF Demo | PureAS3&quot;</span><span style="color: #000000;">&#41;</span>;
			myPDF.setSubject<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;AlivePDF Demo&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">//#######METADATA</span>
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Adds a peice of descriptive text to the document.
			 * You can *cautiously* use this to also format blocks and paragraphs onto your documents
			 * with dynamic text.
			 */</span>
			myPDF.addText<span style="color: #000000;">&#40;</span><span style="color: #990000;">'PDF Generated by AlivePDF | blog.juanbonfante.com'</span>, <span style="color: #000000; font-weight:bold;">25</span>, <span style="color: #000000; font-weight:bold;">25</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #3f5fbf;">/**
			 * Defines how the PDF should be saved
			 *
			 * By using Method.LOCAL the save function simply returns the newly created ByteArray.
			 *
			 * By using Method.REMOTE you would need a proxy file setup on the server in order to send the byte array
			 * to, and automatically attemps to download it.
			 *
			 * Method.Remote can be used if you don't have access to Flash Player 10
			 * otherwise with the FileReference class under FP10 you can simply just save it out.
			 */</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> output<span style="color: #000000; font-weight: bold;">:*</span> = myPDF.<span style="color: #004993;">save</span><span style="color: #000000;">&#40;</span>Method.LOCAL<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> aFile<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">FileReference</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">FileReference</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			aFile.<span style="color: #004993;">save</span><span style="color: #000000;">&#40;</span>output,<span style="color: #990000;">&quot;AlivePDFAS3Demo.pdf&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
                       <span style="color: #3f5fbf;">/**
			* If You wish to output using for Flash Player 9
			* You need to use a proxy in the language of your choice
			* For this example we use PHP
			*
			* Thanks to Joe Campbell for digging it up, since they've
			* been removed from the AlivePDF examples
			* AND COMMENT THE ABOVE 3 lines out
			*/</span>
&nbsp;
			<span style="color: #009900;">//myPDF.save( Method.REMOTE, &quot;create.php&quot;, &quot;AlivePDFAS3Demo.pdf&quot;);</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=272</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Android Icon</title>
		<link>http://blog.juanbonfante.com/?p=305</link>
		<comments>http://blog.juanbonfante.com/?p=305#comments</comments>
		<pubDate>Sat, 13 Mar 2010 20:59:36 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=305</guid>
		<description><![CDATA[So if you&#8217;re on a Mac, and like me have multiple installations of Eclipse, you want to set them apart in your dock, and when you alt+tab. I put together this icon file that will give your Eclipse icons a new look, its a mini droid! Enjoy. You have to goto your Eclipse installation directory, [...]]]></description>
			<content:encoded><![CDATA[<p>So if you&#8217;re on a Mac, and like me have multiple installations of Eclipse, you want to set them apart in your dock, and when you alt+tab. I put together this icon file that will give your Eclipse icons a new look, its a mini droid! Enjoy.</p>
<p>You have to goto your Eclipse installation directory, Right-Click your Eclipse Icon -&gt; Show Package Contents -&gt; Contents -&gt; Resources -&gt; REPLACE ECLIPSE.ICNS</p>
<p>Reboot Eclipse</p>
<p><a href="http://blog.juanbonfante.com/wp-content/uploads/2010/03/Eclipse.icns_.zip"><img class="alignnone size-full wp-image-306" title="littleDroid" src="http://blog.juanbonfante.com/wp-content/uploads/2010/03/littleDroid.png" alt="" width="64" height="75" /></a></p>
<p>should look like:</p>
<p><img class="alignnone size-full wp-image-308" title="Picture 20" src="http://blog.juanbonfante.com/wp-content/uploads/2010/03/Picture-20.png" alt="" width="280" height="191" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=305</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenZoom Template</title>
		<link>http://blog.juanbonfante.com/?p=300</link>
		<comments>http://blog.juanbonfante.com/?p=300#comments</comments>
		<pubDate>Tue, 02 Mar 2010 20:16:20 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=300</guid>
		<description><![CDATA[This is the OpenZoom viewer found in the downloads of the OpenZoom project under examples/cs4/multiScaleImage. All I did was change the AS to look for a &#8216;source; property in the FlashVars object of the HTML page. Enjoy. I used this template for a presentation, now I&#8217;m sharing it with everyone. OpenZoom_Presentation_Template http://github.com/openzoom]]></description>
			<content:encoded><![CDATA[<p>This is the OpenZoom viewer found in the downloads of the OpenZoom project under examples/cs4/multiScaleImage.</p>
<p>All I did was change the AS to look for a &#8216;source; property in the FlashVars object of the HTML page.</p>
<p>Enjoy.</p>
<p>I used this template for a presentation, now I&#8217;m sharing it with everyone.</p>
<p><a href="../wp-content/uploads/2010/03/OpenZoom_Presentation_Template.zip">OpenZoom_Presentation_Template</a></p>
<p><a href="http://github.com/openzoom" target="_blank">http://github.com/openzoom</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=300</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Presentation] Flexible Open Source &#8211; 2.23.2010</title>
		<link>http://blog.juanbonfante.com/?p=296</link>
		<comments>http://blog.juanbonfante.com/?p=296#comments</comments>
		<pubDate>Wed, 24 Feb 2010 20:30:12 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google Earth]]></category>
		<category><![CDATA[OpenZoom]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Roundarch]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=296</guid>
		<description><![CDATA[I recently did a presentation for at DePaul University here in Chicago, for Upsilon Pi Epsilon, International Honor Society for the Computing and Information Disciplines. The talk focuses more on my view of Creativity as applied to Rich Internet Applications, and how I apply an Agile methodology in order to iterate quickly, and get a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently did a presentation for at DePaul University here in Chicago, for <a title="UPE" href="http://clinton.cs.depaul.edu/upe/home.asp" target="_blank">Upsilon Pi Epsilon</a>, International Honor Society for the Computing and Information Disciplines. The talk focuses more on my view of Creativity as applied to Rich Internet Applications, and how I apply an Agile methodology in order to iterate quickly, and get a working product out of the door.</p>
<p>These are my &#8220;slides&#8221;&#8230; Well I Love Flash, and Hate PowerPoint. Google Docs is okay, but if I&#8217;m going to present I&#8217;m going to use the tools I use everyday, which in turn makes for a pretty cool presentation. I used OpenZoom for the presentation, its kind of a nice format if you have ALOT of ideas&#8230; but don&#8217;t feel like shrinking them into puny little slides.</p>
<div id="attachment_297" class="wp-caption alignnone" style="width: 310px"><a href="http://juanbonfante.com/presentations/02232010/"><img class="size-medium wp-image-297" title="Flexible Open Source" src="http://blog.juanbonfante.com/wp-content/uploads/2010/02/Picture-16-300x133.png" alt="...outside the box with OpenZoom" width="300" height="133" /></a><p class="wp-caption-text">OpenZoom Presentation</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=296</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZUI &#124; Exploring Zoomable User Interfaces with OpenZoom</title>
		<link>http://blog.juanbonfante.com/?p=270</link>
		<comments>http://blog.juanbonfante.com/?p=270#comments</comments>
		<pubDate>Tue, 02 Feb 2010 01:40:35 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OpenZoom]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=270</guid>
		<description><![CDATA[UPDATE: USE AT YOUR OWN RISK. HIGH LIKELIHOOD OF CRASHING YOUR BROWSER Here is basic proof of concept inserting OpenZoom interfaces within openzoom interfaces to make a basic image gallery. Further tweak of the controls will prove a very nice browsing experience. Also pairing with Flash Player 10&#8242;s capabilities for 3D and we make something [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_291" class="wp-caption alignnone" style="width: 580px"><a title="OpenZoom ZUI | Prototype" href="http://juanbonfante.com/openZoomZUI/" target="_blank"><img class="size-full wp-image-291" title="OpenZoom ZUI" src="http://blog.juanbonfante.com/wp-content/uploads/2010/01/Picture-14.png" alt="zui prototye" width="570" height="327" /></a><p class="wp-caption-text">Work in progress</p></div>
<p><span style="color: #ff0000;">UPDATE: USE AT YOUR OWN RISK. HIGH LIKELIHOOD OF CRASHING YOUR BROWSER</span></p>
<p>Here is basic proof of concept inserting OpenZoom interfaces within openzoom interfaces to make a basic image gallery. Further tweak of the controls will prove a very nice browsing experience. Also pairing with Flash Player 10&#8242;s capabilities for 3D and we make something quite impressive, and very lightweight (this swf being 76k).</p>
<address>None of this would be possible without <a title="OpenZoom" href="http://github.com/openzoom">Daniel Gasienica</a>, creator of OpenZoom. The depth of his work around OpenZoom alone is breathtaking, let alone the countless amount of guides he&#8217;s writing/wrote on the subject. These three posts alone are must-reads if you plan on using OpenZoom:</address>
<address><a title="Permanent Link: Inside Deep Zoom  – Part I: Multiscale Imaging" rel="bookmark" href="http://gasi.ch/blog/inside-deep-zoom-1/">Inside Deep Zoom  –Part I: Multiscale Imaging</a></address>
<address><a title="Permanent Link: Inside Deep Zoom – Part II: Mathematical Analysis" rel="bookmark" href="http://gasi.ch/blog/inside-deep-zoom-2/">Inside Deep Zoom –Part II: Mathematical Analysis</a></address>
<address></address>
<address><a title="Permanent Link: Inside Deep Zoom – Part III: Deep Zoom in Flash" rel="bookmark" href="http://gasi.ch/blog/inside-deep-zoom-3/">Inside Deep Zoom – </a><a title="Permanent Link: Inside Deep Zoom – Part III: Deep Zoom in Flash" rel="bookmark" href="http://gasi.ch/blog/inside-deep-zoom-3/">Part III: Deep Zoom in Flash</a></address>
<p>I realized the mixture of OpenZoom with AS3&#8242;s 3D capabilities offers a pseudo-3D engine. That doesn&#8217;t mean OpenZoom won&#8217;t play well with a fully loaded 3D engine&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=270</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Tutorial] Debugging AS3 from the browser using FDT</title>
		<link>http://blog.juanbonfante.com/?p=267</link>
		<comments>http://blog.juanbonfante.com/?p=267#comments</comments>
		<pubDate>Sun, 24 Jan 2010 21:00:50 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HOW TO:]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=267</guid>
		<description><![CDATA[If you&#8217;re an Actionscript programmer, you should probably at least know of FDT. If you don&#8217;t, travel over to their site, and download a copy of the software (free trial for 30 days). I&#8217;m assuming in this post you already have it installed, and you know how to compile files, and maybe even know how [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re an Actionscript programmer, you should probably at least know of FDT. If you don&#8217;t, travel over to their <a title="FDT - Powerflasher" href="http://www.fdt.powerflasher.com/" target="_blank">site</a>, and download a copy of the software (free trial for 30 days). I&#8217;m assuming in this post you already have it installed, and you know how to compile files, and maybe even know how write your own ANT scripts.</p>
<p>One of the nicest features of FDT is its debugger, it is full of features you would never find in the IDE&#8217;s (CS3/4/5), and if you&#8217;re used to debugging in Eclipse it follows that same route.</p>
<p>Quite often I&#8217;ll be brought onto a project in the middle of its development cycle, so I don&#8217;t have an option on how it&#8217;s setup. Quite often in Flash, I end up dealing with a bunch of FLA files and I&#8217;m forced to use the IDE for compiling. Same thing with Flex, but luckily FDT can run MXML, so that&#8217;s not much of an issue, it might just take a little extra time to setup your Flex project in FDT. What I&#8217;m trying to say here is don&#8217;t worry how you&#8217;re getting your original project (Flash, Flex, in case of a miracle its already FDT), with a little bit of configuration time, you can get just about any Actionscript project to run in FDT.</p>
<p><span id="more-267"></span></p>
<p><strong>So How DO I debug in the Browser using FDT?</strong></p>
<p><em>Regardless of your project you have to do the following to Eclipse:<br />
</em></p>
<ol>
<li>Goto Eclipse Preferences</li>
<li>General -&gt; Web Browser</li>
<li>Click on RadioBox &#8220;Use External Web Browser&#8221;</li>
<li>Pick your browser of choice&#8230; that has the Flash Debug Player installed (Firefox for me)
<ol>
<li>If you need to install the debug player: <a href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">Flash Download Center</a> and scroll down to &#8220;Adobe Flash Player 10 — Debugger Versions&#8230;&#8221; and pick the appropriate one for your environment.</li>
</ol>
</li>
</ol>
<p>Now Eclipse and FDT are ready for some remote debugging.</p>
<p>Now there are a few different cases you will probably end up doing a remote debug with. Sometimes you might be running a local html file, and sometimes you will be accessing a local running server. Both of these cases apply regardless of whether you are doing Flash (IDE) or a Flex project, or even if you don&#8217;t have either and all you have is a running swf that has debugging enabled.<br />
<span style="color: #ff0000;"><strong><em>*important note, if you&#8217;re not compiling with FDT, you have to make sure whatever swf you intend to target was compiled with a -debug flag. In the Flash IDE you can find this in the Profile settings of the FLA. Under Flex you have to add it to the compiler arguments. </em></strong></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">(case: Flash IDE compilation)<br />
Now you have a project setup in FDT, and you&#8217;re running the IDE to get your swf published. In FDT:</span></span></p>
<ol>
<li><span style="color: #ff0000;"><span style="color: #000000;">Create a new Class:</span></span>
<ol>
<li><span style="color: #ff0000;"><span style="color: #000000;">name: DebugInBrowser</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">package: doesn&#8217;t matter</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">extends: flash.display.Sprite</span></span></li>
</ol>
</li>
<li><span style="color: #ff0000;"><span style="color: #000000;">You can leave it empty.</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">Click the little <strong>ARROR NEXT TO THE BUG &#8211; &gt; </strong>Debug Configurations&#8230;</span></span><span style="color: #ff0000;"><span style="color: #000000;"><a href="http://blog.juanbonfante.com/wp-content/uploads/2010/01/Picture-9.png"><img class="size-full wp-image-288 alignnone" title="Debug Icon" src="http://blog.juanbonfante.com/wp-content/uploads/2010/01/Picture-9.png" alt="debug icon" width="29" height="21" /></a>
<p></span></span></li>
<li><span style="color: #ff0000;"> </span><span style="color: #ff0000;"> </span><span style="color: #ff0000;"></span>Once you create a new debug configuration under FDT AS3 Application, you can leaver pretty much everything the same, except for the start tab, change it to reflect the following&#8230; edit to match your project:
<p><div id="attachment_289" class="wp-caption alignnone" style="width: 1085px"><a href="http://blog.juanbonfante.com/wp-content/uploads/2010/01/Picture-11.png"><img class="size-full wp-image-289" title="Debug in Browser Configuration" src="http://blog.juanbonfante.com/wp-content/uploads/2010/01/Picture-11.png" alt="Debug in Browser Configuration" width="1075" height="693" /></a><p class="wp-caption-text">Change for your setup.</p></div></li>
<li>That&#8217;s it. In case you want to target localhost, just change the &#8220;Open URI after compilation&#8221; to = http://localhost/mysite/index.html or somespecialpage.php or .asp or .py or .jsp it doesn&#8217;t matter as long as you know the swf you want to debug is there, and it has debugging enabled.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=267</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year, New Format, New Blog Post</title>
		<link>http://blog.juanbonfante.com/?p=265</link>
		<comments>http://blog.juanbonfante.com/?p=265#comments</comments>
		<pubDate>Sun, 17 Jan 2010 21:15:28 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=265</guid>
		<description><![CDATA[Over the past year I realized my blog was an unorganized collection of random thoughts I decided to compile on a whim&#8230; which is okay, I like my train of thought, its sporadic. I&#8217;m sure like myself and anyone who&#8217;s ever read my blog, you&#8217;ve realized you never really know what to expect. Well that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past year I realized my blog was an unorganized collection of random thoughts I decided to compile on a whim&#8230; which is okay, I like my train of thought, its sporadic. I&#8217;m sure like myself and anyone who&#8217;s ever read my blog, you&#8217;ve realized you never really know what to expect.</p>
<p>Well that&#8217;s going to change.</p>
<p>Over the past year I&#8217;ve been studying some really cool facets about multiple different languages, teaching myself Python (which has more functionality than i ever imagined), started learning OpenFrameworks, and started learning some juicy tid bits about Android development.  Then there&#8217;s always Actionscript, where I&#8217;ve increased my knowledge by leaps and bounds&#8230;</p>
<p><span id="more-265"></span></p>
<p>After using wxPython, i realized Flex is actually ok. So I&#8217;m using Flex &#8220;a little&#8221; more (the Framework, not the SDK, I use the SDK ALL the time, duh); that and the newest version of <a title="FDT - Powerflasher" href="http://www.fdt.powerflasher.com/" target="_blank">FDT (beta)</a> helped &#8212; full MXML-autocompletion.</p>
<p>Then there is the Library mayhem, where with the proper library you can do anything in Flash, so I will cover some of the ones I&#8217;ve been using, and some of the ones I&#8217;ve forgotten. Didn&#8217;t do much 3D work this past year, so I will revisit Away3D and Papervision3D as well as Maya, so expect articles on all. Then the few I&#8217;ve been promising articles on for like 2 months, AlivePDF and OpenZoom.</p>
<p>&#8230;.*maybe even some Silverlight&#8230;.</p>
<h1>So WHAT&#8217;s this NEW format??</h1>
<p>Well realizing I need to con myself into actually posting blogs, I will be posting on a schedule.<br />
1 post a week.<br />
Sunday seems like an appropriate day to do it.</p>
<p>Also to keep myself on track, I will have the next posts listed with their due dates. So if a post starts with a date&#8230; It hasn&#8217;t been published yet, and you&#8217;ll know when it will be <img src='http://blog.juanbonfante.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I will be doing a few video tutorials as well, since that format seems to lend itself much better for certain things.</p>
<p>Anyways, Happy 2010! This year is gonna be awesome I have new bionic spine!</p>
<div class="wp-caption alignnone" style="width: 568px"><img title="The Scar" src="http://hphotos-snc3.fbcdn.net/hs088.snc3/15532_216398226856_530791856_3649447_5282704_n.jpg" alt="Scar" width="558" height="320" /><p class="wp-caption-text">The Scar a Week Later</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=265</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(2/21/2010) From Android to Earth, Flashing in between</title>
		<link>http://blog.juanbonfante.com/?p=277</link>
		<comments>http://blog.juanbonfante.com/?p=277#comments</comments>
		<pubDate>Sun, 17 Jan 2010 21:02:03 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google Earth]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=277</guid>
		<description><![CDATA[I will explore writing an android application, that will let me transfer geo-location along with other data (pictures,video,etc) from android device, to the web using both Google Earth API (plugin) and Flash as Front-End(s).]]></description>
			<content:encoded><![CDATA[<p>I will explore writing an android application, that will let me transfer geo-location along with other data (pictures,video,etc) from android device, to the web using both Google Earth API (plugin) and Flash as Front-End(s).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=277</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(2/14/2010) Python Pushing Pixels into Google Earth</title>
		<link>http://blog.juanbonfante.com/?p=274</link>
		<comments>http://blog.juanbonfante.com/?p=274#comments</comments>
		<pubDate>Sun, 17 Jan 2010 20:56:03 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Google Earth]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=274</guid>
		<description><![CDATA[I will explore using Python to push hi resolution images into Google Earth.]]></description>
			<content:encoded><![CDATA[<p>I will explore using Python to push hi resolution images into Google Earth.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=274</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gran Turismo and Actionscript3</title>
		<link>http://blog.juanbonfante.com/?p=255</link>
		<comments>http://blog.juanbonfante.com/?p=255#comments</comments>
		<pubDate>Tue, 15 Dec 2009 01:13:24 +0000</pubDate>
		<dc:creator>Juan B.</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://blog.juanbonfante.com/?p=255</guid>
		<description><![CDATA[Ok&#8230; So they don&#8217;t have anything to do with each other directly. But they do in my case! Since I love Gran Turismo and Actionscript&#8230; and although I can&#8217;t get better at Gran Turismo by using AS3, I can get better at AS3 while playing Gran Turismo (*this is highly speculative, and probably false considering [...]]]></description>
			<content:encoded><![CDATA[<p>Ok&#8230; So they don&#8217;t have anything to do with each other directly. But they do in my case! Since I love Gran Turismo and Actionscript&#8230; and although I can&#8217;t get better at Gran Turismo by using AS3, I can get better at AS3 while playing Gran Turismo (*this is highly speculative, and probably false considering I&#8217;ve just been putting quick hax apps with the IDE&#8230; ohh did I mention I hate the IDE&#8230; well I found a use for it&#8230; ). Because of my surgery (Spinal Fusion&#8230; it was awesome) I have a bit of time to lay on my back and stare at screens&#8230;. here&#8217;s a result:</p>
<p><object style="width: 500px; height: 400px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blog.juanbonfante.com/examples/gt4/cornering.swf" /><embed style="width: 500px; height: 400px;" type="application/x-shockwave-flash" width="500" height="400" src="http://blog.juanbonfante.com/examples/gt4/cornering.swf"></embed></object></p>
<p><span id="more-255"></span></p>
<p>Ok&#8230; So that was the not very useful animation of the physics of turning&#8230;. hey they apply to real life to. But the actual purpose for all of this, was I found a settings guide for cars online (considering I&#8217;ve been playing the game for 7 years&#8230; I finally looked for help). Cool guide to you can find it <a href="http://www.gamefaqs.com/console/ps2/file/561066/35714" target="_blank">here</a>. But it was giving me percentages and I was just using <a title="Quicksilver" href="http://www.blacktree.com/" target="_blank">Quicksilver</a> to calculate it all, and well that was taking forever. I can write a post just about Quicksilver since it&#8217;s like the best thing you could ever use on your mac&#8230; but I&#8217;m not going there right now, this is about GT4. So I build a little something for you to see what settings stuff should be at. Theres a couple of other settings in the guide I&#8217;ve been meaning on putting in there&#8230; but I&#8217;m going back to the game now. Enjoy!</p>
<p><a title="Gt4 Calc Source" href="http://blog.juanbonfante.com/examples/gt4/gt4calc.fla">Source</a><br />
All it does is takes a low limit number, the high limit number, then the percentage in decimal notation (i.e. 40% = .4)&#8230; then returns the number in relation to the original number.</p>
<p>*two swtich statements were harmed during the making of this swf</p>
<p><object style="width: 500px; height: 800px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="800" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blog.juanbonfante.com/examples/gt4/gt4calc.swf" /><embed style="width: 500px; height: 800px;" type="application/x-shockwave-flash" width="500" height="800" src="http://blog.juanbonfante.com/examples/gt4/gt4calc.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.juanbonfante.com/?feed=rss2&amp;p=255</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
