<?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>Pixil.info &#187; Flash</title>
	<atom:link href="http://pixil.info/category/tutorials/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixil.info</link>
	<description>We make video tuts on design and development.</description>
	<lastBuildDate>Fri, 23 Jul 2010 22:33:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to build XML Gallery in Action Script 3</title>
		<link>http://pixil.info/downloads/how-to-build-xml-gallery-in-action-script-3/</link>
		<comments>http://pixil.info/downloads/how-to-build-xml-gallery-in-action-script-3/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 03:06:50 +0000</pubDate>
		<dc:creator>Jeremy Lawson</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[action script 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[jeremy lawson]]></category>
		<category><![CDATA[jermbo]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://pixil.info/?p=244</guid>
		<description><![CDATA[Coming up on today&#8217;s episode: How to build an XML slide show gallery with Action Script 3. This is going...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpixil.info%2Fdownloads%2Fhow-to-build-xml-gallery-in-action-script-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpixil.info%2Fdownloads%2Fhow-to-build-xml-gallery-in-action-script-3%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Coming up on today&#8217;s episode:</strong></p>
<p>How to build an XML slide show gallery with Action Script 3.</p>
<p>This is going to a four part tutorial where I show you what XML is, what an Array is, How to load the XML into Flash, and some really cool effects using the Transition Manager.</p>
<p><span id="more-244"></span></p>
<p class="xml-t1" ><strong>Part One &#8211; Understanding XML</strong></p>
<div class="xml-p1">
<p>If you have used HTML at all then you are ahead of the game. XML is very similar in the sense that every opening tag must have a closing tag. For Example here is a tag of strong around the word &#8220;Hello!” As for XML I have a tag of name around the word &#8220;Jermbo”.  Or we can have a self closer like the image tag in HTML.  I make a tag called name and give it an attribute of first with a value of &#8220;Jermbo”.  Unlike HTML, XML allows you to create your naming convention. So use this to your advantage.  Let’s say that you are making a user name XML. Use tags like<br />
<blockquote>&lt;username&gt;&lt;password&gt;&lt;email&gt;</p></blockquote>
<p>. Or photo gallery, you can use names like<br />
<blockquote>&lt;nature&gt;&lt;city&gt;&lt;space&gt;.</p></blockquote>
<p>. Use anything that makes sense to your project.</p>
<p>Now there are a few &#8220;rules” of XML that I want to point out.</p>
<p><strong>Every XML document MUST have a root node.</strong><br/>XML is very case sensitive. It doesn’t matter if you use camel case, all lower case, or all caps just make sure you use them consistently. I recommend using camel case, I find it easier to read and use it in my style of writing.</p>
<p>As first stated all tags must be closed. Either with a closing tag or a self closing tag.</p>
<p>All tags must be properly nested. Meaning Opened and Closed in order. As an example I am using color tag and green tag and this illustrates the proper way of nesting your code.</p>
<p>All attributes must be quoted! For the example that I am using, I want the path of my photo to be an attribute. On screen is an example of the right and wrong way of doing that.</p>
<p>You must have a Doc Type Declaration. This helps avoid any confusion on the browsers part .  If you open a new XML document in a program like DreamWeaver it will give you the doc type automatically. Other notable properties of XML is, like HTML you can leave comments. Comments are done the same way in XML and HTML.<br />
<blockquote>&lt;!&#8211;comment example &#8211;&gt;</p></blockquote>
<p> This is great for many reasons. One, you can comment code out if you don’t want it to render but might need it later. Or leave reminders for your self or other coders that might be looking at your code.</p>
<p>Special Characters. There are a few &#8220;illegal” characters to be aware of. For example I make a tag for math and the value to a human reads 9 is less than 15. But that less then sign denotes the opening of a tag. This would break in almost every case. So if you want to render the value the way humans read it, then you need to use the &#8220;correct form&#8221;. </p>
<p>For this case its ampersand l t semicolon. There are a few more to note, so take a look at my cheat sheet for which characters are &#8220;illegal” and what their &#8220;correct form” is. </p>
<p>So now that we got the basics of XML down, lets write a document that we can use to fuel our slide show. Let’s make a new XML doc and save it under the name of slideShow.xml.  Go to line 2 and open the root node and call it slideShow. Go down a few lines and close the root node. Next let’s make a child of the root called photoList, and go down a few and close it, also, let’s give it an attribute of date with a value of Sept2009. Go ahead and make one more child, but this time put it in the photolist, and call it photo. This node is going to be a self closing node. Let’s give it 2 attributes, one called path the other called desc the abriation of description. And for the value of path put images/001.jpg and for desc put Title 1. Copy and paste the photo node six times and change the 2nd node to be 002,jpg and title 2 and the 3rd node to be 003.jpg and title 3 and so on. </p>
<p>And there you have it! You just wrote the basic XML document that we are going to use in our slide show.</p>
</div>
<p class="xml-t2"><strong>Part Two &#8211; Understanding Arrays</strong></p>
<div class="xml-p2">
<p>Open up flash and make a new ActionScript 3 document. Before we can start to load the XML into Flash we need to understand what an Array is and how to use it. Unlike basic variables, arrays can hold multiple values. For example I want to make a grocery list. If I were to use string variables I would have to create a unique variable for each item. They would look something like this.<br />
<blockquote>&#8212;&#8212;&#8212;&#8212;</p></blockquote>
<p>And if I were to trace any variable I would get the value of that string in my output panel. But arrays on the other hand, you can add multiple values and access them by going to the specific index of that array.  For example, I will set up an array for groceries, fill it with multiple values and then call a specific value.</p>
<p>So here I am starting out with a var key word and giving it a name of groceries and data type it to Array. Then I equal that to a new array(). And begin to fill the array with values. Now I want to get to the first value of that array, so I trace the array with an index of 0. Be sure that the index is in square brackets.  Notice in the output panel you see the results of my trace statements.</p>
<p>Arrays start its count from zero. So if you have 3 items in your array, the third items index is 2. So that means if I wanted to get any of the values, just subtract 1 from their spot in line. Meaning item one has an index of zero, item two has an index of 1, and item three has an index of 2 and so on. </p>
<p>Moving on as you are shopping you realize that you needed two more items. You can add or subtract from an array very easily. To add to the end of an array you use the push () function. And to subtract one from the end of an array you use the pop () function. I realized that I wanted cracker and soda. So need to type groceries.push(&#8220;crackers”) I am going to trace the groceries to make sure that everything worked. Good it did. Now on the next line I am will do the same thing to add soda to my list. Again tracing groceries to make sure it works. Now that I put soda on my list I realize I don’t have the money for that and I want to take it off. So I will type groceries.pop() and trace groceries again. And there you go soda is off the list. But as I shop I pick up items from the beginning of the list. So I want to get them out of the array. This calls for a splice() function. This function is expecting 2 parameters though. The first parameter is the Starting Index (start point) and the delete count (how many you want to delete.) So I am going to start with index of 0 ( my first item) and delete 2 items. Now when I trace the groceries array I will notice that the milk and bread are now gone from the list. </p>
<p>Now there are more methods allowing you to add, remove, rearrange, and revalue, but this is more than enough for what we need right now. Also be aware that there are different types of arrays, like Multidimensional (arrays with in arrays), and Associative arrays(these store liner pairs of arrays, one is the value the other is describing the first.). But for now Liner Arrays are perfect! </p>
</div>
<p class="xml-t3"><strong>Part Three &#8211; Loading XML into Flash</strong></p>
<div class="xml-p3">
<p>Now that we understand the basics of XML and Arrays, we need to do one more thing before our slide show can come to life. We need to load the XML and sort the data so that we can work with it. Even though there are ways of writing XML in Flash the most common way to use XML is have an externally loaded document.  So let us begin!</p>
<p>First we need to set up a variable that will hold the XML data. Lets call it xmlData and data type it to XML. Now we need a URLLoader. So make a variable and call it xmlLoader data type it to URLLoader and make it a new URLLoader(). After that is set up, we need to make two functions, one will load the XML on the successful load of the xml document and the other will be IOErrorEvent, to catch a problem in the event that the XML isn’t loaded properly. So type</p>
<blockquote><p>xmlLoader.addEventListener(Event.COMPLETE, loadTheXML)</p></blockquote>
<p> and on the next line type</p>
<blockquote><p>xmlLoader.addEventListener<br/>(IOErrorEvent.IO_ERROE, xmlLoadError).</p></blockquote>
<p>			Now we can set up the xmlLoader to load in the external document. To lets type</p>
<blockquote><p>xmlLoader.load(new URLRequest(&#8220;slideshow.xml&#8221;));</p></blockquote>
<p>That sets up the basic calls for loading the document in, now we need to create the function. Lets deal with the complete function first. Type function</p>
<blockquote><p>loadTheXML(evt:Event):void(since it wont be returning any value)</p></blockquote>
<p>			and open and close curly brackets. In side that function I am going to type a trace statement just to make sure everything is going good. So type</p>
<blockquote><p>xmlData = new XML(evt.target.data)</p></blockquote>
<p> and on the next line type trace (xmlData). Before we can test this we need to make the IOError function.</p>
<p>Go out side the function for loading and go on a new line. Type out function</p>
<blockquote><p>xmlLoadError(evt:IOErroeEvent):void{	trace(&#8220;something is wrong : &#8221; + evt.text)}</p></blockquote>
<p>Now is a good time to test. Hit control enter and bam in the output window you see the xml document. Lets just see what happens when we have a problem loading the XML. For the new URLRequest add an extra letter in the slideshow.xml string. Hit control enter. And in the error message pops up in the output window. This is telling up that we have a problem and the evt.text is stating that it cant find the xml document called slideshows. So if you fix our error and save and test again, we are back to normal. And there you have it. You just loaded in XML.</p>
</div>
<p class="xml-t4" ><strong>Part Four &#8211; Working with the data</strong></p>
<div class="xml-p4">
<p>Let’s begin with setting up our viewing area. Click on the stage, go over to the properties panel and edit the stage size to 350 wide and 450 high. Make a new layer call it artArea. Grab the rectangle tool, make sure there is no stroke and draw a rectangle on stage. Grab the selection tool and select the new rectangle and in the properties panel give it a x location of 25 a y location of 0 a width of 300 and a height of 400. With that rectangle selected hit F8. This will bring up a convert to symbol dialog box. Give it a name of holder, make sure that the type is MovieClip and the registration is at the top left. Click ok, and in the properties panel, you will notice that the information changed. Let’s give this an instance name of holder. This will be where our images will be displayed.</p>
<p>Now we need to make a box to hold the description and picture count.  Grab the rectangle tool, give it a different color and draw one on the stage. Grab the selection tool and select the rectangle. Go into the properties panel and give the x a value of 25, y a value of 400, width make it 300, and height make it 40. Again with it selected hit F8. The dialog box will pop up and your previous settings should still be there just give it a name of content. Also be sure to give it an instance name of content as well. Now I am going to take a minute to make it look a little better, so feel free to spice it up. </p>
<p>If you don’t want to no big deal. Go inside of the content movie clip and call layer one bg and lock it. Make a new layer and call it text. Grab the text tool and change it to dynamic text. Draw a small rectangle text box on the left hand side. Grab the selection tool and position it over the background and give it an instance name of picNumText. Grab the type tool again and do the same thing only make it a bit bigger and give it a name of descText. And that should be it for the set up go back to the root time line and go to the actions layer and open up the actions panel.</p>
<p>Back in the actions panel we need to put the xml data into an array so go all the way to the top of the script and hit enter a couple times. And at the top lets set up a couple of arrays that will hold the pictures and descriptions. Type var picArray:Array = new Array() and on the next line type<br />
<blockquote>ar descArray:Array	 = new Array()</p></blockquote>
<p>Also type var picLength and data type it to int. Inside the loadTheXML function I will comment out the trace statement and make a new line below that. We need to set variable that will give us the length of the xml document. So type picLength = xmlData.photoList.photo.length() and on the next line trace the picLength and you should get 7. That is how many photo nodes there are in our xml document.  So close the preview. And go back to the loadTheXML function.</p>
<p>Delete the picLength trace statement. And lets begin out for loop. For right now trust that just works. I will explain that a loop is in another tutorial. Type for<br />
<blockquote>(var i:int = 0; i&lt;picLenght;i++){}</p></blockquote>
<p> inside the for loop we what to push the data of each xml node. So we start with picArray.push(xmlData because that is where all the XML information is stored.<br />
<blockquote>photoList.photo.@path[i] photoList.photo.@path[i])</p></blockquote>
<p>This is a very simple concept to understand. I am setting up a variable called I and its initial value is zero. And as long as i is less than the length of picLenght then add one to i. So the first time it runs the loop it starts at 0 and rins the coded inside. Then goes back to the top and checks to see if i is still less than picLength. It see that it is so it runs the coded again now i is equal to 1. And it continues this process until the statement i picLength is no longer true. And the reason why I put the picArray.push function in here is because I want the array to be filled with all the information in the XML. So trace the picArray out side the loop and you will see that all the paths are in that array. Now lets do the same thing with the descArray. Inside the loop type<br />
<blockquote>descArray.push xmlData.photoList.photo.@desc xmlData.photoList.photo.@desc)</p></blockquote>
<p> and trace the descArray out side the loop and again all the information is there.</p>
<p>Now we are ready to set up the coded to load the image into the holder.  Lets go back to the top and set up 2 more variables one is a loader object so under the last array type var imageLoader and data type it to Loader. And the other one is to hold the current picture number. I like to call it whoIsOn so on the next line type var whoIsOn and data type it to int and set the value to 0. </p>
<p>Back in loadTheXML function underneath the for loop type imageLoader = new Loader() to set up the loader object. On the next line we need to set up an URLRequest for the loader to have something to load. So type var mainReq:URLRequest = new URLRequest(picArray[whoIsOn]) since who  is on is set to 0 right now it will display the first image. On the next line lets load the info in so type imageLoader.load(mainReq); Now we need to set up the event listeners to load it in and error event in case something is wrong. So on the next line type<br />
<blockquote>imageLoader.contentLoaderInfo.addEventListener<br/>(Event.COMPLETE, imageLoaded) </p></blockquote>
<p> and on the next line<br />
<blockquote>imageLoader.contentLoaderInfo.addEventListener</br>(IOErrorEvent.IO_ERROR, imageProblem)</p></blockquote>
<p>Now lest go outside the function to set up the two functions we just set up to call. First type function<br />
<blockquote>imageLoaded(evt:Event):void{} </p></blockquote>
<p> and in side that function simply add the imageLoader to the holder movie clip like this,<br />
<blockquote>holder.addChild(imageLoader)</p></blockquote>
<p> . Now lets set up the error function. Type function<br />
<blockquote>imageProblem(evt:IOErrorEvent):void{}</p></blockquote>
<p> and in side simply type a trace statement that sasy &#8220;Is the image there : &#8221; + evt.text</p>
<p>Test the movie and see if it is working.. SWEET so far so good. Lets tie in the description and the photo count.  Lets go back into loadTheXML function and add a few lines to the bottom. We already add the descriptions to the array and we have a global index floating around so all we need to do is tell the text field to display that information and you do it like this.<br />
<blockquote>Content.descText.text = String(descArray[whoIsOn])</p></blockquote>
<p> and type on the next line.<br />
<blockquote>Content.picNumText.text = String((whoIsOn + 1) + &#8221; /  &#8221; + picLength)</p></blockquote>
<p> Test the movie and see if it worked.</p>
<p>We are making some progress. Lets tie in a timer that will switch the image every 5 second. First things first, we need to import the timer functionality before we can use it. So all the way at the top type import flash.utils.Timer and on the next line type<br />
<blockquote>import flash.events.TimerEvent</p></blockquote>
<p>. go down a line or two and type<br />
<blockquote>var switchTimer:Timer = new Timer(3000)</p></blockquote>
<p> this is setting the timer for use Next we need to add an even listener to do something when the time is triggered so right underneath the timer set up type<br />
<blockquote>switchTimer.addEventListener<br/>(TimerEvent.TIMER, switchImage)</p></blockquote>
<p> and start the timer. swtichTimer.start()</p>
<p>Now go all the way to the bottom and start the function for switch image type function switchImage(evt:TimerEvent):void{} and there are a few things that we want to do in here. First we want to increment the whoIsOn index by one so type whoIsOn++; Next we need to take the imageLoader and load the new info in there so the code is similar to what we did the first time but all we need it the load function. So type<br />
<blockquote>imageLoader.load(new URLRequest(picArray[whoIsOn])</p></blockquote>
<p> and test the movie to see what is going on.</p>
<p> Wait we need to tie in the descriptions next. Right under the image loader type<br />
<blockquote>content.descText.text = String(descArray[whoIsOn])</p></blockquote>
<p> and on a new line lets tie in the pic counter. Type<br />
<blockquote>content.picNumText.text = String((whoIsOn + 1) + &#8221; / ” + picLength)</p></blockquote>
<p> Test the movie to make sure that everything is working fine.</p>
<p>So far so good but it breaks after the last image. We need to set an if statement up to say go back to the beginning if there are no more images left. That simple enough, while in the switch Image function go to the top of it and type if (whoIsOn  picLenght -1) and wrap the code we already have in side those curly brackets. And at the close curly bracket type else open and close curly bracket. In side there copy the code from the if statement and paste it into the else statement the only thing we want to change is whoIsOn++. Change that to whoIsOn = 0. Test movie and see what happens.</p>
<p>One thing that I notice is that I get  a blue flash in between images. I can get rid of the if I double click on the holder movie clip and select the rectangle, go over to the properties panel and turn the alpha to zero. Test the move again and see what happens… ahh that looks better. </p>
<p>Now that we have that working lets get the cool transitions working. The first thing that we need to do is import the transitions functionality. At the top of the document right under the timer classes type import fl.transitions.* on the next line type fl.transitions.easing.* Next lets go into the imageLoaded function and add the following code. Pause the video and copy the code. Test the movie and See what we got. That does it</p>
<p>Well pixil viewers I hope my tutorial has helped you out. Be sure to get the <a href="http://pixil.info/wp-content/plugins/download-monitor/download.php?id=3">XMLSildeShow zip</a> You will get all the files we have worked on, cheat sheets, and a Tweaked out version of what we just build. Don’t worry guys I left plenty of comments! Until next time Im Jermbo</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://pixil.info/downloads/how-to-build-xml-gallery-in-action-script-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced Lighting Effects in Flash</title>
		<link>http://pixil.info/tutorials/advanced-lighting-effects-in-flash/</link>
		<comments>http://pixil.info/tutorials/advanced-lighting-effects-in-flash/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:19:10 +0000</pubDate>
		<dc:creator>Natalia Elina</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Animacat]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[lighting effects]]></category>
		<category><![CDATA[natalia elina]]></category>

		<guid isPermaLink="false">http://pixil.info/?p=231</guid>
		<description><![CDATA[Advanced Lighting Effects in Flash Natalia from animacat.net shows us how she creates advanced lighting effects in Flash. To start...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpixil.info%2Ftutorials%2Fadvanced-lighting-effects-in-flash%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpixil.info%2Ftutorials%2Fadvanced-lighting-effects-in-flash%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Advanced Lighting Effects in Flash</p>
<p>Natalia from <a href="http://www.animacat.net/" target="_blank">animacat.net</a> shows us how she creates advanced lighting effects in Flash. To start off this effect, first you need your assets. So here we have a background, which a simple photograph of this subway type ceiling, and a lamp which is a PNG with alpha channel.</p>
<p><span id="more-231"></span></p>
<p>So if we go inside this group, you can see I used the brush tool to outline the details in the background. And if we go inside graphic symbol, you can the lamp just a PNG with alpha channel, and the second layer is the outline we made with the brush tool. In this case we moved the registration in the top middle and animated it with four keyframes swinging back and forth. </p>
<p>Alright and for the lighting effect we have two layers with simple round gradients which act as the lights around the lamp. If you look closely at lamp, the gradient moves with the lamp, so try to place the keyframes in the right place to sync up the animations. So for each light object, you notice the radial gradient has several steps to make it look likes its flickering. </p>
<p>Next lighting objects are these giant circles with the same type of graident. Notice that we used zero percent alpha colors for the edges. So if we play the animation, you can see all we did was skew the shape to make it seem as tho the lights are moving along the swinging lamp! </p>
<p>Alright and for the details lets take a look at this fly. So its just a movie clip with a motion path. If we go inside the fly movie clip, you can see the animation is pretty simple, 4 frames of the wing shapes flipping up and down. So if we jump back out of to the scene you can see the fly follows the motion path.</p>
<p>Now lets test out the scene. And there you have it, a pretty simple special effect technique in flash! </p>
]]></content:encoded>
			<wfw:commentRss>http://pixil.info/tutorials/advanced-lighting-effects-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animating with ActionScript 2</title>
		<link>http://pixil.info/tutorials/animating-with-actionscript-2/</link>
		<comments>http://pixil.info/tutorials/animating-with-actionscript-2/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 23:15:07 +0000</pubDate>
		<dc:creator>Jeremy Lawson</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[jermbo]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://pixil.info/?p=133</guid>
		<description><![CDATA[Coming up on today&#8217;s epsiode: Find out how to make simple animations in Flash CS4 using Action Script 2. Right...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpixil.info%2Ftutorials%2Fanimating-with-actionscript-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpixil.info%2Ftutorials%2Fanimating-with-actionscript-2%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Coming up on today&#8217;s epsiode:</strong></p>
<p>Find out how to make simple animations in Flash CS4 using Action Script 2.</p>
<p>Right off the bat I make a new layer and I call it actions. It is always best practice to have your actions on its own layer without graphics. So I start every project off by adding an Actions layer and locking it.</p>
<p>On layer one, grab the oval tool make sure that you don’t have a stroke color and draw a circle on the screen. Hold down shift to constrain the proportions. With the object now selected lets hit the hot key F8, this is going to bring up the Convert to Symbol Dialog box.</p>
<p><span id="more-133"></span></p>
<p>Make it a movie clip and give it a name of red Ball. Now you should see a movie clip in you library called red Ball. Whatever name you give it if the library doesn’t matter. It’s the instance name that Action Script will be looking for. So select the movie clip and locate your properties panel. In this panel is where you will see a place for an instance name. Lets give it a name of ball. Now select your actions layer and press F9 to get your action panel up.</p>
<p>With our actions panel open the first thing we need to do is import what functionality we want to use. WE want tweens and easing. So go ahead and import them by typing  &#8220;import mx.transitions.Tween; import mx.transitions.easing.</p>
<p>The import of tweens is finding a folder with premade tween animation script. The same thing can be said about the easing. But notice on the easing I typed a .* this is telling action script that I want to load all of the easing types so I can use them.</p>
<p>Now that we have imported the functionality we can begin animating. To declare a new tween you need to type out new tween open and close (). In side the () flash is expecting 7 parameters.</p>
<ul>
<li>The object that you are wanting to target</li>
<li>What property you want to effect.</li>
<li>Tween type and easing type.</li>
<li>Starting location or starting percentage</li>
<li>Ending location or ending percentage</li>
<li>Duration</li>
<li>True if you want the duration to last in seconds or False if you want the duration to last in frame</li>
</ul>
<p>So lests tackle it. The first parameter is what object I want to effect so I am going to put ball comma. Next is the property, note you have to put this one in quotes, so I want the ball to fall down so quote underscore y quote comma. Here comes the tween and easing type, there are several types of tweens and easing we will cover only one, don’t worry  I made a cheat sheet that you can take and reference for all the types, I want it to bounce and have a bit of ease out. If this part didn’t turn blue then you spelled something wrong, this part is very case sensitive.</p>
<p>Next I want to start the balls position from zero. This number will take the ball from where ever it is at and place it at the y coordinate of zero. If you wanted it to start from where it is on the stage then simply type ball._y here. This says were ever the ball is start here. Next is the ending location. Since I used a numeric value in the previos one I will add a numeric value to this one. But lets say I want it to move 200 pixils from where it is at simply type ball._y + 200.</p>
<p>The last two are important to each other , if the last parameter is false then the number will represent a duration in frames. But if the last one is true then the previous number is take place over seconds. So lets add 2 comma true. This says take 2 seconds to play out.Go ahead and test movie and see what happens. You just made action script animate your ball. Don’t forget to grab my cheat sheets and source file at <a href="http://jermbo.com/" target="_blank">Jermbo.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pixil.info/tutorials/animating-with-actionscript-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create 3D Objects in Flash CS4</title>
		<link>http://pixil.info/downloads/create-3d-box-in-flash-cs4/</link>
		<comments>http://pixil.info/downloads/create-3d-box-in-flash-cs4/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 18:26:07 +0000</pubDate>
		<dc:creator>Noe Ruiz</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[ecken]]></category>
		<category><![CDATA[noe ruiz]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://pixil.info/?p=115</guid>
		<description><![CDATA[Coming up on today&#8217;s epsiode: How to create a 3D Box and animate it using the new 3D Tools and...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpixil.info%2Fdownloads%2Fcreate-3d-box-in-flash-cs4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpixil.info%2Fdownloads%2Fcreate-3d-box-in-flash-cs4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Coming up on today&#8217;s epsiode:</strong></p>
<p>How to create a 3D Box and animate it using the new 3D Tools and Features in Flash CS4.</p>
<p><strong>Step 1: Create a square shape</strong></p>
<p>Start by drawing out simple square. Hold down the shift key to constrain the proportions. Now lets change the solid fill to a gradient by going the color palette, and lets change the type to a Linear gradient. Next lets remove the stroke, just goto the stroke color picker and choose the None option.</p>
<p><span id="more-115"></span></p>
<p>Now lets make sure our square is in the center of the stage, we can do that by going to the align panel and click on the horizontal and vertical align buttons.</p>
<p><strong>Step 2: Position &amp; Convert into a Movie Clip</strong></p>
<p>Okay next lets convert this shape into a movie clip, just right click and select Convert to Symbol&#8230; alright now lets nest this symbol inside another movie clip, and lets name this one 3D Box. So inside the 3D box movie clip is where we&#8217;ll be setting up the 3D layers.</p>
<p><strong>Step 3: Duplicate Layers for Each Box Side</strong></p>
<p>Alright so now we can just copy and paste a few of these squares on some new layers. And lets name each copy after a side of the 3D Box such as top, bottom, left and right.</p>
<p><strong>Step 4: Rotate Each Side 90&ordm; &amp; Position in Place</strong></p>
<p>Now lets convert all the frames into motion tweens by selecting them, right clicking and Create Motion Tween. Now lets start with the top layer and rotate the X axis 90 degrees. You can hold down the shift key to constrained your rotation. Next we can go inside the motion editor to ensure our rotation was a either a positive value, or a negative one. Just to make sure everything is set the name.</p>
<p>Now we&#8217;ll want to move this top layer up about half of the way. So just calculate half  the height of the square and move it up so it sets on top. I like to use the 3D Position and View Panel to do this because you can easily change the values there.</p>
<p>Now lets repeat this process for the bottom layer. But this time we&#8217;ll want move the half way down, so again just change the value in the 3D Position and View Panel. Alright so next lets start on the left and right squares. Starting with left, lets rotate the Y axis  90 degrees and shift it over to the left about half of the width of the square. Again we can go inside the motion edition to check our values. Alright now we can repeat the same process for the right square, but don&#8217;t forget to move it to the right side instead of the left!</p>
<p><strong>Step 5: Test 3D Box Rotation</strong></p>
<p>So once we finish all rotating and positioning, we should be left with a picture frame looking set of rectangles. So lets jump out of the movie clip and goto scene 1. Now lets select our 3D rotation tool and watch as I rotate the box on its Y axis. Pretty sweet huh?</p>
<p>Step 6: Add Drop Shadow</p>
<p>Lets select our bottom layer, and lets goto the filters section in the properties panel and licks pick drop shadow. Lets change the blur X and Y values to something big like 100 pixels, change the quality to high, and distance to 0.</p>
<p><strong>Step 7: Animate 3D Box Rotating</strong></p>
<p>So now lets jump out to our main timeline and lets add a few move frames. Now Ill be using the motion editor to animate the 3D Box and have spin on it Y axis. So lets convert it the frames into a motion tween by right clicking on the frame bar and selecting convert to motion tween. Now we can scrub over to the last frame and then goto the motion editor. So if we want to just rotate the box spinning from left to right, we can simply change the Rotation Y  value to 360 degrees.</p>
<p>Test out the animation by pressing cmd+renturn (cntrl+return on PC).</p>
]]></content:encoded>
			<wfw:commentRss>http://pixil.info/downloads/create-3d-box-in-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
