(exasperated) Hello!
I'm trying to make the leap from AS2 to AS3, but staying within the bounds of TextMate. There are a number of interesting blogs on the topic:
http://www.laflash.org/forum/showthread.php?t=3635 http://blog.vixiom.com/2006/08/25/build-flex-on-os-x-with-textmate/ http://www.flashalisious.com/2007/07/30/installing-as3-and-flex- bundle-for-textmate/ http://www.dirtystylus.com/blog/2006/09/12/textmate-and-as3/
And I'm sure there are plenty more. I *have* managed to:
1. Install the AS3 bundle for TextMate, using svn 2. Install the Flex SDK 3. Install iTerm 4. Install fcsh 5. Install the Flex Documentation 6. Added "package {...}" to all my .as files 7. Changed 'Void' to 'void'
However, I have no idea what to do next. When I was working in AS2/ TextMate/MTASC I would compile the file using a slightly modified script from the AS bundle which would take the .swf as an input, a list of files and would spit out a new .swf. Is this the same workflow for AS3 and mxmlc? I don't want to get involved with Flex yet, I'm just trying to port my application over to AS3 from AS2.
Any help, pointers or generally beating of sense into is greatly appreciated in this matter...
Many thanks,
Gaby
-- Junkets for bunterish lickspittles since 1998! http://www.playr.co.uk/
With regards to taking up AS3, there are some books that I highly recommend, in this order: http://www.friendsofed.com/book.html?isbn=1590597915 (Foundation AS3 Animation) http://www.amazon.com/Advanced-ActionScript-3-Design-Patterns/dp/ 0321426568 (Advanced AS3 with Design Patterns)
The first one's an easy read and a good reference. The second gets useful when you reach the point that you're noticing patterns in your different projects' code, and are thinking about abstracting them.
If your book budget is small, there're also free references online to help you out, though they read like c**p (as they probably should):
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/ (Language Reference) http://livedocs.adobe.com/flash/9.0/main/Part1_Programming_AS3_1.html (Programming ActionScript 3.0)
As for porting your AS2 project over, you may have some difficulty with that, depending on how much of your code in in the .fla file. I suggest you develop a simple game (like Pong :) to get the hang of things before attempting your port. I expect that most of your code is reusable, but you may want to refactor large portions of it to work more intuitively in the new language.
Best-a-luck!
-Jeremy
On 23 Oct 2007, at 15:43, Jeremy Sachs wrote:
As for porting your AS2 project over, you may have some difficulty with that, depending on how much of your code in in the .fla file. I suggest you develop a simple game (like Pong :) to get the hang of things before attempting your port. I expect that most of your code is reusable, but you may want to refactor large portions of it to work more intuitively in the new language.
Having read this:
http://www.senocular.com/flash/tutorials/as3withflashcs3/
I think I'm better of refactoring the whole lot from scratch. There's so many small changes and the project itself is such a beast that I'm better off just starting with a blank canvas and porting over the classes one at a time. It's going to be a bit painful but well worth the effort in the long term.
I'll still be able to write the AS code in TextMate but properly using mxmlc is a ways off... Project for next year perhaps.
Gaby
-- Junkets for bunterish lickspittles since 1998! http://www.playr.co.uk/
I'm doing a AS2 to AS3 port right now on a rather large code base. Once you get passed the hurdle of how things work different in AS3 it's not so bad. It is a rather large jump though.
So I'm guessing the work of porting is only as hard as it was to build it the first time minus the part of figuring out the logic.
The is a nice little area in the Flash 9 help files under Actionscript 3.0 Language and Components Reference -> Appendix -> Actionscript 2.0 Migration that shows what methods were changed and what to use in AS3 as a replacement.
Then just learn about the new methods you need first.
That's my 2 cents...
-bop
On Oct 23, 2007, at 3:21 PM, Gaby Vanhegan wrote:
On 23 Oct 2007, at 15:43, Jeremy Sachs wrote:
As for porting your AS2 project over, you may have some difficulty with that, depending on how much of your code in in the .fla file. I suggest you develop a simple game (like Pong :) to get the hang of things before attempting your port. I expect that most of your code is reusable, but you may want to refactor large portions of it to work more intuitively in the new language.
Having read this:
http://www.senocular.com/flash/tutorials/as3withflashcs3/
I think I'm better of refactoring the whole lot from scratch. There's so many small changes and the project itself is such a beast that I'm better off just starting with a blank canvas and porting over the classes one at a time. It's going to be a bit painful but well worth the effort in the long term.
I'll still be able to write the AS code in TextMate but properly using mxmlc is a ways off... Project for next year perhaps.
Gaby
-- Junkets for bunterish lickspittles since 1998! http://www.playr.co.uk/
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 24 Oct 2007, at 06:35, Boysenberry Payne wrote:
So I'm guessing the work of porting is only as hard as it was to build it the first time minus the part of figuring out the logic.
True, it's not as fearsome as I suspected it would be.
One question though; where is a sensible place to set any extra arguments that are passed to mxmlc at compilation time (Apple-B)? I need to add a -default-size argument to the compiler but can't see where. I don't want to edit the build script but I want to put it in the 'right' place. Is there a project specific variable I could use?
Gaby
-- Junkets for bunterish lickspittles since 1998! http://www.playr.co.uk/
One question though; where is a sensible place to set any extra arguments that are passed to mxmlc at compilation time (Apple-B)? I need to add a -default-size argument to the compiler but can't see where. I don't want to edit the build script but I want to put it in the 'right' place. Is there a project specific variable I could use?
There are two ways to do this, firstly you could choose the Build (custom) command and have it execute your own script. However I'd recommend that you use a build-config.xml file which mxmlc reads when it beings the compilation process. You should see that it reads {flex_sdk_home}/frameworks/flex-config.xml (you can open this file by running the Configuration > Open flex-config.xml command) as the first step of compilation. By default mxmlc will also search for a config file in the same directory as your Main.as or Main.mxml file with a -config.xml suffix (so Main-config.xml).
In your case the contents of the file should be:
<flex-config> <default-size> <width>100</width> <height>200</height> </default-size> </flex-config>
Hope this helps. Simon
On 31 Oct 2007, at 11:32, Simon Gregory wrote:
One question though; where is a sensible place to set any extra arguments that are passed to mxmlc at compilation time (Apple-B)? I need to add a -default-size argument to the compiler but can't see where. I don't want to edit the build script but I want to put it in the 'right' place. Is there a project specific variable I could use?
There are two ways to do this...
By default mxmlc will also search for a config file in the same directory as your Main.as or Main.mxml file with a -config.xml suffix (so Main-config.xml).
That's exactly what I was looking for, thank you! I had put the directives into the Flex/frameworks/flex-config.xml files originally as a work-around but I wasn't happy with this. This solution solves the problem neatly and cleanly.
Many thanks!
Gaby
-- Junkets for bunterish lickspittles since 1998! http://www.playr.co.uk/