ActionScript 3 Examples (Code Only) - actionscript-3

Is there anywhere a GOOD tutorial page where I can learn ActionScript 3 ? Or can you help me out ?
I don't use a GRAPHICAL DESIGNER and I don't want to. All I need is code.
For example: things I need to learn quick:
Buttons and TextFields (basic form stuff)
Drawing canvas (like the html5 canvas)
Using FlashDevelop + Flash SDK, no plugins, no nothing. I just got it to work (compile, build and start a blank piece of nothing) and now I need to see what I can do with the ActionScript code.
Solved: Thanks to Dannyw the 2 items above could be solved directly (with minor additions)!
Julian's answer is very helpful too. Since I also wanted to browse through all standard classes in Flash:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html

I have some tips for you to become a great flashdeveloper:
Drop everything you know, start fresh. You have strange assumptions of how the workflow should be. If you want to become professional, you should be open for other workflows.
If your coming from actionscript 2, Dont think as2 is like as3, so don't try to do the AS2 thing with AS3. Again, drop everything you know.
Read & Learn the Adobe LiveDocs
Learn how the display list works.
Learn AS3 coding standards, learn to write clean readable code, later try to learn design patterns.
Learn how to use common actionscript libraries, TweenLite, Gaia framework, RobotLegs, Temple Library, Pure MVC, Away3D, as3corelib etc.
Dont try to reinvent the wheel, dont create your own framework, because you think there is none like yours, most starters step into that trap.
Code never inside the Flash IDE actionspanel, there are really nice actionscript editors like FlashDevelop, FDT, FlashBuilder, IntelliJ. But dont lose yourself in code, there is a lot visual stuff that can faster be build using the Flash IDE, so find a nice workflow, instead of limiting yourself.
if you like video tutorials; videos on gotoAndLearn.com, most have common practices.
If you like to learn from opensource projects: find as3 projects on github.com or wonderfl, check out how they did it.
if you like to read blogs: feeds.adobe.com is full of nice relavant blogs. Learn from the best.
Last but not least: there is no ultimate guide to become a flashdevelop-code-only-flash-developer. Like sport, you have to train and just experiment right away. So be open, use google alot, try to challenge yourself with excercises and fun experiments.

For buttons:
http://www.how-to-code.com/as3-actionscript3/as3-buttons/as3-button.html
For Textfields:
http://www.republicofcode.com/tutorials/flash/as3text/
For Drawing:
http://www.republicofcode.com/tutorials/flash/as3drawvectors/
I learnt actionscript the same way you intend to, just by reading tutorials on the internet and picking bits up as I went along. I eventually bought myself a big old actionscript bible too (Essential Actionscript 3.0 by Colin Moock), but can safely say that the internet was my most valuable resource!
Have fun with the tutorials :)

Use this:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html
BTW, You should almostly declare this website as holy when programming in AS3.

Using adobe flash or macromedia is recommended, follow these tutorials I learnt everything about flash from this website.
http://www.lynda.com/Flash-CS5-tutorials/flash-professional-cs5-essential-training/59964-2.html

Related

How to "convert" a simple flash project to HTML5 using OpenFL

