<?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"
	>

<channel>
	<title>Flash Flood</title>
	<atom:link href="http://eddieoleary.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://eddieoleary.com</link>
	<description>Flash CS3 and Actionscript 3 discussions</description>
	<pubDate>Wed, 06 Aug 2008 21:50:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>My company has launched a new website.</title>
		<link>http://eddieoleary.com/2008/08/06/my-company-has-launched-a-new-website/</link>
		<comments>http://eddieoleary.com/2008/08/06/my-company-has-launched-a-new-website/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 21:50:06 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/?p=14</guid>
		<description><![CDATA[Check out http://teamcolab.com
We have finally found the time to launch a new site.Â  Let me know what you think!
]]></description>
			<content:encoded><![CDATA[<p>Check out <a title="CoLab Multimedia" href="http://teamcolab.com">http://teamcolab.com</a></p>
<p>We have finally found the time to launch a new site.Â  Let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2008/08/06/my-company-has-launched-a-new-website/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL Trick: Selecting unique records.</title>
		<link>http://eddieoleary.com/2008/06/13/sql-trick-selecting-unique-records/</link>
		<comments>http://eddieoleary.com/2008/06/13/sql-trick-selecting-unique-records/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 14:00:28 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/?p=13</guid>
		<description><![CDATA[The Situation:
I have a bunch of records.  They are items with five or so fields.  One of the fields is the artist that created the item (artist_id).  I needed to pull just one item from each artist and I needed all the other fields associated with each item.  I tried:
PLAIN TEXT
SQL:




SELECT [...]]]></description>
			<content:encoded><![CDATA[<p>The Situation:<br />
I have a bunch of records.  They are items with five or so fields.  One of the fields is the artist that created the item (artist_id).  I needed to pull just one item from each artist and I needed all the other fields associated with each item.  I tried:</p>
<div class="igBar"><span id="lsql-3"><a href="#" onclick="javascript:showPlainTxt('sql-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-3">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span> artist_id <span style="color: #993333; font-weight: bold;">FROM</span> items <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> artist_id <span style="color: #993333; font-weight: bold;">ASC</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This partially did what I wanted.  It returns all the UNIQUE artist_id.  I want essentially a sample item for EACH artist.</p>
<p>The Solution:</p>
<div class="igBar"><span id="lsql-4"><a href="#" onclick="javascript:showPlainTxt('sql-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-4">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *, COUNT<span style="color:#006600; font-weight:bold;">&#40;</span>artist_id<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> items <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> artist_id <span style="color: #993333; font-weight: bold;">HAVING</span> COUNT<span style="color:#006600; font-weight:bold;">&#40;</span>artist_id<span style="color:#006600; font-weight:bold;">&#41;</span>&amp;gt;=<span style="color: #cc66cc;color:#800000;">1</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This returns ONE row for each artist.  I found this on a blog, I cant remember the name but when I find it again I will post credit.  I hope this helps some of you.</p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2008/06/13/sql-trick-selecting-unique-records/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sending form data with Actionscript 3</title>
		<link>http://eddieoleary.com/2008/01/08/sending-form-data-with-actionscript-3/</link>
		<comments>http://eddieoleary.com/2008/01/08/sending-form-data-with-actionscript-3/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 17:37:20 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[as3 tutorial]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/2008/01/08/sending-form-data-with-actionscript-3/</guid>
		<description><![CDATA[So I just spent a few hours trying to figure out how to submit form data with Actionscript.    It really isn't very hard, so I have discovered after a little research.  I am going to show you an example of how to do it which I wouldn't describe as "best practice" [...]]]></description>
			<content:encoded><![CDATA[<p>So I just spent a few hours trying to figure out how to submit form data with Actionscript.    It really isn't very hard, so I have discovered after a little research.  I am going to show you an example of how to do it which I wouldn't describe as "best practice" but it works.</p>
<p>The reason I describe this as less than best practice is because when you send data to the sever you get no response.  So, even though it works 99.9 per cent of the time, you do not get a confirmation that the server received your request.</p>
<p>All my client wants is for a user to be able to enter his / her email address in to a box and have and email sent and then add that email address to an email.  So really we are just sending some text to my client from a form.  We want the user to enter the text and click send and have it be sent without another browser window opening.</p>
<p>The model for this is as follows:  flash will send data to a URL with the POST method and a PHP file will get the data and send an email to my client.</p>
<p>So we need 2 things:</p>
<p>The actionscript...</p>
<div class="igBar"><span id="lactionscript-7"><a href="#" onclick="javascript:showPlainTxt('actionscript-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-7">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> request:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"http://mysite.com/submit.php"</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> variables:URLVariables = <span style="color: #000000; font-weight: bold;">new</span> URLVariables<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">variables.<span style="color: #006600;">email</span> = emailSubmitText;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">request.<span style="color: #0066CC;">data</span> = variables;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">request.<span style="color: #006600;">method</span> = URLRequestMethod.<span style="color: #006600;">POST</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sendToURL<span style="color: #66cc66;">&#40;</span>request<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>and the PHP:</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$emailAddress</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$to</span> = <span style="color:#FF0000;">"eddie@teamcolab.com"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$subject</span> = <span style="color:#FF0000;">"You have a new subscriber"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$body</span> = <span style="color:#0000FF;">$emailAddress</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/mail"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to</span>, <span style="color:#0000FF;">$subject</span>, <span style="color:#0000FF;">$body</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Your message was sent"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"There was a problem."</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2008/01/08/sending-form-data-with-actionscript-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image Smoothing&#8230; a must know!</title>
		<link>http://eddieoleary.com/2007/12/09/image-smoothing-a-must-know/</link>
		<comments>http://eddieoleary.com/2007/12/09/image-smoothing-a-must-know/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 02:28:05 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[as3 tutorial]]></category>

		<category><![CDATA[flash ide]]></category>

		<category><![CDATA[image smoothing]]></category>

		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/2007/12/09/image-smoothing-a-must-know/</guid>
		<description><![CDATA[So I decided to start working with graphics a bit more.  Nothing too exciting, but I wanted to have the earth rise and start rotating in a little flash ad for my company's website.  I cut out a nice picture of the earth, imported it to the stage and started scripting.  I [...]]]></description>
			<content:encoded><![CDATA[<p>So I decided to start working with graphics a bit more.  Nothing too exciting, but I wanted to have the earth rise and start rotating in a little flash ad for my company's website.  I cut out a nice picture of the earth, imported it to the stage and started scripting.  I used a simple tween, which I will post about soon, and all was well.... kinda.  So the earth rotated fine  but it looked kind of jagged and pixelated at some points during the movement.  I figured this was just something I would have to live with and moved on.  I came across and article in <a href="http://justin.everett-church.com">Justin Everret-Church's blog</a> that talked about image smoothing.  Justin is the project manager for Adobe's Flash player.</p>
<p>Long Story short, I tried it.  It makes a huge difference and it is scary to think that I might never have come across that feature.  When you import an image to the library (jpg, gif, or png), right click it and select properties.  When you do that there will be an option called "Allow Image Smoothing."  I do not know of any drawbacks to this yet but I do know that it makes a huge difference when animating images.</p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2007/12/09/image-smoothing-a-must-know/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Embedding Fonts</title>
		<link>http://eddieoleary.com/2007/12/05/embedding-fonts/</link>
		<comments>http://eddieoleary.com/2007/12/05/embedding-fonts/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 04:29:27 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[as3 tutorial]]></category>

		<category><![CDATA[embed fonts textField textFormat]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/2007/12/05/embedding-fonts/</guid>
		<description><![CDATA[This post piggy-backs on the previous post about adding text to the screen.?  Sometimes just adding text does not cut it.?  This matters specifically when you want flash to render a font and not rely on the fonts that the user may or may not have installed.?  Doing so will ensure that [...]]]></description>
			<content:encoded><![CDATA[<p>This post piggy-backs on the previous post about adding text to the screen.?  Sometimes just adding text does not cut it.?  This matters specifically when you want flash to render a font and not rely on the fonts that the user may or may not have installed.?  Doing so will ensure that the text you want to display is displayed the way you want and the same way for everyone.?  The font file is actually embedded in your SWF file.</p>
<p>I came across font embedding for a different reason.?  I wanted to put dynamic text on the screen and then modify some of its properties.?  I tried to change the alpha of the text and quickly realized that it did not work.</p>
<p>When you embed the font with the SWF flash actually renders the text which allows you to apply filters to the text and change properties such as the alpha.?  This is not possible with out embedding.</p>
<p>Embedding is easy!</p>
<p>Start first in your Flash IDE and right click inside the library.?  Then click "New Font..." select the font you want, name it whatever you want, and click ok.?  Note:?  If you are using a font and you also want to use a bold face of the font you need to import them separately.</p>
<p><a href="http://eddieoleary.com/wp-content/uploads/2007/12/1.png" title="Embedding Fonts 1"><img src="http://eddieoleary.com/wp-content/uploads/2007/12/1.png" alt="Embedding Fonts 1" /></a></p>
<p><a href="http://eddieoleary.com/wp-content/uploads/2007/12/2.png" title="Embedding fonts 2"><img src="http://eddieoleary.com/wp-content/uploads/2007/12/2.png" alt="Embedding fonts 2" /></a></p>
<p>Now you should see the font listed in your library.</p>
<p><a href="http://eddieoleary.com/wp-content/uploads/2007/12/3.png" title="3.png"><img src="http://eddieoleary.com/wp-content/uploads/2007/12/3.png" alt="3.png" /></a></p>
<p>Now for the fun part:?  right click the font in your library and click "linkage."?  When the linkage window opens check "export for actionscript" and pick a class name that you will remember.?  For Futura Medium I chose "FuturaMed."</p>
<p><a href="http://eddieoleary.com/wp-content/uploads/2007/12/4.png" title="4.png"><img src="http://eddieoleary.com/wp-content/uploads/2007/12/4.png" alt="4.png" /></a></p>
<p>Now you can access the font with actionscript!</p>
<p>Lets go in to the actions panel and write a little code.</p>
<p>First we need to create a font object:</p>
<p><strong>var myFont:Font = new FuturaMed(); </strong><br />
This creates a new instance of the font we embedded in the Flash library.?  Notice that the font object name "FuturaMed" should be the same as the Class name you gave your font on the linkage panel.</p>
<p>There is really not much else left to do.?  For the sake of saving space I wiill refer to my previous post <a href="http://eddieoleary.com/2007/11/28/4/">Let’s make a text field appear</a>.?  We just need to change a few more things to apply the font object to the text.?  First we need to attach the font to our textFormat object.?  In the last example I used and object called "textFormat."</p>
<p><strong>textFormat.font = myFont.fontName;</strong><br />
Now the font object is attached to the textFormat object that is applied to your textField object.</p>
<p>You would probably assume, like I did, that it would just work now.?  Nope.?  You need to add one more line of code to your textField object.<br />
<strong>myText.embedFonts = true;</strong></p>
<p>Now you are all set.?  Below I will include the complete code for this exercise so you can see it all together.</p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Create your font instance</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> myFont:<span style="color: #0066CC;">Font</span> = <span style="color: #000000; font-weight: bold;">new</span> FuturaMed<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&lt;strong&gt;? &lt;/strong&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Set your text formating up</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textFormat</span>:<span style="color: #0066CC;">TextFormat</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">size</span> = <span style="color: #cc66cc;color:#800000;">20</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">color</span> = 0xFF0000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">font</span> = myFont.<span style="color: #006600;">fontName</span>;?&nbsp; <span style="color: #808080; font-style: italic;">//?&nbsp; here we apply the font to the formatting object</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//?&nbsp; Set your text field up</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> myText:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">autoSize</span> = TextFieldAutoSize.<span style="color: #0066CC;">LEFT</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">theText = <span style="color: #ff0000;">"Hello world."</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">text</span> = theText;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">embedFonts</span> = <span style="color: #000000; font-weight: bold;">true</span>; ?&nbsp; ?&nbsp; ?&nbsp; ?&nbsp; <span style="color: #808080; font-style: italic;">// set embedFonts to true and we are good to go.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">setTextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textFormat</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// put it on the stage</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">addChild<span style="color: #66cc66;">&#40;</span>myText<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2007/12/05/embedding-fonts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let&#8217;s make a text field appear.</title>
		<link>http://eddieoleary.com/2007/11/28/4/</link>
		<comments>http://eddieoleary.com/2007/11/28/4/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 05:17:19 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[as3 tutorial]]></category>

		<category><![CDATA[actionscript 3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[text object]]></category>

		<category><![CDATA[textfield()]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/?p=4</guid>
		<description><![CDATA[In flash you can use the visual IDE, Actionscript, or both to create content.   This allows for a lot of flexibility for the developer or designer.   For example, if you want to create a text field you can literally draw one with the IDE or your can create one with actionscript [...]]]></description>
			<content:encoded><![CDATA[<p>In flash you can use the visual IDE, Actionscript, or both to create content.   This allows for a lot of flexibility for the developer or designer.   For example, if you want to create a text field you can literally draw one with the IDE or your can create one with actionscript (AS).</p>
<p>As a developer I prefer to create as much content as I can with AS because it gives me more flexibility and also allows me to create objects like a text field on the fly dynamically.</p>
<p>For this example we are working in the Actions panel of the Flash IDE.</p>
<p>The first thing you need to do is create a variable to hold the text field object:</p>
<h5>var myText:TextField = new TextField();</h5>
<p>Next I want to make sure that the text field expands to match the text that I assign to it.   In this case I want the text field to expand to the left:</p>
<h5>myText.autoSize = TextFieldAutoSize.LEFT;</h5>
<p>Now that we have created the text field we can go ahead and put some data in to it:</p>
<h5>myText.text = "Hello world!"</h5>
<p>At this point if you run your program you will not see anything even though you did everything correctly.   What you need to do it add the text field to the stage.  You can do that with a very simple command:</p>
<h5>addChild(myText);</h5>
<p>Now if you look you have text on the stage when you run your movie.</p>
<p>Okay... that was great right?   What if we want to add formatting to the text?</p>
<p>As you might have guessed we created another object to contain our formatting information:</p>
<h5>var textFormat:TextFormat = new Format();</h5>
<p>Now that we have a place to store the formatting information we can set the font and the size of the formatting object.</p>
<h5>textFormat.size = 20;<br />
textFormat.color = 0xFF0000;</h5>
<p>If you are wondering what 0xFF0000 is... it is red in hex format.   Flash likes its colors defined in hex.</p>
<h5>textFormat.font = "Helvetica";</h5>
<p>The font needs to be installed on your computer.   If Helvetica does not work try Arial.</p>
<p>Now we need to apply the formatting to the text object we created earlier.</p>
<h5>myText.setTextFormat(textFormat);</h5>
<p>Now you should have text on your screen formatted to your liking.   As you might expect you can apply your text formatting object over and over to whatever text objects you want.  This is great because like CSS it allows you to change all your text of a similar type with one bit of code instead of going in to the IDE and changing every field one by one.</p>
<p>Here is the code:</p>
<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showPlainTxt('actionscript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// Set your text formating up</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textFormat</span>:<span style="color: #0066CC;">TextFormat</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">font</span> = <span style="color: #ff0000;">"Arial"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">size</span> = <span style="color: #cc66cc;color:#800000;">20</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">color</span> = 0xFF0000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//&nbsp; Set your text field up</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> myText:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">autoSize</span> = TextFieldAutoSize.<span style="color: #0066CC;">LEFT</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">theText = <span style="color: #ff0000;">"Hello world."</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">text</span> = theText;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myText.<span style="color: #0066CC;">setTextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textFormat</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// put it on the stage</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; font-weight:bold;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">addChild<span style="color: #66cc66;">&#40;</span>myText<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In the next entry we will discuss some problems that can occur when you try to animate a text field and how it can be solved by embedding fonts.</p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2007/11/28/4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This will be good.</title>
		<link>http://eddieoleary.com/2007/11/27/this-will-be-good/</link>
		<comments>http://eddieoleary.com/2007/11/27/this-will-be-good/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 02:56:42 +0000</pubDate>
		<dc:creator>Eddie</dc:creator>
		
		<category><![CDATA[Nonsense]]></category>

		<category><![CDATA[as3 tutorial]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://eddieoleary.com/?p=3</guid>
		<description><![CDATA[I am putting this together as a reaction to learning Actionscript 3.  I am a web developer and designer for the Virginia House of Delegates and also run a web development business in Richmond, VA. ?  Recently I have started developing Flash CS 3 applications and websites with actionscript 3.?   Though [...]]]></description>
			<content:encoded><![CDATA[<p>I am putting this together as a reaction to learning Actionscript 3.  I am a web developer and designer for the Virginia House of Delegates and also run a web development business in Richmond, VA. ?  Recently I have started developing Flash CS 3 applications and websites with actionscript 3.?   Though there are tutorials on the web there are still no "great" actionscript 3 references out there yet.  Over the last couple of weeks I have been stumbling through AS3 and I will use this blog to share with you what I have figured out so far.?  I would go in to how excited I am about it but i figure you probably feel the same way if you are taking the time to read my posts.?  I hope this is helpful to you!</p>
]]></content:encoded>
			<wfw:commentRss>http://eddieoleary.com/2007/11/27/this-will-be-good/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
