SWC is a compiled Flash asset.  If you compile Game.as and get a SWC out 
of it, then everytime you change Game.as, you'll need to compile a new SWC.

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.

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.
>
> 

Reply via email to