|
Author
|
||||
|
More in Development
|
||||
This article originally appeared in Dev.Mag Issue 28, released in January 2009
Many of you have experienced it. You go online, log into your instant messenger or e-mail account and receive a link from some excited friend saying, "ARARRRAARARR PLAY THIS GAME ASBFLARGAFAG www.insertrandomlinkhere.com!!!!!" Chances are it's either an Internet booby trap (if you have those kind of friends) or an awesome browser-based something brought to you by Adobe Flash. And if you're a keen game developer, you've probably slobbered at the idea of creating some of these cool games yourself.
Most people believe that Flash development is something remote or intimidating, a craft which is difficult to get into and even more difficult to persist with. However, this need not be the case – all you need is a good set of guide points to work from and, of course, the right software (on top of that, knowing your Java will have Flash practically fall into your lap).
This is a comprehensive kick-start to Flash which will take you through three basic sections:
After going through these three basic sections, you should have a working idea of what developing in Flash requires from you. From there, it's on to Internet tutorials and other thingums to get to grips with coding and advanced tools. Let's get started.
1. Your tools
Like many programming languages, Flash requires three primary components: (1) the IDE (or "where you slap the code in"), (2) the SDK (or "the files on your hard drive which let your computer understand the code stuff") and (3) the debugger (or "the program which runs the final stuff and helps you see if you wrote it all right-like").
For a coding environment, we'll be using the excellent and totally free FlashDevelop IDE. It's only a few megabytes to download and has all of the features that one may expect from a competent IDE, including possibly the most awesome code completion system that you'll ever lay eyes on. Ever ever. This is the program that will be visible to you, the user, whenever you want to show off your coding biceps and make something fantastic. Install it, but don't double-click that little icon just yet! We want to get some other stuff onto your system first.
The FLEX SDK is a group of files which needs to sit on your system before you can develop in Flash. These files are used in building the final Flash applications after you've done the hard work of laying down the code, and will be used by the FlashDevelop IDE when you get around to opening it up.
There're numerous SDK downloads here.
Once you've picked something to download (hopefully a fairly recent build under the "Adobe Flex SDK" category), grab the brand spanking new ZIP file that appears on your hard drive and extract it to a place on your drive where you won't forget about it (for example, C:\flex_sdk_3).
Seriously, don't forget where you've put it.
Finally, you'll probably also want to look at downloading some runtime files and debuggers. Browse through the files on this page.
Recommended downloads are the Flash Player 9 ActiveX control content debugger and the Flash Player 9 Projector content debugger.
After that, you're pretty much sorted for basic downloads. Install applications as necessary.
|
Words from the readers
|
||||
|
thanks a lot for this wounderful tutorial
Posted by Kadri at 19:19:06 on 01 July 2010
Thank you so much for this article!! I would have gone crazy trying to figure out by myself how to get started. You are an angel! Thanks again!
Posted by Rafael at 22:43:47 on 29 June 2010
This is awesome .. Thanks ..
Posted by Nat at 03:29:41 on 29 April 2010
Hello.
Thanks for the tutorial and all, but I've downloaded the SDK and I point the FlashDevelop language settings to that folder, but it never <i>retains</i> it (after restarting). This is actually the problem that led me to your tutorial in the first place (FD's documentation site is rather terse, so I thought maybe I was missing something -- well, actually, I'm obviously missing something; I've just no idea what it may be). It <i>is</i> the <i>folder where the SDK resides</i> that I'm supposed to point it to, correct? It currently resides in a folder entitled "flash projects" on my desktop (WinXP) -- that is, the folder entitled flashsdk_whateverversionitis_orwhatever, with all its requisite extracted flashy SDKness. Thanks for any helpful enlightenments you can provide. Posted by Jordan at 17:06:22 on 24 April 2010
I've already done following your procedure. But I've got build fail.
thanks, Posted by James at 09:19:24 on 31 March 2010
Awesome Tut! I'm a completely wet-behind-the-ears FlashDevelop (let alone AS3) newbie and THIS is totally the right start. It's also a lot easier to follow than the FlashDevelop installation notes & guidelines.
Thank you! David M. Posted by David M. at 08:55:50 on 28 March 2010
Hey this is really great! Easy to follow and does exactly what it says on the tin! Hopefully you'll do more of these, since most tutorials seem to be geared towards people developing in Flash CS3/4
Posted by falconi at 06:38:37 on 27 December 2009
I read through the whole thing but there was no As3 project at all so clicked default. there is no init() though so I was unable to get the project to run
Posted by mark at 07:06:13 on 18 December 2009
Thank you so very much for your help. I just needed a simple startup for learning actionscript with flashdevelop and so many sites had, well I had issues with so many sites. Thank you for your help again! I will email a company in a couple of days and say I just learned actionscript! Well I just needed to get it running. It seems like many other languages and so this gets me going! Sorry, blabbing.
Posted by seanmarillion at 02:21:56 on 08 November 2009
Ooh, missed that comment! Thanks, it's a good idea. I've made one or two minor changes in the article to remove ambiguity in these cases.
Posted by Nandrew at 15:16:12 on 24 September 2009
This tutorial is amazing! Furthermore: you should include the doubts presented in this comments thread in the tutorial itself, because i had the same problems as the other two guys.
Posted by Nek at 17:58:24 on 13 September 2009
Hey Jim!
The screenshot you're referring to chops off the top line: you need the word "package" on its own line, as well as an extra opening and closing brace to surround everything. If you're still having problems after that, I suggest you just use the base code template that FlashDevelop *should* offer you (that's what this article assumes as given), and simply insert the lines circled in red. Hope that fixes everything -- let me know if you're still struggling, I'll check these comments for updates. Posted by Nandrew at 22:12:59 on 20 August 2009
Thanks for this article - I found it really useful.
I ran this code - which seems to be the same as on your screenshot: import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init (e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); var myText: TextField = new TextField(); myText.text = "Hello Flash"; stage.addChild(myText); } } But when I built the project, I got this error: C:\DATA\My Documents\_jim\flash\FlashDevelop\src\Main.as(5): col: 1 Error: The public attribute can only be used inside a package. I wondered if you might be able to advise please? Thanks! Posted by Jim at 09:49:30 on 19 August 2009
This may or may not have a simple solution.
I *think* you may have accidentally produced your code inside a source file other than "Main.as". When FlashDevelop starts a new project, it typically opens up a code window called "Untitled1". If you don't double-click on Main.as from the right-hand panel and work in that instead, you'll be coding in a file that never gets called by the program! I strongly suspect that this is the problem: your code itself is fine, since I copy-pasted it into my dev environment and it displayed the text properly. If there's still a problem, double-check the IDE settings outlined in this article. The Flash version given in the example is by now a bit out of date, but the advice should still apply. Posted by Nandrew at 02:15:47 on 13 July 2009
This is a very helpful article but when I try to run it it shows up blank any advice? Here is my code:
package { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; /** * ... * @author ****** ****** */ public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point var myText: TextField = new TextField(); myText.text = "Hello lash!"; stage.addChild(myText); } } } Posted by Ace Fire6 at 14:50:22 on 11 July 2009
Thanks! If you're interested in reading further into Flash, don't pass up the opportunity to head over to http://www.gamepoetry.com/blog/ -- it's a very useful blog with some very useful articles, and served as a major inspiration for this piece.
Posted by Nandrew at 18:22:49 on 06 May 2009
i have looked all over the web and this is the best of them all for a beginner
Posted by xraser at 13:35:19 on 06 May 2009
Have your say:
|
||||