I have to "convert" some flash projects to HTML5/JS but I don't really know how I can do it :(
This flash projects are little "activities" like this one :
https://www.brainpop.com/artsandmusic/artconcepts/cameras/activity/#=standard
I did some research about it, but i'm a bit lost...
I found other people asking the same question and a lot of responses are to use Haxe/OpenFL and as3hx (https://github.com/HaxeFoundation/as3hx) but I don't really understand how to proceed...
Is it possible to load a .swf file with openfl-swf to create a similar .html file ?
Should I convert AS3 to Haxe3 with as3hx ?
Is there a simple way to just get a graphic render of this activities without any interactivity so I can add manually input text field ?
I never used ActionScript or Haxe before.
If someone has any suggestions i'll be glad to hear it :)
I hope my explanations are clear, english is not my first language, so excuse me for any mistake.
Cheers !
as3hx will convert only as3 code to haxe openfl and may well need hand tweaking. To make the code more flexible try to avoid extending Sprite then potentially it will be easier to use your activity logic in more webgl accelerated haxe solutions like Kha and Luxe.
You probably need clean seperation of the code and the onscreen layout.
To run a fla swf that is mostly graphics in openfl you need to use the haxelib https://github.com/openfl/swf, it can be quite fiddly getting to different children or frames and the gradients are not perfect, just remember when using it that it's not the same as accessing a child normally your using a structure that is a bit different to do that.
Alternatively you may find flump useful it can be used with openflump.
https://github.com/SavedByZero/openflump exports from flash IDE.
It converts lots of your graphics to png sequences in nested structures, it would probably be worth rebuilding textfields yourself.
Openfl js can be slow I suggest you do some tests before committing to a solution, since Kha or Luxe may provide you a more shader modern approach to graphics than a flash emulation api solution, but then all you assets largely need to be images.
I doubt if there is any ideal way but getting your logic in Haxe is really good idea because then you can do c++, c#, js etc.. The first step if you choose openfl is to perhaps to try just porting parts of your code to haxe and then use them as a swc in your current projects this will allow you to gradually check your conversion and fix an issues easily within a haxe flash approach prior to trying to do the same in html haxe. You may find the swf library is not ideal for html5 and that png's are the way to go, Animate now provides export png sequence which I have used in starling as3. Another approach to consider is the away3d plugin for Animate it can convert flash timeline into typescript away3d (2D ) that you can control with javascript code ( even haxe you may have got from as3hx if you remove some of the flash specific haxe and adjust it to work with the away3d 2d but I guess it could be very complex ).

Which are some free client side libraries that can help in development of games with HTML5 Canvas element?

I am planning to develop a game with HTML5 Canvas. As handling canvas with native JavaScript is very difficult for game development, I am rather thinking to adopt any free and good client side library with good tutorial.
I have started my work with CAAT, but found it has lake of tutorials. I found Cocos2d-x HTML5, but again I faced the same issue.
Can anyone suggest me good library with good tutorial help?
P.S. :: My game contains complex physics operations, so I need to use Box2D. It will be helpful if library has integrated Box2D with it and having good tutorial of integration.
cgSceneGraph can be used with Box2D. We already did it for a basket ball game.
The example page does not include yet a Box2D example, but, as I am the designer of the framework, I can help you by sending you pieces of code.
Have a look at the cgSceneGraph examples page (http://gwennaelbuchet.github.com/cgSceneGraph/examples.html).
Anyway, feel free to ask for more examples or tutorials if you need. I'll be glad to help you.

FlashDevelop ? Do i still need Flash CS

I am fairly new to Flash and AS3.
My questions is do I actually still need to use Flash CS6 to setup the stage and library files.
Or can it all be done from FlashDevelop ?
Thanks
Flash CS6 is an application similar to Photoshop, you generally use it for creating/structuring/positioning graphical resources and then makes it possible to animate these (from keyframe to keyframe) and then access the graphical content from code.
So, the answer is no, you can create a SWF file without Flash, you can embed content to use in AS3-code without flash and you can use flex-components and position them without flash.
But creating any bigger project like that would be pretty unnecessary since you just as well could use some other language or tools for doing that kind of stuff. Tools and languages that were designed to do this specific thing.
Few months ago I switched completely to FD and since today I successfully built everything only in FD. The reason was that I had huge project to publish, and I couldn't compile it in Flash because of memory shortage for JVM compiler. With FD that was not a problem.
So in short, no, you don't need flash any more.
Though maybe there can be some things that you can create quicker and easier way in Flash than in FD (for example: some timeline animation and then publish to SWC to use with FD).
I still have Flash installed, just in case for quick animation jobs.
You need it if you want to create graphic objects to use them later in your code. The alternative is to create everything by code
It depends. If you need to use vector graphics, drawn in Flash, then the easiest way to incorporate them in your project is to use the IDE-based project (http://www.flashdevelop.org/wikidocs/index.php?title=Projects#AS3_Flash_IDE_Project). This isn't the only way, but it's easier than packaging them up and using libraries. In this case you are effectively using FD just as an external AS editor (and it's worth doing it just for this, since it is a much better editor than the one built in to Flash Pro.
If, on the other hand, you are working with objects drawn in code, with text, or with external bitmaps, then no, there's no real need to use CS* at all.
The advantage to OOP is having an environment like Flash for layout. It's been pretty crucial for me as a designer and when implemented correctly with a proper class structure, becomes extremely powerful. It really depends on what you are using as3 for. I find the Flash architecture to be most advantageous in the context of interface design, but for things like games or "static" interactives, sometimes its much more efficient to do everything in code and compile outside of Flash.

Completely new to Programming, want to learn ActionScript 3.0

I am entirely new to learning programming, and my father recommended this site to me. I wanted to learn Actionscript 3.0 to possibly make my own flash game. There is alot of things I need help on because I am completely clueless. What kind of things should I download, do I have to pay for any of this?(I don't have money to spend, sadly.) Where can I find some good tutorials? Do I need any kind of client to play around with actionscript 3.0 and learn the language? Sorry if some of these questions don't really make sense, like I said, entirely new to the programming world, but I really want to make my own MMORPG,(completely unrealistic dream), and I want to start small, try making money off flash games, get some programming experience, any help anyone can provide would be great. All I ask is please do not tell me how unrealistic my dream of making an MMORPG is, just mentioned it to give a little insight as to why I wanted to learn programming. I know it's crazy, but that's why it's a dream, a goal I'm hoping to achieve one day.
I highly recommend downloading Flash Develop (requires windows) for development, its a free, and also IMO the best, AS3 editor. It'll get you up and running. If you are on a mac you might want to start with free trials of the Adobe code editors.
For resources & tutorials, the web is full of free stuff to get you started. A couple are 8bitrocket & gamedev.stackexchange The first thing to do is just pick a simple game (perhaps a true/false trivia game) And just build it. For getting started with general AS3 programming look here for a variety of docs & tutorials.
Good luck, and have fun!
Flex is a free product made by Adobe itself, and uses ActionScript 3.
Here's a link to a game dev site with tutorials on how to make a game for free using flex:
http://www.dreamincode.net/forums/topic/92205-making-flash-games-for-the-non-flash-developer-part-i/
http://www.dreamincode.net/forums/topic/92293-making-flash-games-for-the-non-flash-developer-part-ii/
http://www.dreamincode.net/forums/topic/92746-making-flash-games-for-the-non-flash-developer-part-iii/
http://www.dreamincode.net/forums/topic/92893-making-flash-games-for-the-non-flash-developer-part-iv/
If you read through the link article carefully, you can use eclipse (free) with a flex plugin, instead of having to use the flex builder.

ActionScript newbie, need some help

I started learning flash and actionscript very recently and I am having fun with it. Now, here's something I wanna do with actionscript and since I am pretty new, I am not yet sure where to look for to learn what I want. I am specifically looking for image manipulation techniques that can be achieved with AS, for example, basic image manipulation like changing contrast/brightness, transform image etc. Can anyone guide me towards any relevant tutorial/resources that would be easy to understand for a beginner.
Check out these pages:
http://gotoandlearn.com/index.php?currentpage=5
http://gotoandlearn.com/index.php?currentpage=6
Watch the videos titled:
Introduction to Pixel Bender: Part 1
Introduction to Pixel Bender: Part 2
Animating Pixel Bender Filters
This will have you well on your way. The rest of the site is packed with hundreds of free videos + source files (in many cases) so you should be well on your way with this website. The tutorials on that website are actually my foundation/roots/beginnings in flash. Of course since then I've moved on to more advanced topics/theory etc but there is more than enough information to come out a real flash developer. :)
I would recommend buying the book Learning Actionscript 3.0. This is the book I started with and to be honest I never needed another book on Actionscript again. It covers pretty much everything, including image manipulation.
You can see and download the samples from the book here. For image manipulation, I would recommend looking at example of 'Drawing With Pixels'.
There are a lot of good books out there. Colin Moock's Essential Actionscript is by far my favorite book.
If your looking for some online help or tutorials heres a list of references:
A nice tutorial on active tuts for changing the brightness of an image.
Senocular is an AWESOME reference in anything flash. Here he talks about the Matrix class is basically any size manipulation to a movieclip of image.
Finally the Adobe live docs are the best place for you to learn the built in classes AS3 has to offer. the Movieclip.transform property is the basis for all aspects of image manipulation (hue,tint,etc).
Good luck in your learning, I remember how exciting it was for me!