|
Author
|
||||
|
More in Development
|
||||
Now that you've got all this stuff out of the way, go to the Project > New Project menu option. There's quite an array of project types that you can start up here, but it's a good idea to start up a basic AS3 Project. Type in an appropriate project name and directory (remember the folder you set up just now?) and then continue. You should now have a fresh new workspace to operate with.
Before we go on to a basic coding tutorial, bring your attention to the project window on the right. What you have is a comprehensive tree of every resource to be used in your creation, and files will be added to this window when you create new ones inside FlashDevelop or add them to the project folder from an external application. The project window is nice and simple to start with, but if your creation is going to become complicated (or you're just really trigger-happy with the "New Class" option), it'll look a lot like the one displayed here.
Standard AS3 projects in FlashDevelop are divided into three primary folders:
BIN – no, this is NOT where you throw your rubbish! The BIN (or binary) folder contains the final product, the sum of your efforts, the stuff that an end user will pick up and look at. The two most important files for you to worry about over here are index.html (a Webpage template that can test how your project appears in a browser – if you know HTML, you can fiddle about with this) and a .swf file named after your project (only visible after your first build/run, so don't panic if you don't see it yet). The latter is your executable Flash program.
LIB – you can worry about this later. You know, when you're pro and stuff. It contains things.
SRC – this is where all your hard work takes place before you send it to your executable, and will be the folder in which you spend most of your time. SRC can contain many things. For a start, it holds "Main.as", the entry point of your program and the place where you'll begin your coding. Later on, it'll hold all of your various source code files, embedded images / sounds and, well, whatever else you want to put in there (ooh, look, someone smuggled in a Game Maker 7 file!).
Hopefully you have a slightly better idea of how things work in FlashDevelop now. Feel free to hate me, but knowledge is good. Seriously. Besides, we're getting on to the cool bit now.
|
Words from the readers
|
||||
|
Thanks a lot man! Your peek into the world of non-WYSIWYG Flash development was very informative. :)
Also, auto-completion for the win! Posted by Herman at 17:48:04 on 03 August 2010
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:
|
||||