Using swc's for your assets is great because it it also makes compiling a lot quicker.
With organisation i would suggest a few more categories. - assets - component (eg. spaceship) logic - component factories. - main - main factories - main logic these separate swcs/swfs make your compiling time even quicker. The factories are basically used to instantiate everything your main game will require. Bjorn --- In flexcoders@yahoogroups.com, Axonn <theax...@...> wrote: > > > Hi Doobie! > > You said: > >You might want to organize things differently. Assuming that Game.as is > >your main class that you compile for the game, you may not want to > >compile this with Flash if you're trying to use Flex Builder. > > >The way I organize is to break down my stuff into 2 categories - the > >main game, and the objects/assets used by the game. > > Since yesterday, I guess I found a bit of balance! I found a thread on the > FlashDevelop forum which goes something like this (I'm just telling you the > main idea): You have Game.swc. You then do this: > > public class Game_New extends Game > { > public function Game_New() > { > super(); > trace('And here, I can add my component-related code for Game.swc'); > } > } > > So as you can see, this way we can modularize code PER-COMPONENT. This is > the perfect way for me: I can code stuff for each component without actually > going into Flash. I can modularize my component-related code for each SWC > and I also can have the main compiled class contain the "main" logic. > > You said: > >There is no way you'll build a game > >even in the Flash IDE without grouping your art into some form of > >Movieclip or Sprite. > > I've been doing computer programming for 11 years now (C#, C++, VB6, PHP), > so I know what you're saying and I agree completely. I even did ActionScript > quite a lot, but that was 5 years ago and it was AS 1.0, so it's like... > another lifetime *laugh*. But no, I wasn't even remotely thinking to work in > such a disorganized way! My designer has about 5 years of Flash behind so > she knows her shit ::- D. But even so, of course I already am establishing > the hierarchical structure of the assets with her. There's no way a good > project would live without lots of good and planned order!!! For example if > you have "planet", "space ship", "man" and "helmet", there would be no way > in hell I want them lying on the stage for me to stich up together. That > would be a huge waste of time indeed ::- D. > > > Axonn. > > > ----------------------------------- > The objects and assets I use are usually pretty simple. I like these as > SWCs because I can give them a little logic, and maybe a animated > timeline if need be. Typically if you keep these simple, you'll rarely > have to touch the code, and just have to update with any art changes. > > The main game class, however (what I'm assuming you're calling Game.as), > is something that you'll update constantly throughout the lifecycle of > your game. So this is easier to leave as just some code, and don't > compile into a SWC, just let Flex compile with each build of the game. > > You can organize stuff however you like though - you could completely > ignore what I said, there's no right way to do it. The above just > happens to be what works for me. > > You also talked about your artist not liking having to dig into > movieclips and symbols in the library. Honestly, they should really > learn some organization. Movieclips are the basic building blocks for > interactivity in the Flash IDE. There is no way you'll build a game > even in the Flash IDE without grouping your art into some form of > Movieclip or Sprite. > > If your artist can only draw on the main stage, it'll end up being your > job to figure out how to organize things into the movieclips as you need > them and just do the production work yourself. The downside of this, is > having to do this production work everytime the art gets updated. I've > been through this it's not fun. It's easier to do a bit of pre-planning > surrounding your game and get a dialog going with your artist on how to > best organize the assets. If you both stick to the plan, they can work > in Flash independently and just give you an updated SWC every so often > while you work in Flex Builder, updating the logic surrounding the game. > > But like I said - people prefer different stuff - I'm sure once you get > a little experience with this workflow, you'll have your own opinions. > ben > > Axonn wrote: > > > > > > Hi Doobie and thanks for your answer! > > > > I just managed to get my first SWC into Flex ::- D. *rejoices*. However, I > > can't do anything with it ::- (... I have this "Game.swc". In CS3, I set > > "Game.as" to its class. Game.as is in the same folder as Game.swc. After > > importing it in Flex, I modified "Game.as". I added a trace. But nothing > > shows when I run it with Flex ::- ( ... please don't tell me I need to > > recompile the SWC if I modify the AS. As far as I understood so far that's > > the whole thing when using SWCs, you can code without Flash... so why > > don't > > my modifications take place? > > > > Axonn. > > > > doobiekeebler wrote: > > > > > > Hey, so I've been making some games in Flex Builder myself. Basically I > > > got fed up with the Actionscript editor in Flash a few years ago, and > > > then switched to Flash Develop. Flash Develop is a really great (and > > > free) tool. > > > > > > However, I ditched that once I got Flex Builder, because as much as I > > > loved Flash Develop, Flex worked a lot better for me. I still use Flash > > > Develop if I have to compile in the Flash IDE. > > > > > > Anyway, the others are right, Flex and Flash are all Flash. The reason > > > to use the Flex framework is to get some great UI components, and a > > > great framework to develop a rich internet application in. > > > > > > I use Flex all the time, though that said, I stay clear of it for games > > > since typically the framework is overkill in the "application" > > > department for what I need. > > > > > > Flex Builder, though, is VERY handy for making games. Specifically your > > > example with the rectangles - there are two ways to do this. > > > The first is like what you said and to make a SWF. You can simply embed > > > the SWF using the embed metatag. I'm going to completely butcher it, > > > but it's something like this: > > > > > > [Embed( file='myswf.swf', symbol='myrectangle')] > > > public var myrectangle:Class > > > > > > You can do this with pngs, gifs, jpgs, or swfs. Its simply just another > > > graphical resource to use. It's a little wacky though because you have > > > to assign type it as a class first, and then you can say: > > > > > > var x:myrectange = new myrectangle(); > > > > > > Typically I tend not to do this. My method of choice is to compile a > > SWC. > > > If you embed a SWF in the above fashion, you will lose any and all code > > > associated with it. That means if you have any frame labels, any, > > > stops, any gotoAndPlay's in there, it's lost. > > > > > > If you use a SWC you can use it just for graphics, or you can make your > > > graphics smarter with some code. Just go to the file properties and add > > > the SWC into the library. > > > > > > In this fashion, you now have code completion, and dont have to worry > > > about embedding as the library is linked to the project. > > > > > > All you have to do is make sure that your rectangle has AS3 export > > > linkage assigned in the symbol properties in the Flash IDE, and then > > > just export the SWC. Once in Flex Builder, you don't import anything > > > (as its all in the local namepsace), and just do new myrectangle(); > > > > > > Hope that helps. SWCs are great stuff. > > > ben > > > > > > > > > Axonn wrote: > > >> > > >> > > >> Hm, I think I didn't ask the right question, because somebody told me > > >> that it > > >> *is* possible. > > >> > > >> What I want is this: > > >> > > >> - Create a FLA file in Flash. > > >> - Draw 2 rectangles. > > >> - Create an AS file in Flex 3. > > >> - Attach it to the Flash. > > >> - Export as SWF. > > >> - Continue development in Flex 3. When hit "debug", my > > Flash-created SWF > > >> starts but the debug code is attached to Flex 3, because I am in Flex > > >> 3. But > > >> you know Flex 3 creates that default SWF. I don't want that. I want to > > >> use > > >> the Flash SWF, which *DOES* have my AS class from Flex in it. > > >> - DO modifications to the AS but DON'T START FLASH AGAIN until I > > need to > > >> modify graphics and such. > > >> > > >> Axonn. > > >> > > >> That is correct. Flex can only debug code in flex itself. > > >> > > >> I did see a book at barnes and noble last week that dealt with games in > > >> Flex (but I forgot the name of it). > > >> > > >> -- > > >> View this message in context: > > >> > > http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22766233.html > > > > <http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22766233.html> > > > > > > >> > > <http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22766233.html > > > > <http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22766233.html>> > > >> Sent from the FlexCoders mailing list archive at Nabble.com. > > >> > > >> > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22771991.html > > > > <http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22771991.html> > > Sent from the FlexCoders mailing list archive at Nabble.com. > > > > > > > > -- > View this message in context: > http://www.nabble.com/I-want-to-use-Flex-Builder-3-to-develop-Flash-Games-tp22752546p22795476.html > Sent from the FlexCoders mailing list archive at Nabble.com. >