<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6823551224638477693</id><updated>2011-11-15T13:39:42.360+05:30</updated><category term='native process'/><category term='APEOut'/><category term='flex builder 3'/><category term='nochump'/><category term='air'/><category term='alivepdf'/><category term='3d'/><category term='drawTriangles'/><category term='3d library'/><category term='as3'/><category term='alchemy'/><category term='Away3D'/><category term='flex'/><category term='mxml'/><category term='APE'/><category term='hello world'/><category term='fxg'/><category term='pixel blender'/><category term='flex 4'/><category term='gamedev'/><category term='flash catalyst'/><category term='simple3d'/><category term='fp10'/><category term='conduit'/><category term='spell check'/><category term='flash builder 4'/><category term='squiggly'/><category term='physics'/><category term='flash cs4'/><category term='asdoc'/><title type='text'>Pradeek's Weblog</title><subtitle type='html'>My personal blog with experiments in Flash,Flex and AIR.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-8562559838841082482</id><published>2010-01-16T12:13:00.012+05:30</published><updated>2010-01-16T13:44:00.433+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='native process'/><category scheme='http://www.blogger.com/atom/ns#' term='air'/><title type='text'>Invoking the Flex Compiler via Native Process API in AIR 2.0</title><content type='html'>AIR 2.0 comes with the ability to interact with native processes. This means we can launch a process from the AIR application and communicate with its standard input/output. However, applications using the native process api must be packaged into native installer. Therefore, you must compile it separately in Windows, Mac and Linux to get 3 files as compared with 1 AIR file for all platforms.&lt;br /&gt;&lt;br /&gt;Working the Native Process API is fairly easy. All the operations are performed using the NativeProcess class. To start a native process, you have to call the start method. The parameter passed to the start method is of type NativeProcessStartupInfo. This basically is used to represent the location of the process to be started and also to specify arguments(if any) for the process. I've created a very simple application which uses the Flex compiler (mxmlc) to compile an application.&lt;br /&gt;&lt;br /&gt;First off, according to the &lt;a href="http://labs.adobe.com/wiki/index.php/AIR_2:Developer_FAQ#How_do_I_launch_.bat_files_using_the_native_process_API_in_AIR2.3F"&gt;Developer FAQ at Adobe Labs&lt;/a&gt; , bat files cannot be directly launched.  Instead we launch the command prompt and then pass the command as input. Once a native process has started, we can write to its input and read from its output by using the standardInput and standardOutput objects. Here is a little screenshot of the application :&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HMQtjr1xxOw/S1Fvq8OKETI/AAAAAAAAACM/IL1PCiPg81M/s1600-h/flexcompilertest.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 258px;" src="http://1.bp.blogspot.com/_HMQtjr1xxOw/S1Fvq8OKETI/AAAAAAAAACM/IL1PCiPg81M/s320/flexcompilertest.png" alt="" id="BLOGGER_PHOTO_ID_5427241809468854578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We get the location of the Flex SDK directory, the main application file and the output file. When the compile button is clicked, we create a compilation command using the three data (eg : &lt;path&gt;/bin/mxmlc &lt;path&gt;/app.mxml &lt;path&gt;/app.swf) and execute the command. When the output is received, we use the file.openWithDefaultApplication() property to run the SWF file.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;While running the application from the native installer, the command prompt also opens up beside it (which does not occur when you run from within Flash Builder).&lt;br /&gt;Also note that this example assumes your application file has no errors. This is just a proof-of-concept to show how easy it is to build an application like this.&lt;br /&gt;&lt;br /&gt;Resources :&lt;br /&gt;&lt;a href="http://labs.adobe.com/technologies/air2/"&gt;AIR 2 (Adobe Labs)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html"&gt;Interacting with a native process (Adobe AIR Developer Center)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here are the source files for the application :&lt;br /&gt;&lt;a href="http://dl.dropbox.com/u/1088914/FlexCompilerTest.fxp"&gt;The FXP file&lt;/a&gt;&lt;a href="http://dl.dropbox.com/u/1088914/FlexCompilerTest.exe"&gt;&lt;br /&gt;The compiled native installer .exe file (Windows only)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are still concerns about updating applications using native installers as the update framework will not work with this. I'm definitely looking forward to more cool demos from the community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-8562559838841082482?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/8562559838841082482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2010/01/invoking-flex-compiler-via-native.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8562559838841082482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8562559838841082482'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2010/01/invoking-flex-compiler-via-native.html' title='Invoking the Flex Compiler via Native Process API in AIR 2.0'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_HMQtjr1xxOw/S1Fvq8OKETI/AAAAAAAAACM/IL1PCiPg81M/s72-c/flexcompilertest.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-8468361868661574997</id><published>2009-09-22T18:19:00.002+05:30</published><updated>2009-09-22T18:20:35.351+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='spell check'/><category scheme='http://www.blogger.com/atom/ns#' term='squiggly'/><title type='text'>Squiggly - Spell Check Engine Example</title><content type='html'>We've been waiting for a spell check engine in Flash for a long time. Now, Adobe has released &lt;a href="http://labs.adobe.com/technologies/squiggly/"&gt;Squiggly&lt;/a&gt;. From Adobe Labs :&lt;br /&gt;&lt;blockquote&gt;Squiggly is a spell checking engine for &lt;a href="http://www.adobe.com/products/flashplayer/" target="_blank"&gt;Adobe® Flash® Player&lt;/a&gt; and &lt;a href="http://www.adobe.com/products/air/" target="_blank"&gt;Adobe AIR®&lt;/a&gt;.  The Squiggly library allows you to easily add spell checking functionality in any Flex 3 based text control.&lt;br /&gt;While the included UI class requires the Flex SDK, the core spell checking engine can be used in pure Flash applications without any dependency on Flex packages.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Currently, only English dictionary is available but you can create your own dictionaries with a bundled AIR app.&lt;br /&gt;&lt;br /&gt;The 3 main classes we'll be using are SpellChecker, SpellingDictionary and SpellUI all of which belong to the com.adobe.linguistics.spelling. package. There are several sub packages but they need not be used directly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;Usage : &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If we are using the Flex SDK, then we can use the SpellUI class to spell check any Flex component like ,&lt;br /&gt;&lt;blockquote&gt;SpellUI.enableSpelling(textArea, "usa.zwl");&lt;br /&gt;&lt;/blockquote&gt;where usa.zwl is the dictionary file.&lt;br /&gt;&lt;br /&gt;However, if you are not using the Flex SDK, then the SpellUI class cannot be used. In that case, we can use the SpellChecker class directly to perform spell checking. &lt;a href="http://dl.getdropbox.com/u/1088914/Main.as"&gt;Here's a sample demo class&lt;/a&gt; i've put together.&lt;br /&gt;&lt;br /&gt;Hope that's useful for anyone. Happy coding :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-8468361868661574997?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8468361868661574997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8468361868661574997'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/09/squiggly-spell-check-engine-example_22.html' title='Squiggly - Spell Check Engine Example'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-7174442249930064891</id><published>2009-08-16T08:13:00.017+05:30</published><updated>2009-08-16T14:49:07.542+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='APEOut'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><title type='text'>Creating a game with APE - APEOut - Part 3</title><content type='html'>In the third and final part of this tutorial, we'll finish off this game by adding collision detection and scoring.Before we start, make sure you've read the first and the second part of this series. So, lets get to it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding collision detection : &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In order to add collision detection, we'll need to add an Event listener to the ball. After the ball defnition, add the following code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;ball.addEventListener(CollisionEvent.COLLIDE, onCollision);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, we have to code what happens if a collision occurs. Create the onCollision event handler as follows :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;private function onCollision(e:CollisionEvent):void&lt;br /&gt;{&lt;br /&gt;  var collidingItem:* = e.collidingItem;&lt;br /&gt;       &lt;br /&gt;  if (collidingItem != topWall &amp;amp;&amp;amp; collidingItem != bat &amp;amp;&amp;amp;&lt;br /&gt;    collidingItem != leftWall &amp;amp;&amp;amp; collidingItem != rightWall)&lt;br /&gt;  {&lt;br /&gt;      --brickCount;&lt;br /&gt;      group.removeParticle(collidingItem);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here the collidingItem will refer to the object that comes in contact with the ball. Now, we have to remove the object if it is a brick or do nothing if its the bat or the walls. So, we check if the collidingItem is not one of the walls or the bat, then we remove it from the group and reduce the brickCount.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Finishing up the game : &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, run the game, our bat is moving with the mouse, the ball is bouncing and destroying the bricks that it comes in contact with. Everything is working as it is supposed to. But every good game needs scores, right, so declare a score variable as a Number and a TextField to display the score.We also need a Boolean variable to see if the game is over or not. Here's the final full code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import flash.events.Event;&lt;br /&gt; import flash.text.TextField;&lt;br /&gt; &lt;br /&gt; import org.cove.ape.APEngine;&lt;br /&gt; import org.cove.ape.CircleParticle;&lt;br /&gt; import org.cove.ape.CollisionEvent;&lt;br /&gt; import org.cove.ape.Group;&lt;br /&gt; import org.cove.ape.RectangleParticle;&lt;br /&gt; import org.cove.ape.VectorForce;&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * APEOut - A Breakout clone using the ActionScript Physics Engine (APE)&lt;br /&gt;  * @author Pradeek&lt;br /&gt;  */&lt;br /&gt; &lt;br /&gt; [SWF(width = 600, height = 400)]&lt;br /&gt; public class APEOut extends Sprite&lt;br /&gt; {&lt;br /&gt;  private var group:Group;&lt;br /&gt;  private var leftWall:RectangleParticle;&lt;br /&gt;  private var rightWall:RectangleParticle;&lt;br /&gt;  private var topWall:RectangleParticle;&lt;br /&gt;  private var bat:RectangleParticle;&lt;br /&gt;  private var ball:CircleParticle;&lt;br /&gt;  private var brickCount:Number;&lt;br /&gt;  &lt;br /&gt;  private var score:Number;&lt;br /&gt;  private var scoreText:TextField;&lt;br /&gt;  private var gameOver:Boolean;&lt;br /&gt;  &lt;br /&gt;  public function APEOut():void&lt;br /&gt;  { &lt;br /&gt;   initAPE();&lt;br /&gt;   initObjects();&lt;br /&gt;   addEventListener(Event.ENTER_FRAME, onEnterFrame);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initAPE():void&lt;br /&gt;  {&lt;br /&gt;   APEngine.init();&lt;br /&gt;   APEngine.container = this;&lt;br /&gt;   APEngine.addForce(new VectorForce(false, 0, 4));&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initObjects():void&lt;br /&gt;  {&lt;br /&gt;   gameOver = false;&lt;br /&gt;   &lt;br /&gt;   score = 0;&lt;br /&gt;   scoreText = new TextField();&lt;br /&gt;   scoreText.x = 400;&lt;br /&gt;   scoreText.y = 25;&lt;br /&gt;   addChild(scoreText);&lt;br /&gt;   &lt;br /&gt;   group = new Group(true);&lt;br /&gt;   &lt;br /&gt;   leftWall = new RectangleParticle( -10, 0, 10, 1000, 0, true, 1, 0.3, 1);&lt;br /&gt;   rightWall = new RectangleParticle(610, 0, 10, 1000, 0, true, 1, 0.3, 1);&lt;br /&gt;   topWall = new RectangleParticle(0, -10, 1200, 10, 0, true, 1, 0.3, 1);&lt;br /&gt;   &lt;br /&gt;   bat = new RectangleParticle(250, 325, 125, 10, 0, true, 1, 0.50, 1);&lt;br /&gt;   bat.alwaysRepaint = true;&lt;br /&gt;   bat.setFill(0x0000FF);&lt;br /&gt;   &lt;br /&gt;   ball = new CircleParticle(220, 225, 15, false, 1, 0.65, 1);&lt;br /&gt;   ball.setFill(0xFF0000);&lt;br /&gt;   ball.addEventListener(CollisionEvent.COLLIDE, onCollision);&lt;br /&gt;   &lt;br /&gt;   var rows:int = 5;&lt;br /&gt;   var cols:int = 8;&lt;br /&gt;   &lt;br /&gt;   brickCount = rows * cols;&lt;br /&gt;   &lt;br /&gt;   var currentX:Number = 100;&lt;br /&gt;   var currentY:Number = 100;&lt;br /&gt;   &lt;br /&gt;   var brickWidth:Number = 50;&lt;br /&gt;   var brickHeight:Number = 10;&lt;br /&gt;   &lt;br /&gt;   for (var i:uint = 0; i &lt; uint =" 0;" rectangleparticle =" new" currentx =" 100;" px =" mouseX;" text = "Score : "&gt; 400)&lt;br /&gt;   {&lt;br /&gt;    gameOver = true;&lt;br /&gt;    group.removeParticle(ball);&lt;br /&gt;    scoreText.text = "Game Over. \nYou lose. \nFinal Score : " + score.toString();&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   if (brickCount == 0)&lt;br /&gt;   {&lt;br /&gt;    gameOver = true;&lt;br /&gt;    group.removeParticle(ball);&lt;br /&gt;    scoreText.text = "Game Over. \nYou win. \nFinal Score : " + score.toString();&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Hope the series was a bit useful to you. If you have any questions or suggestions, please drop a comment. Thanks for reading :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-7174442249930064891?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/7174442249930064891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7174442249930064891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7174442249930064891'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-3.html' title='Creating a game with APE - APEOut - Part 3'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-5144130500213203977</id><published>2009-08-16T07:48:00.012+05:30</published><updated>2009-08-16T08:12:39.331+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='APEOut'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><title type='text'>Creating a game with APE - APEOut - Part 2</title><content type='html'>In part 2 of this tutorial, we're going to add the bricks and add motion for the bat. Make sure you've read the &lt;a href="http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-1.html"&gt;first part of this tutorial&lt;/a&gt; and lets get going. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Creating the bricks :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add the following code to the initObjects method after creating the ball.Also create a private variable brickCount for the number of bricks in the stage.&lt;br /&gt;&lt;pre name="code" class="java"&gt;var rows:int = 5;&lt;br /&gt;var cols:int = 8;&lt;br /&gt;&lt;br /&gt;brickCount = rows * cols;&lt;br /&gt;&lt;br /&gt;var currentX:Number = 100;&lt;br /&gt;var currentY:Number = 100;&lt;br /&gt;&lt;br /&gt;var brickWidth:Number = 50;&lt;br /&gt;var brickHeight:Number = 10;&lt;br /&gt;&lt;br /&gt;for (var i:uint = 0; i &lt; rows; i++)&lt;br /&gt;{&lt;br /&gt;for (var j:uint = 0; j &lt; cols; j++)&lt;br /&gt;{&lt;br /&gt;var brick:RectangleParticle = new RectangleParticle(currentX, currentY, rickWidth, brickHeight, 0, true, 1, 0.3, 1);&lt;br /&gt;brick.setFill(Math.random() * 0xFFFFFF);&lt;br /&gt;group.addParticle(brick);&lt;br /&gt;currentX += brickWidth + 5;&lt;br /&gt;}&lt;br /&gt;currentX = 100;&lt;br /&gt;currentY += brickHeight + 5;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;What we're doing here is simply creating a brick at the position (currentX,currentY) and incrementing with the brickWidth and a gap value. We also set a random color for the bricks.Run the file. You'll see a ball bouncing on the bat and about 40 bricks lined up in 5 rows. When the ball collides with the brick, it just bounces off.&lt;span style="font-weight:bold;"&gt;Moving the bat :&lt;/span&gt;To move the bat just add the line &lt;pre name="code" class="java"&gt;bat.px = mouseX;&lt;br /&gt;&lt;/pre&gt;before the APEngine.step() call in the onEnterFrame event handler.If you run the game now, you'll see that the image of the bat doesn't move but if you move your mouse, the ball will fall down.So, add the following line under the bat defnition.&lt;pre name="code" class="java"&gt;bat.alwaysRepaint = true;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, it looks something like a game. We have the bat, the ball and the bricks. All we need is to add collision detection and scores. We'll do that in the next post.&lt;br /&gt;Stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-5144130500213203977?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/5144130500213203977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5144130500213203977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5144130500213203977'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-2.html' title='Creating a game with APE - APEOut - Part 2'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-5093241733778124292</id><published>2009-08-15T19:45:00.034+05:30</published><updated>2009-08-15T21:37:37.821+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='gamedev'/><category scheme='http://www.blogger.com/atom/ns#' term='APEOut'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><title type='text'>Creating a game with APE - APEOut -  Part 1</title><content type='html'>Following up on &lt;a href="http://pradeek.blogspot.com/2009/08/getting-started-with-physics-in-as3-ape.html"&gt;my introductory blog post on APE&lt;/a&gt;, Today we are going to create a simple Breakout clone with APE. I'm going to call this APEOut having just 1 level. I'll split this tutorial into 3 parts. In the first part, we'll create a bat, ball and the boundaries. In the second part, we'll create the bricks and add movement for the bat. In the third part, we'll add collision detection and scores.&lt;br /&gt;So, lets get started.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package &lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import flash.events.Event;&lt;br /&gt; &lt;br /&gt; import org.cove.ape.APEngine;&lt;br /&gt; import org.cove.ape.Group;&lt;br /&gt; import org.cove.ape.VectorForce;&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * APEOut - A Breakout clone using the ActionScript Physics Engine&lt;br /&gt;  * @author Pradeek&lt;br /&gt;  */&lt;br /&gt; &lt;br /&gt; [SWF(width = 600, height = 400)]&lt;br /&gt; public class APEOut extends Sprite &lt;br /&gt; {&lt;br /&gt;  private var group:Group;&lt;br /&gt;  &lt;br /&gt;  public function APEOut():void &lt;br /&gt;  { &lt;br /&gt;   initAPE();&lt;br /&gt;   initObjects();&lt;br /&gt;   addEventListener(Event.ENTER_FRAME, onEnterFrame);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initAPE():void&lt;br /&gt;  {&lt;br /&gt;   APEngine.init();&lt;br /&gt;   APEngine.container = this;&lt;br /&gt;   APEngine.addForce(new VectorForce(false, 0, 4));&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initObjects():void&lt;br /&gt;  {&lt;br /&gt;   group = new Group(true);&lt;br /&gt;   APEngine.addGroup(group);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function onEnterFrame(e:Event):void &lt;br /&gt;  { &lt;br /&gt;   APEngine.step();&lt;br /&gt;   APEngine.paint();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The above code is similar to the one we wrote in the last post. Basically, we're setting up the engine,  creating a group and updating and drawing on the ENTER_FRAME event. Next, we create the 3 boundaries - top, left and right and the bat and the ball. Create objects of the RectangleParticle class for topWall, leftWall , rightWall and bat and the CircleParticle class for the ball. Modify the initObjects method as follows :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;private function initObjects():void&lt;br /&gt;{&lt;br /&gt; group = new Group(true);&lt;br /&gt;   &lt;br /&gt; leftWall = new RectangleParticle( -10, 0, 10, 1000, 0, true, 1, 0.3, 1);&lt;br /&gt; rightWall = new RectangleParticle(610, 0, 10, 1000, 0, true, 1, 0.3, 1);&lt;br /&gt; topWall = new RectangleParticle(0, -10, 1200, 10, 0, true, 1, 0.3, 1);&lt;br /&gt; &lt;br /&gt; bat = new RectangleParticle(250, 325, 125, 10, 0, true, 1, 0.50, 1);&lt;br /&gt; bat.setFill(0x0000FF); &lt;br /&gt;   &lt;br /&gt; ball = new CircleParticle(220, 225, 15, false, 1, 0.65, 1);&lt;br /&gt; ball.setFill(0xFF0000); &lt;br /&gt;   &lt;br /&gt; group.addParticle(leftWall);&lt;br /&gt; group.addParticle(rightWall);&lt;br /&gt; group.addParticle(topWall);&lt;br /&gt;  &lt;br /&gt; group.addParticle(bat);&lt;br /&gt;   &lt;br /&gt; group.addParticle(ball);&lt;br /&gt;   &lt;br /&gt; APEngine.addGroup(group);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A little code explanation : &lt;br /&gt;We position three rectangular blocks on the top, left and the right sides. Since they are walls, we're hiding them. We create a bat and a ball and position them appropriately. &lt;br /&gt;Try to run this. You should see the ball bouncing on the bat. If you wait a bit, you'll see that it hits the top and bounces back. &lt;br /&gt;The next step is creating the bricks and making the bat move. We'll do that in the next post. If you have any questions, please post it in the comments. Thanks for reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-5093241733778124292?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/5093241733778124292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5093241733778124292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5093241733778124292'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/08/creating-game-with-ape-apeout-part-1.html' title='Creating a game with APE - APEOut -  Part 1'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-4569046856470261721</id><published>2009-08-14T19:11:00.005+05:30</published><updated>2009-08-15T09:33:43.976+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><title type='text'>Getting started with Physics in AS3 : APE Tutorial</title><content type='html'>Today, we're going to see a very simple tutorial for using the &lt;a href="http://www.cove.org/ape/"&gt;Actionscript Physics Engine&lt;/a&gt; (APE). There are several Physics engines in the AS3 but APE is probably the easiest to use. So, download the library via SVN &lt;a href="http://ape.googlecode.com/svn/trunk/"&gt;here&lt;/a&gt; and lets get started.&lt;br /&gt;Here is the code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import flash.events.Event;&lt;br /&gt;&lt;br /&gt; import org.cove.ape.APEngine;&lt;br /&gt; import org.cove.ape.CircleParticle;&lt;br /&gt; import org.cove.ape.Group;&lt;br /&gt; import org.cove.ape.RectangleParticle;&lt;br /&gt; import org.cove.ape.VectorForce;&lt;br /&gt; &lt;br /&gt; [SWF(width = 600, height = 400, backgroundColor='0x000000')]&lt;br /&gt; public class APExample Sprite&lt;br /&gt; {&lt;br /&gt;     public function APExample():void&lt;br /&gt;     {&lt;br /&gt;         initAPE();&lt;br /&gt;     &lt;br /&gt;         initObjects();&lt;br /&gt;     &lt;br /&gt;         addEventListener(Event.ENTER_FRAME, onEnterFrame);&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     private function initAPE():void&lt;br /&gt;     {&lt;br /&gt;         // Initialize APE&lt;br /&gt;         APEngine.init();&lt;br /&gt;     &lt;br /&gt;         // Set the container for APE&lt;br /&gt;         APEngine.container = this;&lt;br /&gt;     &lt;br /&gt;         // Add gravity&lt;br /&gt;         APEngine.addForce(new VectorForce(false, 0, 2));&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     private function initObjects():void&lt;br /&gt;     {&lt;br /&gt;         // Create a group to hold all the objects with collision&lt;br /&gt;         var group:Group = new Group(true);&lt;br /&gt;     &lt;br /&gt;         // Create a rectangle for rhe floor&lt;br /&gt;         var floor:RectangleParticle = new RectangleParticle(0, 400, 1200, 25, 0, true);&lt;br /&gt;     &lt;br /&gt;         // Create a circle&lt;br /&gt;         var circle:CircleParticle = new CircleParticle(225, -100, 25);&lt;br /&gt;     &lt;br /&gt;         // Add the floor to the group&lt;br /&gt;         group.addParticle(floor);&lt;br /&gt;     &lt;br /&gt;         // Add the circle to the group&lt;br /&gt;         group.addParticle(circle);&lt;br /&gt;     &lt;br /&gt;         // Add the group to the engine&lt;br /&gt;         APEngine.addGroup(group);&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     private function onEnterFrame(e:Event):void&lt;br /&gt;     {&lt;br /&gt;         // Update and Draw&lt;br /&gt;         APEngine.step();&lt;br /&gt;         APEngine.paint();&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Compile and run. You should see a white rectangle at the bottom as the "floor" and the ball will fall down. Experiment a little bit by chaanging the gravity value for some interesting results. For example, you could set a positive value for x which would make the ball move sideways. But still, one ball falling down and bouncing isn't much of an example. In the coming tutorials, we'll be developing a simple game using APE. Stay tuned. :D&lt;br /&gt;&lt;br /&gt;UPDATE : Certain compiler errors occur (changes in several classes) if you are using the given download link in the APE homepage. The one i am using here is from svn.&lt;br /&gt;I've also uploaded the project with the APE files for those without SVN. You can download it &lt;a href="http://dl.getdropbox.com/u/1088914/APE.zip"&gt;here&lt;/a&gt;. Sorry for the mmistake.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-4569046856470261721?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/4569046856470261721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/08/getting-started-with-physics-in-as3-ape.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4569046856470261721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4569046856470261721'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/08/getting-started-with-physics-in-as3-ape.html' title='Getting started with Physics in AS3 : APE Tutorial'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-812578903757825059</id><published>2009-08-03T19:11:00.009+05:30</published><updated>2009-08-15T09:34:20.460+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='3d'/><category scheme='http://www.blogger.com/atom/ns#' term='Away3D'/><title type='text'>Getting started with Away3D</title><content type='html'>Today, I decided to play with Away3D and immediately found it to be much better than Papervision. Comparatively, Away3D is much faster than Papervision ( implementation of FP10 features ). So, here is a simple tutorial to get you up and going with Away3D.&lt;br /&gt;                 In this tutorial, I'll be using Flex Builder to create an ActionScript project. I'm naming it Away3DTest. Now download the latest Away3D build from &lt;a href="http://away3d.com/downloads"&gt;here&lt;/a&gt;. Extract the source to the src folder and type in the following code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt; import away3d.cameras.Camera3D;&lt;br /&gt; import away3d.containers.Scene3D;&lt;br /&gt; import away3d.containers.View3D;&lt;br /&gt; import away3d.core.math.Number3D;&lt;br /&gt; import away3d.core.render.Renderer;&lt;br /&gt; import away3d.materials.BitmapMaterial;&lt;br /&gt; import away3d.primitives.Cube;&lt;br /&gt; &lt;br /&gt; import flash.display.Bitmap;&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import flash.events.Event;&lt;br /&gt; &lt;br /&gt; [SWF( backgroundColor = '0x000000')]&lt;br /&gt; public class Away3DTest extends Sprite&lt;br /&gt; {&lt;br /&gt;  [Embed(source='texture.jpg')]&lt;br /&gt;  private var Texture:Class;&lt;br /&gt;  &lt;br /&gt;  private var scene:Scene3D;&lt;br /&gt;  private var camera:Camera3D;&lt;br /&gt;  private var view:View3D;&lt;br /&gt;  &lt;br /&gt;  private var cube:Cube; &lt;br /&gt;&lt;br /&gt;  public function Away3DTest()&lt;br /&gt;  {&lt;br /&gt;   initAway3D();&lt;br /&gt;   initObjects();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initAway3D():void&lt;br /&gt;  {&lt;br /&gt;   camera = new Camera3D();&lt;br /&gt;   camera.x = 100;&lt;br /&gt;   camera.y = 100;&lt;br /&gt;   camera.z = -1000;&lt;br /&gt;   camera.lookAt( new Number3D() );&lt;br /&gt;   &lt;br /&gt;   scene = new Scene3D();&lt;br /&gt;   &lt;br /&gt;   view = new View3D();&lt;br /&gt;   view.x = 200;&lt;br /&gt;   view.y = 200;&lt;br /&gt;   view.scene = scene;&lt;br /&gt;   view.camera = camera;&lt;br /&gt;   view.renderer = Renderer.BASIC;&lt;br /&gt;   addChild(view);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function initObjects():void&lt;br /&gt;  {&lt;br /&gt;   cube = new Cube();&lt;br /&gt;   cube.material = new BitmapMaterial(Bitmap(new Texture()).bitmapData);&lt;br /&gt;   scene.addChild(cube);&lt;br /&gt;   &lt;br /&gt;   addEventListener(Event.ENTER_FRAME, onEnterFrame);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function onEnterFrame(e:Event):void&lt;br /&gt;  {&lt;br /&gt;   cube.rotationX += 1;&lt;br /&gt;   cube.rotationY += 1;&lt;br /&gt;   cube.rotationZ += 1;&lt;br /&gt;   &lt;br /&gt;   view.render();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here I assume you have a file named texture.jpg in your source directory.Now an explanation of the code :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;We create variables for the View3D, Camera3D and the Scene3D class and assign the scene and the camera variable to the view variable. This is setting up the Away3D engine and is written as a seperate function initAway3D()&lt;/li&gt;&lt;li&gt;We create a cube and create a new BitmapMaterial for it using the embedded texture.&lt;/li&gt;&lt;li&gt;We create an ENTER_FRAME event listener which does the rendering using the view.render() method. Meanwhile we'll also rotate the cube on all 3 axes.&lt;/li&gt;&lt;li&gt;Save and run you should get a cube with the texture rotating on all the axes.&lt;/li&gt;&lt;/ol&gt;Hope that was useful to anyone starting Away3D. Happy coding. :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-812578903757825059?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/812578903757825059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/08/getting-started-with-away3d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/812578903757825059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/812578903757825059'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/08/getting-started-with-away3d.html' title='Getting started with Away3D'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-8829842386844904596</id><published>2009-06-08T20:27:00.004+05:30</published><updated>2009-07-26T10:49:46.419+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='alchemy'/><title type='text'>Alchemy Tutorial : Sending data to Alchemy and back</title><content type='html'>Following up on my previous post on &lt;a href="http://pradeek.blogspot.com/2009/06/getting-started-with-alchemy-hello.html"&gt;getting started with Alchemy&lt;/a&gt;, today, we're going to see how to send a variable from Flex to a C method as arguments. In this example, we're just going to pass an integer from Flex to a C function which will return the square of the integer value. Ok, lets get to the code.&lt;br /&gt;The C code : square.c&lt;br /&gt;&lt;pre name="code" class="c++"&gt;&lt;br /&gt;#include "AS3.h"&lt;br /&gt;&lt;br /&gt;static AS3_Val sqre( void* self, AS3_Val num )&lt;br /&gt;{&lt;br /&gt; int a;&lt;br /&gt; a = AS3_IntValue(num);&lt;br /&gt; int square = a*a;&lt;br /&gt; return AS3_Int(square);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; AS3_Val cMethod  = AS3_Function( NULL, sqre );&lt;br /&gt; AS3_Val result = AS3_Object( "sqre : AS3ValType" , cMethod);&lt;br /&gt; AS3_Release( cMethod );&lt;br /&gt; AS3_LibInit( result );&lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: left;"&gt;As you can see, the main function is still pretty much the same. When passing arguments to a C method, that method should always return an AS3_Val object and always accept a pointer in addition to the other parameter.The rest of the code is very simple.&lt;br /&gt;Compile the C code into a swc using &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;gcc square.c -O3 -Wall -swc -o square.swc&lt;/span&gt;&lt;br /&gt;Now, we create an ActionScript project in Flex and import the swc. Type the following code :&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package {&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; import cmodule.square.CLibInit;&lt;br /&gt;&lt;br /&gt; public class Squaring extends Sprite&lt;br /&gt; {&lt;br /&gt;  public function Squaring()&lt;br /&gt;  {&lt;br /&gt;      var loader:CLibInit = new CLibInit; &lt;br /&gt;      var lib:Object = loader.init(); &lt;br /&gt;         trace(lib.sqre(5));//Output : 25   &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now save and debug. You should get the output as 25. Now that we know how to send and receive data from Alchemy and Flex, we can move on to some real world applications.Hope this post was useful. Happy experimenting :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-8829842386844904596?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/8829842386844904596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/06/alchemy-tutorial-sending-data-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8829842386844904596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8829842386844904596'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/06/alchemy-tutorial-sending-data-to.html' title='Alchemy Tutorial : Sending data to Alchemy and back'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-4711946043224775660</id><published>2009-06-05T15:35:00.007+05:30</published><updated>2009-07-26T10:50:30.070+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='flash cs4'/><category scheme='http://www.blogger.com/atom/ns#' term='alchemy'/><title type='text'>Getting Started with Alchemy : Hello World tutorial in Flash CS4 and Flex 3</title><content type='html'>Today, we are going to do a hello world example for Adobe Alchemy. For those, who don't know what Alchemy is, &lt;blockquote&gt;Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level of community interest in reusing existing C and C++ libraries in Web applications that run on Adobe Flash Player and Adobe AIR.&lt;/blockquote&gt;&lt;br /&gt;First up, we have to set up alchemy. You can find the setup instructions in &lt;a href="http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started"&gt;Adobe Labs&lt;/a&gt;.  InsideRIA also have an article about setting up alchemy. You can find that &lt;a href="http://www.insideria.com/2009/04/setting-up-adobe-alchemy.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now that you have setup Alchemy, lets do the traditional Hello World example with it. First up the C code - helloWorld.c :&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c++"&gt;&lt;br /&gt;#include "AS3.h"&lt;br /&gt;&lt;br /&gt;static AS3_Val returnString()&lt;br /&gt;{&lt;br /&gt;  char* text = "Hello World";&lt;br /&gt;  return AS3_String(text);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  AS3_Val cMethod  = AS3_Function( NULL, returnString );&lt;br /&gt;  AS3_Val result = AS3_Object( "returnString : AS3ValType" , cMethod);&lt;br /&gt;  AS3_Release( cMethod );&lt;br /&gt;  AS3_LibInit( result );&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Some code explanations:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;AS3_Val is the data type Alchemy uses to represent ActionScript objects.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;All functions visible to ActionScript have to declared with AS3_Val as the return type.&lt;/li&gt;&lt;li&gt;The first step in main() is to declare all methods for ActionScript as AS3_Function instances.&lt;/li&gt;&lt;li&gt;Next, create an AS3_Object which will hold references to all these functions.&lt;/li&gt;&lt;li&gt;"Release" the unwanted methods by calling AS3_Release.&lt;/li&gt;&lt;li&gt;Finally, notify the runtime that the library has been initialized by using AS3_LibInit. Pass the  object containing all the functions visible to ActionScript. Note : This should be called last.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; Now that we have written our C code, we have to compile and convert it into a SWC. Open Cygwin, turn on Alchemy using the &lt;span style="font-weight: bold;"&gt;alc-on;&lt;/span&gt; command and navigate to the folder where you have saved your C program. Then type the following command :&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;gcc helloWorld.c -O3 -Wall -swc -o helloworld.swc&lt;/span&gt;&lt;br /&gt;This should create the SWC file with the filename helloworld.swc in that folder.If there were any errors in the C program, it will be shown here.&lt;br /&gt;&lt;br /&gt;Now that you have the SWC file, we can use it in Flash or Flex to call its functions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;h3&gt;Using the SWC file in Flash CS4 : &lt;/h3&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Open Flash CS4 and create a new ActionScript 3 document.&lt;/li&gt;&lt;li&gt;In the Properties panel, click on the Edit profile and click on ActionScript 3 Settings.&lt;/li&gt;&lt;li&gt;In the Library path tab, navigate to the SWC file and add it.&lt;/li&gt;&lt;li&gt;In the Actions panel, type the following code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;//CLibInit is the Alchemy bridge to the C/C++ methods.&lt;br /&gt;import cmodule.helloworld.CLibInit;&lt;br /&gt;&lt;br /&gt;var loader:CLibInit = new CLibInit;&lt;br /&gt;var library:Object = loader.init();&lt;br /&gt;trace(library.returnString());&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Save and run the file. The text "Hello World" should be displayed in the Output panel.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;h3&gt;Using the SWC file in Flex Builder 3 :&lt;/h3&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Start Flex Builder 3 and create a new ActionScript project.&lt;/li&gt;&lt;li&gt;Right-click the project, select Properies and select ActionScript Build Path. In the Library path tab, add the SWC file.&lt;/li&gt;&lt;li&gt;Add the following code : (My ActionScript project's name is HelloWorld )&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt; import flash.display.Sprite;&lt;br /&gt; &lt;br /&gt; import cmodule.helloworld.CLibInit;&lt;br /&gt;&lt;br /&gt; public class HelloWorld extends Sprite&lt;br /&gt; {&lt;br /&gt;  public function HelloWorld()&lt;br /&gt;  {&lt;br /&gt;   var loader:CLibInit = new CLibInit;&lt;br /&gt;   var lib:Object = loader.init();&lt;br /&gt;   trace(lib.returnString());   &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Save and debug the application. You should see the "Hello World" in the Console.&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;Congratulations, you have written a function in a C program and called that function in ActionScript using Adobe Alchemy. Hope this post was useful to you. I'll post more in the coming days. Have fun :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-4711946043224775660?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/4711946043224775660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/06/getting-started-with-alchemy-hello.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4711946043224775660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4711946043224775660'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/06/getting-started-with-alchemy-hello.html' title='Getting Started with Alchemy : Hello World tutorial in Flash CS4 and Flex 3'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-7112041171407278872</id><published>2009-06-01T10:11:00.003+05:30</published><updated>2009-06-10T12:46:39.318+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flash catalyst'/><category scheme='http://www.blogger.com/atom/ns#' term='flash builder 4'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>Flash Builder 4 and Flash Catalyst are on Labs</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Looks like Adobe finally released the betas of Flash Builder 4 and Flash Catalyst on &lt;a href='http://labs.adobe.com/'&gt;Adobe Labs. &lt;/a&gt;Read more at &lt;a href='http://blog.digitalbackcountry.com/2009/05/flash-builder-and-flash-catalyst-betas-now-available/#comment-93147'&gt;Ryan Stewart's blog.&lt;/a&gt; Happy experimenting :D  &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;EDIT : Looks like Flash Catalyst is free ( Adobe is providing a serial number below the download link) but Flash Builder 4 is a 30 day trial. You can extend the trial if you have a valid Flex Builder 3 serial key.&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-7112041171407278872?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/7112041171407278872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/06/flash-builder-4-and-flash-catalyst-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7112041171407278872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7112041171407278872'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/06/flash-builder-4-and-flash-catalyst-are.html' title='Flash Builder 4 and Flash Catalyst are on Labs'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-5626249424303985183</id><published>2009-05-31T10:20:00.004+05:30</published><updated>2009-06-06T10:58:30.578+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='nochump'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='air'/><title type='text'>Creating Zip files with Adobe AIR with the nochump library</title><content type='html'>Following up on &lt;a href="http://pradeek.blogspot.com/2009/05/extracting-zip-files-in-adobe-air-with.html"&gt;my previous post&lt;/a&gt;, here's how to archive a bunch of files and make a zip file.&lt;br /&gt;&lt;br /&gt;After getting all the files you want to put in the archive, create a new ZipEntry object for each file and add it to a ZipOutput object using the putNextEntry() of the ZipOutput class. Then pass the ByteArray data of the file to the write() method of the ZipOutput class and close the entry by using the closeEntry() method. Finally, call the finish() method once you have done the same for all the files.&lt;br /&gt;&lt;br /&gt;Here's the code snippet :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;   import flash.events.FileListEvent;&lt;br /&gt;   import flash.filesystem.*;&lt;br /&gt;   &lt;br /&gt;   import nochump.util.zip.*;&lt;br /&gt;   &lt;br /&gt;   private var zipInput:File = new File();&lt;br /&gt;   private var zipOutput:File = new File();&lt;br /&gt;   private var zipFile:ZipOutput;&lt;br /&gt;   &lt;br /&gt;   private var files:Array = new Array();&lt;br /&gt;   &lt;br /&gt;   private function loadFiles():void&lt;br /&gt;   {&lt;br /&gt;    zipInput.browseForOpenMultiple("Open ZIP file");&lt;br /&gt;    zipInput.addEventListener(FileListEvent.SELECT_MULTIPLE, onSelect);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function onSelect(e:FileListEvent):void&lt;br /&gt;   {&lt;br /&gt;    for(var i:uint = 0;i &lt; e.files.length;i++)&lt;br /&gt;    {&lt;br /&gt;     var stream:FileStream = new FileStream();&lt;br /&gt;     var f:File = e.files[i] as File;&lt;br /&gt;     stream.open(f,FileMode.READ);&lt;br /&gt;     var fileData:ByteArray = new ByteArray();&lt;br /&gt;     stream.readBytes(fileData);&lt;br /&gt;     var file:Object = new Object();&lt;br /&gt;     file.name = f.name;&lt;br /&gt;     file.data = fileData;&lt;br /&gt;     files.push(file);&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function createZIP():void&lt;br /&gt;   {&lt;br /&gt;    zipFile = new ZipOutput();&lt;br /&gt;    for(var i:uint = 0; i &lt; files.length; i++)&lt;br /&gt;    {&lt;br /&gt;     var zipEntry:ZipEntry = new ZipEntry(files[i].name);&lt;br /&gt;     zipFile.putNextEntry(zipEntry);&lt;br /&gt;     zipFile.write(files[i].data);&lt;br /&gt;     zipFile.closeEntry();&lt;br /&gt;    }&lt;br /&gt;    zipFile.finish();&lt;br /&gt;    &lt;br /&gt;    zipOutput.browseForSave("Select target directory");&lt;br /&gt;    zipOutput.addEventListener(Event.SELECT, onSave);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function onSave(e:Event):void&lt;br /&gt;   {&lt;br /&gt;    var archiveFile:File = e.target as File;&lt;br /&gt;    if(!archiveFile.exists)&lt;br /&gt;    {&lt;br /&gt;     var stream:FileStream = new FileStream();&lt;br /&gt;     stream.open(archiveFile,FileMode.WRITE);&lt;br /&gt;     stream.writeBytes(zipFile.byteArray);&lt;br /&gt;     stream.close();&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As usual you can download the project archive &lt;a href="http://dl.getdropbox.com/u/1088914/FlexZipCreator.zip"&gt;here&lt;/a&gt;. Happy experimenting :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-5626249424303985183?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/5626249424303985183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/creating-zip-files-with-adobe-air-with.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5626249424303985183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5626249424303985183'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/creating-zip-files-with-adobe-air-with.html' title='Creating Zip files with Adobe AIR with the nochump library'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-4984641560606491372</id><published>2009-05-30T21:49:00.010+05:30</published><updated>2009-06-06T10:57:26.268+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='nochump'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='air'/><title type='text'>Extracting Zip files in Adobe AIR with the nochump library</title><content type='html'>Today, I'm going to show you how you can use the &lt;a href="http://nochump.com/blog/?p=15"&gt;nochump&lt;/a&gt; library to extract zip files with Adobe AIR.&lt;br /&gt;&lt;br /&gt;The ZipFile class constructor takes an IDataStream object as the parameter.Here you can use a ByteArray or a FileStream object which contains the data of the zip file. The entries property of the ZipFile object contains all the files in the archive as ZipEntry objects. Here the directory itself(excluding the files inside it) also counts as a ZipEntry object, so make sure to check using the isDirectory property of the ZipEntry object. Finally get the data of a single file using zipFile.getInput() method.&lt;br /&gt;&lt;br /&gt;Here's the code :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;   import flash.filesystem.*;&lt;br /&gt;   import flash.net.FileFilter;&lt;br /&gt;   &lt;br /&gt;   import nochump.util.zip.*;&lt;br /&gt;   &lt;br /&gt;   private var zipInput:File = new File();&lt;br /&gt;   private var zipOutput:File = new File();&lt;br /&gt;   private var zipFile:ZipFile;&lt;br /&gt;   &lt;br /&gt;   private function loadZIP():void&lt;br /&gt;   {&lt;br /&gt;    var filter:FileFilter = new FileFilter("ZIP","*.zip");&lt;br /&gt;    zipInput.browseForOpen("Open ZIP file",[filter]);&lt;br /&gt;    zipInput.addEventListener(Event.SELECT, onSelect);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function onSelect(e:Event):void&lt;br /&gt;   {&lt;br /&gt;    var stream:FileStream = new FileStream();&lt;br /&gt;    stream.open(zipInput,FileMode.READ);&lt;br /&gt;    &lt;br /&gt;    zipFile = new ZipFile(stream);&lt;br /&gt;    extract.enabled = true;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function extractZIP():void&lt;br /&gt;   {&lt;br /&gt;    zipOutput.browseForDirectory("Select Directory for extract");&lt;br /&gt;    zipOutput.addEventListener(Event.SELECT, onDirSelect);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function onDirSelect(e:Event):void&lt;br /&gt;   {&lt;br /&gt;    for(var i:uint = 0; i &lt; zipFile.entries.length; i++)&lt;br /&gt;    {&lt;br /&gt;     var zipEntry:ZipEntry = zipFile.entries[i] as ZipEntry;&lt;br /&gt;     // The class considers the folder itself (without the contents) as a ZipEntry.&lt;br /&gt;     // So the code creates the subdirectories as expected.&lt;br /&gt;     if(!zipEntry.isDirectory())&lt;br /&gt;     {&lt;br /&gt;      var targetDir:File = e.target as File;&lt;br /&gt;      var entryFile:File = new File();&lt;br /&gt;      entryFile = targetDir.resolvePath(zipEntry.name);&lt;br /&gt;      var entry:FileStream = new FileStream();&lt;br /&gt;      entry.open(entryFile, FileMode.WRITE);&lt;br /&gt;      entry.writeBytes(zipFile.getInput(zipEntry));&lt;br /&gt;      entry.close();&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can download the project archive &lt;a href="http://dl.getdropbox.com/u/1088914/FlexZip.zip"&gt;here&lt;/a&gt;. Happy experimenting :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-4984641560606491372?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/4984641560606491372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/extracting-zip-files-in-adobe-air-with.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4984641560606491372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4984641560606491372'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/extracting-zip-files-in-adobe-air-with.html' title='Extracting Zip files in Adobe AIR with the nochump library'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-572598889003605333</id><published>2009-05-13T11:16:00.021+05:30</published><updated>2009-06-06T10:56:38.276+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='3d library'/><category scheme='http://www.blogger.com/atom/ns#' term='3d'/><category scheme='http://www.blogger.com/atom/ns#' term='simple3d'/><category scheme='http://www.blogger.com/atom/ns#' term='fp10'/><title type='text'>Introducing Simple3D - A library for 3D in Flash Player 10</title><content type='html'>Simple 3D is a library for developing 3D content in Flash Player 10.Unlike the other major 3D engines like Papervision3D, Away3D, Alternativa3D, Simple3D is just a library of standalone classes for 3D content.Using a standalone class greatly reduces compile size. The compile size of the SWF is around 3KB. Currently, the library contains 5 primitives and an ASE parser. I'm working on a couple more parsers and i'll release it soon.&lt;br /&gt;&lt;br /&gt;Here is a simple sphere demo.&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://dl.getdropbox.com/u/1088914/SphereTest.swf" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" align="left" width="400" height="400"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download : &lt;a href="http://code.google.com/p/simpl3d/"&gt;Simple3D Google Code Page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you guys have any ideas to improve the code, or would like to contribute to the library, just drop a comment. I have created a Google Group for discussion.You can find it &lt;a href="http://groups.google.com/group/simple3d"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Happy coding :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-572598889003605333?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/572598889003605333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/introducing-simple3d-library-for-3d-in.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/572598889003605333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/572598889003605333'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/introducing-simple3d-library-for-3d-in.html' title='Introducing Simple3D - A library for 3D in Flash Player 10'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-8654468843058820168</id><published>2009-05-08T18:57:00.004+05:30</published><updated>2009-06-06T10:55:19.504+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='drawTriangles'/><category scheme='http://www.blogger.com/atom/ns#' term='3d'/><category scheme='http://www.blogger.com/atom/ns#' term='flash cs4'/><category scheme='http://www.blogger.com/atom/ns#' term='fp10'/><title type='text'>Flash CS4 Tutorial : Using the drawTriangles method to render 3D objects</title><content type='html'>&lt;p&gt;I’d like to say hello and welcome to those of you reading my feeds via MXNA. In this tutorial, we are going to use Flash Player 10’s 3D capabilities to render a cube. The drawTriangles method added to the Graphics class is used to render 3D objects in FP10. Lets get started.&lt;/p&gt;  &lt;p&gt;First up,create a new document class. Here we’re going to name it Cube3D. Open the Cube3D.as file and type in the following code.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;pre name="code" class="java"&gt;package    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; import flash.display.*;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; import flash.events.*;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; import flash.geom.*; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public class Cube3D extends Sprite    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var matrix3D:Matrix3D;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var vertices:Vector.&amp;lt;Number&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var projectedVertices:Vector.&amp;lt;Number&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var UVData:Vector.&amp;lt;Number&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var indices:Vector.&amp;lt;int&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private var cube:Sprite; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public function Cube3D()    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; matrix3D = new Matrix3D();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; vertices = Vector.&amp;lt;Number&amp;gt;([50,-50,50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 50,-50,-50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -50,-50,-50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -50,-50,50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 50,50,50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 50,50,-50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -50,50,-50,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -50,50,50     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ]);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; projectedVertices = new Vector.&amp;lt;Number&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; UVData = new Vector.&amp;lt;Number&amp;gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; indices = Vector.&amp;lt;int&amp;gt;([3,1,0, 3,2,1, 5,7,4, 5,6,7, 1,4,0, 1,5,4, 2,5,1, 2,6,5, 3,6,2, 3,7,6, 7,0,4, 7,3,0]); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube = new Sprite();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; addChild(cube); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; addEventListener(Event.ENTER_FRAME, onEnterFrame);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private function onEnterFrame(e:Event):void    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.x = cube.y = 200; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; matrix3D.appendRotation(1,Vector3D.X_AXIS);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; matrix3D.appendRotation(1,Vector3D.Y_AXIS);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; matrix3D.appendRotation(1,Vector3D.Z_AXIS);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Utils3D.projectVectors(matrix3D,vertices,projectedVertices,UVData); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.graphics.clear();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.graphics.beginFill(0x0066FF);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.graphics.lineStyle(1,0x0000FF,1);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.graphics.drawTriangles(projectedVertices, indices);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cube.graphics.endFill();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;}&lt;/p&gt;  &lt;/pre&gt;&lt;p&gt;Now lets take a look at the code:&lt;/p&gt;  &lt;p&gt;Now we can use the &lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt; class to store data instead of Arrays. Vectors are similar to arrays but allow you to store only one type of data. The vertices vector stores the xyz co-ordinates of the 8 vertices of the cube. In order to draw a 3D object, we use the drawTriangles method. The syntax for this method is&lt;/p&gt;  &lt;p&gt;&lt;code&gt;drawTriangles(vertices:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Number.html"&gt;Number&lt;/a&gt;&amp;gt;, indices:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/int.html"&gt;int&lt;/a&gt;&amp;gt; = null, uvtData:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Number.html"&gt;Number&lt;/a&gt;&amp;gt; = null, culling:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/String.html"&gt;String&lt;/a&gt; = “none”)&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;For the indices parameter, we have to split the cube into triangles. A good way for that is to take 1 side of a cube, and split it into 2 triangles. Read the drawTriangles section of &lt;a href="http://www.senocular.com/flash/tutorials/flash10drawingapi/"&gt;this post by senocular&lt;/a&gt; for better understanding of splitting an object into triangles. A section from the post:&lt;/p&gt;  &lt;p&gt;&lt;img title="Calculating Indices " alt="Square Triangles indices" src="http://www.senocular.com/flash/tutorials/flash10drawingapi/images/square_triangle_indices.png" width="107" height="159" /&gt;&lt;/p&gt;  &lt;p&gt;As you can see, a square can be split up into 2 triangles.For the square, the indices are 0,1,2 and 1,2,3. Similarly using the same technique for the cube’s 6 sides, we can calculate the indices.&lt;/p&gt;  &lt;p&gt;Look at the following code:&lt;/p&gt;  &lt;p&gt;matrix3D.appendRotation(1,Vector3D.X_AXIS);&lt;/p&gt;  &lt;p&gt;matrix3D.appendRotation(1,Vector3D.Y_AXIS);&lt;/p&gt;  &lt;p&gt;matrix3D.appendRotation(1,Vector3D.Z_AXIS);&lt;/p&gt;  &lt;p&gt;This is equivalent to rotating through the X,Y&amp;amp;Z axes by 1 degree. Hence this code is executed in every frame. Now take a look at the next line :&lt;/p&gt;  &lt;p&gt;Utils3D.projectVectors(matrix3D,vertices,projectedVertices,UVData);&lt;/p&gt;  &lt;p&gt;The syntax for the projectVectors method is &lt;code&gt;projectVectors(m:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Matrix3D.html"&gt;Matrix3D&lt;/a&gt;, verts:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Number.html"&gt;Number&lt;/a&gt;&amp;gt;, projectedVerts:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Number.html"&gt;Number&lt;/a&gt;&amp;gt;, uvts:&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html"&gt;Vector&lt;/a&gt;.&amp;lt;&lt;a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Number.html"&gt;Number&lt;/a&gt;&amp;gt;)&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;This method, using a projection Matrix3D object, projects a Vector of three-dimensional space coordinates ( &lt;em&gt;verts&lt;/em&gt; ) to a Vector of two-dimensional space coordinates ( &lt;code&gt;projectedVerts&lt;/code&gt; ). This method gives us the 2D vertices (projectedVertices) to use in the drawTriangles method.&lt;/p&gt;  &lt;p&gt;Here is the final cube :&lt;/p&gt;   &lt;br /&gt;&lt;embed src="http://dl.getdropbox.com/u/1088914/Cube3D.swf" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" align="middle" height="300" width="300"&gt;&lt;/embed&gt; &lt;br /&gt;&lt;p&gt;And with a little experimenting, here is a pyramid :&lt;/p&gt;  &lt;br /&gt;&lt;br /&gt;&lt;embed src="http://dl.getdropbox.com/u/1088914/Pyramid3D.swf" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" align="middle" height="300" width="300"&gt;&lt;/embed&gt; &lt;br /&gt;&lt;p&gt;Feel free to drop a comment if you want to kknow anything.   &lt;br /&gt;Happy experimenting &lt;img alt=":D" src="http://www.pradeek.co.cc/blog/wp-includes/images/smilies/icon_biggrin.gif" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-8654468843058820168?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/8654468843058820168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/flash-cs4-tutorial-using-drawtriangles.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8654468843058820168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/8654468843058820168'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/flash-cs4-tutorial-using-drawtriangles.html' title='Flash CS4 Tutorial : Using the drawTriangles method to render 3D objects'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-4398295514085511668</id><published>2009-05-08T18:06:00.002+05:30</published><updated>2009-06-06T10:43:43.248+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='fxg'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>FXG Tutorial : Understanding Paths</title><content type='html'>&lt;p&gt;Continuing on the FXG Tutorials, in this tutorial, we will be seen Paths in FXG. Paths represent the outline of a shape in FXG. Paths are created using the Path element and the co-ordinates are given in its data attribute. A Path element supports fills,strokes,filters and blendmodes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Path data contains numbers and specific letters which specify instructions (M indicates a moveto command, the L indicate lineto command, and the z indicates a closepath command).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here is the example:&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;Application xmlns:fx="http://ns.adobe.com/mxml/2009" &lt;br /&gt; xmlns="library://ns.adobe.com/flex/spark"&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;fx:Library&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;fx:Definition name="Triangle"&amp;gt;&lt;br /&gt;            &amp;lt;Group&amp;gt;&lt;br /&gt;                &amp;lt;Path data="M 100 100 L 50 200 L 150 200 z"&amp;gt;&lt;br /&gt;                    &amp;lt;fill&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColor color="#FF0000" /&amp;gt;&lt;br /&gt;                    &amp;lt;/fill&amp;gt;&lt;br /&gt;                    &amp;lt;stroke&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColorStroke weight="3" color="#0000FF" /&amp;gt;&lt;br /&gt;                    &amp;lt;/stroke&amp;gt;&lt;br /&gt;                &amp;lt;/Path&amp;gt;&lt;br /&gt;            &amp;lt;/Group&amp;gt;&lt;br /&gt;        &amp;lt;/fx:Definition&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;fx:Definition name="Square"&amp;gt;&lt;br /&gt;            &amp;lt;Group&amp;gt;&lt;br /&gt;                &amp;lt;Path data="M 100 100 L 200 100 L 200 200 L 100 200 z"&amp;gt;&lt;br /&gt;                    &amp;lt;fill&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColor color="#FF0000" /&amp;gt;&lt;br /&gt;                    &amp;lt;/fill&amp;gt;&lt;br /&gt;                    &amp;lt;stroke&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColorStroke weight="3" color="#0000FF" /&amp;gt;&lt;br /&gt;                    &amp;lt;/stroke&amp;gt;&lt;br /&gt;                &amp;lt;/Path&amp;gt;&lt;br /&gt;            &amp;lt;/Group&amp;gt;&lt;br /&gt;        &amp;lt;/fx:Definition&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/fx:Library&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;Group&amp;gt;&lt;br /&gt;        &amp;lt;layout&amp;gt; &amp;lt;HorizontalLayout/&amp;gt; &amp;lt;/layout&amp;gt;&lt;br /&gt;        &amp;lt;fx:Triangle/&amp;gt;&lt;br /&gt;        &amp;lt;fx:Square/&amp;gt;&lt;br /&gt;    &amp;lt;/Group&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;As you can see, in the Path data of the Triangle,we have &lt;Path data=”M 100 100 L 50 200 L 150 200 z”&gt;. This merely says : First, Move to 100,100. Then draw a Line to 50,200. Then draw a Line to 150,200. Then close the Path. We can use this to draw any shape that we want easily. You can read more here. Happy experimenting :D. Feel free to drop a comment about anything. Happy experimenting :D &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-4398295514085511668?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/4398295514085511668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-understanding-paths.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4398295514085511668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/4398295514085511668'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-understanding-paths.html' title='FXG Tutorial : Understanding Paths'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-1964964219176426925</id><published>2009-05-08T18:04:00.003+05:30</published><updated>2009-06-06T10:32:25.353+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='fxg'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>FXG Tutorial : Creating and using Symbols</title><content type='html'>&lt;p&gt;In the previous tutorial, I showed you how to create a simple Hello World tutorial in FXG. In this tutorial, we will be creating and using symbols. Symbols are nothing but a set of graphics with a defined name which can used to use it multiple times without having to rewrite the code.Here is the code:&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;Application xmlns:fx="http://ns.adobe.com/mxml/2009" &lt;br /&gt; xmlns="library://ns.adobe.com/flex/spark"&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;fx:Library&amp;gt;&lt;br /&gt;        &amp;lt;fx:Definition name="Square"&amp;gt;&lt;br /&gt;            &amp;lt;Group&amp;gt;&lt;br /&gt;                &amp;lt;Rect width="200" height="200"&amp;gt;&lt;br /&gt;                    &amp;lt;fill&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColor color="#FF0000" /&amp;gt;&lt;br /&gt;                    &amp;lt;/fill&amp;gt;&lt;br /&gt;                &amp;lt;/Rect&amp;gt;&lt;br /&gt;            &amp;lt;/Group&amp;gt;&lt;br /&gt;        &amp;lt;/fx:Definition&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;fx:Definition name="Circle"&amp;gt;&lt;br /&gt;            &amp;lt;Group&amp;gt;&lt;br /&gt;                &amp;lt;Ellipse width="200" height="200"&amp;gt;&lt;br /&gt;                    &amp;lt;fill&amp;gt;&lt;br /&gt;                        &amp;lt;SolidColor color="#FF0000" /&amp;gt;&lt;br /&gt;                    &amp;lt;/fill&amp;gt;&lt;br /&gt;                &amp;lt;/Ellipse&amp;gt;&lt;br /&gt;            &amp;lt;/Group&amp;gt;&lt;br /&gt;        &amp;lt;/fx:Definition&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;fx:Definition name="SampleText"&amp;gt;&lt;br /&gt;            &amp;lt;Group&amp;gt;&lt;br /&gt;                &amp;lt;SimpleText text="This is a sample text"/&amp;gt;&lt;br /&gt;            &amp;lt;/Group&amp;gt;&lt;br /&gt;        &amp;lt;/fx:Definition&amp;gt;&lt;br /&gt;    &amp;lt;/fx:Library&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;Group&amp;gt;&lt;br /&gt;        &amp;lt;layout&amp;gt;&lt;br /&gt;            &amp;lt;VerticalLayout/&amp;gt;&lt;br /&gt;        &amp;lt;/layout&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;fx:Square/&amp;gt;&lt;br /&gt;        &amp;lt;fx:Circle/&amp;gt;&lt;br /&gt;        &amp;lt;fx:SampleText/&amp;gt;&lt;br /&gt;    &amp;lt;/Group&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;We can create symbols with the Definition tag. The definitions must be placed inside of the Library tag. As you can see, in the Definition tag, the name attribute is used to specify the name for the symbol. FXG also allows 2D transformations with the Matrix class. We can also apply Flex effects,filters,transitions,etc. in FXG.Happy Experimenting :D &lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-1964964219176426925?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/1964964219176426925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-creating-and-using-symbols.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/1964964219176426925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/1964964219176426925'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-creating-and-using-symbols.html' title='FXG Tutorial : Creating and using Symbols'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-6374482336705250948</id><published>2009-05-08T18:01:00.004+05:30</published><updated>2009-06-06T10:37:24.413+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='fxg'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>FXG Tutorial : Getting Started with a Hello World Example.</title><content type='html'>&lt;p&gt;FXG is an XML based graphics interchanged format for the Flash Platform. In this tutorial,we are going to get started with FXG with a simple Hello World example. So after you set up Flex Builder with the latest nightly build of Flex 4, (You can see how &lt;a href="http://pradeek.blogspot.com/2009/05/gumbo-setup-flex-4-in-flex-builder-3.html"&gt;here&lt;/a&gt; if you don’t know.) we can start.&lt;/p&gt;  &lt;p&gt;FXG documents have a logical structure. The Graphic element serves as the root for any FXG document. The Group elementis used to group related graphic elements.Currently, basic shapes such as Rectangle and Ellipse can provided but we can easily create our required shapes with the given functions.We can add text with the SimpleText tag which provides simple text formatting as well.&lt;/p&gt;  &lt;p&gt;Here is the Hello World code:&lt;/p&gt;  &lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;Application xmlns:fx="http://ns.adobe.com/mxml/2009" &lt;br /&gt; xmlns="library://ns.adobe.com/flex/spark"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;Graphic&amp;gt;&lt;br /&gt;        &amp;lt;Group&amp;gt;&lt;br /&gt;            &amp;lt;Rect width=&amp;quot;200&amp;quot; height=&amp;quot;200&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;fill&amp;gt;&lt;br /&gt;                    &amp;lt;SolidColor color=&amp;quot;#000000&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/fill&amp;gt;&lt;br /&gt;                &amp;lt;stroke&amp;gt;&lt;br /&gt;                 &amp;lt;SolidColorStroke weight=&amp;quot;3&amp;quot; color=&amp;quot;#FF0000&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/stroke&amp;gt;&lt;br /&gt;            &amp;lt;/Rect&amp;gt;&lt;br /&gt;           &amp;lt;SimpleText text="Hello World" x="50" y="50"/&amp;gt;&lt;br /&gt;        &amp;lt;/Group&amp;gt;&lt;br /&gt; &amp;lt;/Graphic&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This will create a black square with a red stroke with the text “Hello World”. I’ll be posting more tutorials on FXG soon. Happy experimenting :D&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-6374482336705250948?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/6374482336705250948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-getting-started-with-hello.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/6374482336705250948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/6374482336705250948'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/fxg-tutorial-getting-started-with-hello.html' title='FXG Tutorial : Getting Started with a Hello World Example.'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-2087670030628551498</id><published>2009-05-08T17:59:00.002+05:30</published><updated>2009-06-06T09:01:26.410+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='pixel blender'/><category scheme='http://www.blogger.com/atom/ns#' term='conduit'/><title type='text'>New IDE for Pixel Blender - Conduit</title><content type='html'>&lt;p&gt;A company called Lacquer has just released the first 3rd party tool for creating Pixel Blender filters named Conduit. This application lets you to create Pixel Blender filters in a visual design environment using drag and drop manipulation, without the need to learn the Pixel Blender language. It exports a Pixel Blender bytecode (.pbj) file which can be used in Flash Player 10 as filters,fills,etc. As far as pricing is concerned&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Conduit for Flash Pixel Bender is currently in beta testing. For a limited time, the product can be preordered for 50 euros (about 68 USD*).Preorders include download access to the latest beta versions for both Mac and Windows (please note that the Windows beta is not yet available but will be released in October 2008).&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And for those who want a free edition, there is also Conduit Live Home which has a couple of limitations :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Only iSight (Apple web camera) is supported for video capture &lt;/li&gt;    &lt;li&gt;Video record-to-disk is not available &lt;/li&gt;    &lt;li&gt;Maximum image and video resolution that can be imported is 320*240 pixels &lt;/li&gt;    &lt;li&gt;Export is not available &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Currently, only the Mac version is available for download. The Windows version is expected to be available in October 2008.&lt;/p&gt;  &lt;p&gt;Conduit Live Home can be downloaded at &lt;a href="http://lacquer.fi/conduit/live_home.php"&gt;Conduit Live Home.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can find intros and tutorials &lt;a href="http://dvgarage.com/prod/prod.php?prod=conduit2&amp;amp;sub=samples"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-2087670030628551498?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/2087670030628551498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/new-ide-for-pixel-blender-conduit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2087670030628551498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2087670030628551498'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/new-ide-for-pixel-blender-conduit.html' title='New IDE for Pixel Blender - Conduit'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-2707586412973602336</id><published>2009-05-08T17:58:00.002+05:30</published><updated>2009-06-06T09:01:05.906+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='asdoc'/><category scheme='http://www.blogger.com/atom/ns#' term='mxml'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>ASDoc for MXML files</title><content type='html'>&lt;p&gt;The Flex SDK page has a spec titled “&lt;strong&gt;ASDoc in MXML&lt;/strong&gt;“.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Currently there is no way for users to add documentation to components defined in mxml files. The asdoc tool doesn’t read the comments in mxml files. Increasingly more components in the flex framework are being written in mxml.&lt;/p&gt;    &lt;p&gt;Adding support for mxml in the asdoc tool would help developers to generate documentation for their components.&lt;/p&gt;    &lt;p&gt;Several customer have also added requests in JIRA to support class level comments in mxml files.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So now you can add ASDoc comments by the syntax &amp;lt;!— asdoc comment –&amp;gt; . The — are necessary for the compiler to understand that they are ASDoc comments.&lt;/p&gt;  &lt;p&gt;To get the full details chect out the spec : &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/ASDoc+in+MXML"&gt;ASDoc in MXML&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-2707586412973602336?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/2707586412973602336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/asdoc-for-mxml-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2707586412973602336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2707586412973602336'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/asdoc-for-mxml-files.html' title='ASDoc for MXML files'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-6786729573473800206</id><published>2009-05-08T17:49:00.004+05:30</published><updated>2009-06-06T09:00:40.605+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='alivepdf'/><category scheme='http://www.blogger.com/atom/ns#' term='air'/><title type='text'>AlivePDF Tutorial : How to create a PDF file with Flex/AIR</title><content type='html'>&lt;p&gt;Here, we are going to see how to use the &lt;a href="http://www.alivepdf.org/"&gt;alivepdf&lt;/a&gt; library written by &lt;a href="http://www.bytearray.org/"&gt;Thibault Imbert&lt;/a&gt;. This library allows us to create pdf content with Flex. In this tutorial, we will be using Adobe AIR in order to save the file. So lets get started. First create a new Flex project and select Desktop Application as the type. Download the AlivePDF library &lt;a href="http://code.google.com/p/alivepdf/downloads/list"&gt;here&lt;/a&gt;. Copy the swc file and paste it in the libs folder. Now in the main application file, type the following code.&lt;/p&gt;  &lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;  &lt;br /&gt;&amp;lt;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&amp;gt;&lt;br /&gt;    &amp;lt;mx:Script&amp;gt;  &lt;br /&gt;        &amp;lt;![CDATA[ &lt;br /&gt;            import org.alivepdf.pdf.PDF;  &lt;br /&gt;            import org.alivepdf.saving.Method;   &lt;br /&gt;            import org.alivepdf.fonts.*;   &lt;br /&gt;            import org.alivepdf.pages.Page;   &lt;br /&gt;            import org.alivepdf.display.Display;   &lt;br /&gt;            import org.alivepdf.layout.*; &lt;br /&gt;&lt;br /&gt;   private var pdf:PDF;  &lt;br /&gt;            private var file:File; &lt;br /&gt;            [Embed( source="/assets/o-png24.png", mimeType="application/octet-stream" )]  &lt;br /&gt;            private var pngBytes:Class; &lt;br /&gt;            public function generate ():void  &lt;br /&gt;            { &lt;br /&gt;             var pdf:PDF = new PDF( Orientation.PORTRAIT, Unit.MM, Size.A4 ); &lt;br /&gt;                pdf.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );&lt;br /&gt;                var newPage:Page = new Page ( Orientation.PORTRAIT, Unit.MM, Size.A4 );&lt;br /&gt;                pdf.addPage( newPage );&lt;br /&gt;                pdf.setFont(FontFamily.ARIAL , Style.NORMAL, 12);&lt;br /&gt;                pdf.addText("This is a sample text",5,15);&lt;br /&gt;                pdf.drawCircle(25,35,15);&lt;br /&gt;                pdf.addPage();&lt;br /&gt;                pdf.addImageStream( new pngBytes() as ByteArray );&lt;br /&gt;                var fs:FileStream = new FileStream();  &lt;br /&gt;                file = File.desktopDirectory.resolvePath("testPage.pdf");   &lt;br /&gt;                fs.open( file, FileMode.WRITE);   &lt;br /&gt;                var bytes:ByteArray = pdf.save(Method.LOCAL);   &lt;br /&gt;                fs.writeBytes(bytes);   &lt;br /&gt;                fs.close();   &lt;br /&gt;              }   &lt;br /&gt;        ]]&amp;gt;   &lt;br /&gt;    &amp;lt;/mx:Script&amp;gt;&lt;br /&gt;    &amp;lt;mx:Button click="generate()" label="Generate PDF" horizontalCenter="0" verticalCenter="0"/&amp;gt; &lt;br /&gt;&amp;lt;/mx:WindowedApplication&amp;gt;&lt;/pre&gt; &lt;br /&gt;&lt;p&gt;and Run the application.&lt;/p&gt;  &lt;p&gt;The main class here is PDF. The addPage method adds a new page. Similarly, there are a lot of options such as addImage, addText and also graphic methods such as drawCircle. drawRect,etc.You can look at the documentation for this given in the zip file.&lt;/p&gt;  &lt;p&gt;Happy experimenting &lt;img alt=":D" src="http://www.pradeek.co.cc/blog/wp-includes/images/smilies/icon_biggrin.gif" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-6786729573473800206?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/6786729573473800206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/alivepdf-tutorial-how-to-create-pdf.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/6786729573473800206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/6786729573473800206'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/alivepdf-tutorial-how-to-create-pdf.html' title='AlivePDF Tutorial : How to create a PDF file with Flex/AIR'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-5367923798105871585</id><published>2009-05-07T20:41:00.007+05:30</published><updated>2009-06-06T08:59:58.600+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='pixel blender'/><title type='text'>Dynamically changing Pixel Blender data at runtime</title><content type='html'>&lt;p&gt;In my previous post, i had demonstrated the use of Pixel blender filters in Flex. In this post, we will be modifying the file that we did last time so that the user can change the red,blue and green channels and the alpha values at runtime.So if you haven’t done so , finish the &lt;a href="http://pradeek.blogspot.com/2009/05/pixel-blender-tutorial-using-pixel.html"&gt;previous tutorial&lt;/a&gt;. We can access the data of the Pixel Blender filter by the data property of the Shader class.The data property is an object of type ShaderData and it contains all the variables and parameters of  the filter. The parameters are available as variables of type ShaderParameter. Here, we are going to use the same filter we used last time and we are going to allow the user to change the values of the color parameter at runtime with a Slider. Open the mxml file that you used for the previous tutorial and make the changes as :&lt;/p&gt;  &lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;  &lt;br /&gt;&amp;lt;Application xmlns="http://ns.adobe.com/mxml/2009" xmlns:gumbo="library:adobe/flex/gumbo" xmlns:mx="library:adobe/flex/halo" applicationComplete="init()"&amp;gt;  &lt;br /&gt;    &amp;lt;Script&amp;gt;  &lt;br /&gt;    &amp;lt;![CDATA[   &lt;br /&gt;     import flash.display.*;  &lt;br /&gt;     import flash.filters.ShaderFilter; &lt;br /&gt;     [Bindable]private var shader:Shader;  &lt;br /&gt;     private var shaderFilter:ShaderFilter; &lt;br /&gt;     [Embed(source="assets/RGBAEdit.pbj", mimeType="application/octet-stream")]  &lt;br /&gt;     private var ImgFilter:Class; &lt;br /&gt;        &lt;br /&gt;     private function init():void  &lt;br /&gt;     {   &lt;br /&gt;      shader = new Shader(new ImgFilter());   &lt;br /&gt;      shaderFilter = new ShaderFilter(shader);   &lt;br /&gt;      img.filters = [shaderFilter];   &lt;br /&gt;     } &lt;br /&gt;        &lt;br /&gt;     private function apply(e:Event):void  &lt;br /&gt;     {   &lt;br /&gt;            shader.data.color.value[0] = rVal.value;   &lt;br /&gt;            shader.data.color.value[1] = gVal.value;   &lt;br /&gt;            shader.data.color.value[2] = bVal.value;   &lt;br /&gt;            shader.data.color.value[3] = aVal.value;   &lt;br /&gt;            shaderFilter = new ShaderFilter(shader);   &lt;br /&gt;            img.filters = [shaderFilter];   &lt;br /&gt;     } &lt;br /&gt;        ]]&amp;gt;  &lt;br /&gt;    &amp;lt;/Script&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;mx:Panel id="panel" title="Pixel Blender Test"&amp;gt; &amp;lt;mx:Image id="img" source="@Embed('assets/test.png')"/&amp;gt;  &lt;br /&gt;    &lt;br /&gt;        &amp;lt;mx:HBox&amp;gt;   &lt;br /&gt;        &lt;br /&gt;            &amp;lt;mx:Label text="Red"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:HSlider id="rVal" liveDragging="true" minimum="0" maximum="1" value="1" change="apply(event)"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:Label text="Green"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:HSlider id="gVal" liveDragging="true" minimum="0" maximum="1" value="1" change="apply(event)"/&amp;gt;   &lt;br /&gt;        &lt;br /&gt;        &amp;lt;/mx:HBox&amp;gt;   &lt;br /&gt;        &lt;br /&gt;        &amp;lt;mx:HBox&amp;gt;   &lt;br /&gt;        &lt;br /&gt;            &amp;lt;mx:Label text="Blue"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:HSlider id="bVal" liveDragging="true" minimum="0" maximum="1" value="0" change="apply(event)"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:Label text="Alpha"/&amp;gt;   &lt;br /&gt;            &lt;br /&gt;            &amp;lt;mx:HSlider id="aVal" liveDragging="true" minimum="0" maximum="1" value="1" change="apply(event)"/&amp;gt;   &lt;br /&gt;        &lt;br /&gt;        &amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/mx:Panel&amp;gt;&lt;br /&gt;    &lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-5367923798105871585?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/5367923798105871585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/dynamically-changing-pixel-blender-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5367923798105871585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/5367923798105871585'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/dynamically-changing-pixel-blender-data.html' title='Dynamically changing Pixel Blender data at runtime'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-9154030561838543099</id><published>2009-05-07T20:38:00.005+05:30</published><updated>2009-06-06T08:57:26.494+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='pixel blender'/><title type='text'>Pixel Blender Tutorial : Using Pixel Blender in Flex</title><content type='html'>&lt;p&gt;&lt;a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit"&gt;Pixel Blender Toolkit&lt;/a&gt; is a new graphics programming language being developed by Adobe. Pixel Blender Toolkit can be used to create Pixel Blender filters and effects. You can find a lot of sample filters in the &lt;a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit:Gallery"&gt;Gallery&lt;/a&gt; in Adobe Labs and in the &lt;a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=productHome&amp;amp;exc=26&amp;amp;loc=en_us"&gt;Pixel Blender Exchange&lt;/a&gt;.&amp;#160; The Pixel Blender reference(which is in the &lt;strong&gt;docs&lt;/strong&gt; folder inside your Pixel Blender Toolkit Folder with the name “&lt;strong&gt;PixelBenderLanguage10&lt;/strong&gt;“) explains the basics of the language. Start the Adobe Pixel Blender Toolkit and click on “Create a new Filter” button. You’ll see that a small program is automatically generated. Type the following code and save it with any filename.&lt;/p&gt; &lt;pre name"code" class="c++"&gt; &lt;br /&gt;&amp;lt;languageVersion : 1.0;&amp;gt;&lt;br /&gt;&lt;br /&gt;kernel RGBAEdit &amp;lt;&lt;br /&gt;    namespace : &amp;quot;My Filters&amp;quot;;&lt;br /&gt;    vendor : &amp;quot;Pradeek&amp;quot;;&lt;br /&gt;    version : 1;&lt;br /&gt;    description : &amp;quot;Editing RGBA values of an image&amp;quot;;&lt;br /&gt;&amp;gt;&lt;br /&gt;{&lt;br /&gt; input image4 image;&lt;br /&gt; parameter float4 color&lt;br /&gt; &amp;lt;&lt;br /&gt;        minValue:float4(0, 0, 0, 0);&lt;br /&gt;        maxValue:float4(1, 1, 1, 1);&lt;br /&gt;        defaultValue:float4(1, 1, 0, 1);&lt;br /&gt; &amp;gt;;&lt;br /&gt; output pixel4 result;&lt;br /&gt;&lt;br /&gt;    void evaluatePixel()&lt;br /&gt;    {&lt;br /&gt;     result = sampleNearest(image,outCoord());&lt;br /&gt;     result *= color;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Press Run. You will be prompted to load a image. Load it and run. You will see the image and the parameters on the side with which you can change the red,blue,green colors and the alpha of the image.Click File and “&lt;strong&gt;Export Kernel Filter for Flash Player&lt;/strong&gt;“. This creates a Pixel Blender Byte Code file (.pbj file) which we can use in flex.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, create a Flex project and create a folder named assets inside the src folder and copy paste the .pbj file that you generated and a sample image into the assets folder. Now type in the following code in your mxml file. I have named the byte code file as RBGAEdit.pbj and the sample image file as test.png.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;Application xmlns=&amp;quot;http://ns.adobe.com/mxml/2009&amp;quot; xmlns:gumbo=&amp;quot;library:adobe/flex/gumbo&amp;quot; xmlns:mx=&amp;quot;library:adobe/flex/halo&amp;quot; applicationComplete=&amp;quot;init()&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;Script&amp;gt;&lt;br /&gt;        &amp;lt;![CDATA[&lt;br /&gt;        &lt;br /&gt;        import flash.display.*;&lt;br /&gt;        import flash.filters.ShaderFilter;&lt;br /&gt;        &lt;br /&gt;        private var shader:Shader;&lt;br /&gt;        private var shaderFilter:ShaderFilter;&lt;br /&gt;        &lt;br /&gt;        [Embed(source=&amp;quot;assets/RGBAEdit.pbj&amp;quot;, mimeType=&amp;quot;application/octet-stream&amp;quot;)]&lt;br /&gt;        private var ImgFilter:Class;&lt;br /&gt;        &lt;br /&gt;        private function init():void&lt;br /&gt;        {&lt;br /&gt;         shader = new Shader(new ImgFilter());&lt;br /&gt;         shaderFilter = new ShaderFilter(shader);&lt;br /&gt;         img.filters = [shaderFilter];&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        ]]&amp;gt;&lt;br /&gt;    &amp;lt;/Script&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;mx:Image id=&amp;quot;img&amp;quot; source=&amp;quot;@Embed('assets/test.png')&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is just a basic usage of the Pixel Blender Toolkit. You can use it as&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;a filter (ShaderFilter) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;a blend mode &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;a fill and &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;a number cruncher &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy experimenting :D&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-9154030561838543099?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/9154030561838543099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/pixel-blender-tutorial-using-pixel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/9154030561838543099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/9154030561838543099'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/pixel-blender-tutorial-using-pixel.html' title='Pixel Blender Tutorial : Using Pixel Blender in Flex'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-2288247884475196161</id><published>2009-05-07T20:36:00.008+05:30</published><updated>2009-06-06T08:57:05.754+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>Hello World Application in Gumbo</title><content type='html'>&lt;p&gt;I thought I should follow up on &lt;a href="http://pradeek.blogspot.com/2009/05/gumbo-setup-flex-4-in-flex-builder-3.html"&gt;my previous post&lt;/a&gt; with a very simple Hello World application.&lt;/p&gt;  &lt;p&gt;Here is the code:&lt;/p&gt;&lt;br /&gt;&lt;pre  name="code" class="java"&gt;&lt;br /&gt;&amp;lt;Application xmlns="http://ns.adobe.com/mxml/2009"&amp;gt;&lt;br /&gt;&amp;lt;Button label="Hello World"&amp;gt;&lt;br /&gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;/Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Thats it. As you can see there is no more &amp;lt;mx:…&amp;gt; stuff. Just plain &amp;lt;Button/&amp;gt;. &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture#GumboComponentArchitecture-ExistingGumboComponents"&gt;There aren’t many Gumbo components&lt;/a&gt; ,so this is just the beginning. I’ll put up more stuff once I make them.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-2288247884475196161?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/2288247884475196161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/hello-world-application-in-gumbo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2288247884475196161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/2288247884475196161'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/hello-world-application-in-gumbo.html' title='Hello World Application in Gumbo'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-7913394300153788144</id><published>2009-05-07T20:32:00.002+05:30</published><updated>2009-06-06T08:56:48.290+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex builder 3'/><category scheme='http://www.blogger.com/atom/ns#' term='flex 4'/><title type='text'>Gumbo!!! Setup Flex 4 in Flex Builder 3</title><content type='html'>&lt;p&gt;So I finally decided to jump into Flex 4 (codenamed “Gumbo”).Gumbo has a lot of changes from Flex 3. Check out &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Component+Architecture"&gt;this article&lt;/a&gt; for what’s new in Flex 4 . Gumbo doesn’t have a stable release yet so download a nightly build. Gumbo needs Flash Player 10, so you have to download that as well. So lets get started.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.adobe.com/technologies/flashplayer10/"&gt;First download and install Flash Player 10 (Astro). &lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Follow the instructions on the page. Next, &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4"&gt;download the latest nightly build of Gumbo here&lt;/a&gt; and extract&lt;/p&gt;  &lt;p&gt;it to a folder in your computer. Start Flex Builder and select Window -&amp;gt; Preferences . Choose “Installed Flex SDKs” in the Flex category and click the Add button. Browse and select the folder where you unzipped the SDK and click OK to add the SDK. Select the checkbox near Flex 4 to make it the default SDK if you want to.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Creating a Flex 4 Project:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Create a new project as you normally would. Right click the project, select Properties and select “Flex Compiler”. Under the HTML Wrapper, change the “Require Flash Player version” as 10.0.0. If you did not set Flex 4 SDK as the default SDK, then change the Flex SDK version to Flex 4 using the combo box and click OK.&lt;/p&gt;  &lt;p&gt;Congrats! ,You have set-up your first Flex4 project in Flex Builder 3.&lt;/p&gt;  &lt;p&gt;I’ll put up code samples and sample apps. Feel free to drop a comment if you found this useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-7913394300153788144?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/7913394300153788144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/gumbo-setup-flex-4-in-flex-builder-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7913394300153788144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/7913394300153788144'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/gumbo-setup-flex-4-in-flex-builder-3.html' title='Gumbo!!! Setup Flex 4 in Flex Builder 3'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6823551224638477693.post-624430218967272092</id><published>2009-05-07T20:29:00.002+05:30</published><updated>2009-06-06T10:59:43.684+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='hello world'/><title type='text'>Hello world!</title><content type='html'>&lt;p&gt;Hey guys. This is my personal blog on my random experiments . Feel free to drop comments.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6823551224638477693-624430218967272092?l=pradeek.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pradeek.blogspot.com/feeds/624430218967272092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pradeek.blogspot.com/2009/05/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/624430218967272092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6823551224638477693/posts/default/624430218967272092'/><link rel='alternate' type='text/html' href='http://pradeek.blogspot.com/2009/05/hello-world.html' title='Hello world!'/><author><name>Pradeek</name><uri>http://www.blogger.com/profile/06925274879204263603</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
