Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Best Practices

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-05-2008, 12:45 PM   #1
Jas_The_Ace
Registered User
 
Join Date: Sep 2008
Posts: 22
Default Simple question - splitting a large project into modular swfs

I have written a suite of 5 games which run in projector mode. I would like to know if this is good practice:

I divided the project up into separate swfs - one for the main menu, and one for each game. I use a single loader object to load the different swfs. Each time I load a swf it replaces the previous one.

I built it this way because a single swf took too long to compile.
Also, I thought I would be able to migrate to AS3 one module at a time.

Is this good practice? Is it feasible?

Last edited by Jas_The_Ace; 09-08-2008 at 01:37 AM.. Reason: didn't get any answers
Jas_The_Ace is offline   Reply With Quote
Old 09-08-2008, 05:30 PM   #2
spooks
Registered User
 
Join Date: Aug 2008
Posts: 39
Default

I'm wondering this as well.
spooks is offline   Reply With Quote
Old 09-08-2008, 11:39 PM   #3
Jas_The_Ace
Registered User
 
Join Date: Sep 2008
Posts: 22
Default

Are you using Loader class in AS3?

What problems have you encountered / do you foresee?
Jas_The_Ace is offline   Reply With Quote
Old 09-09-2008, 03:52 AM   #4
Assertnfailure
as[org].addListener(this)
 
Assertnfailure's Avatar
 
Join Date: Dec 2005
Location: LA, California
Posts: 838
Default

Yeah, it definitely is.
You don't need to load all the games into the same projector, especially if the games use a lot of resources. Plus you don't want to have to recompile the projector every time you change the games, do you?
Assertnfailure is offline   Reply With Quote
Old 09-11-2008, 12:46 AM   #5
Jas_The_Ace
Registered User
 
Join Date: Sep 2008
Posts: 22
Default

Thanks Assert that's very reassuring

My game uses one projector exe that has one Loader. The loader only holds one swf at a time, so if you change game it just replaces the old one.

Interesting idea to turn all the games into projectors but thats a lot of Meg.

My probelm is that some of the games are in AS2 and they do some strange things when you load them from AS3.

Has anyone elase had experience of this?

Last edited by Jas_The_Ace; 09-11-2008 at 11:38 AM..
Jas_The_Ace is offline   Reply With Quote
Old 09-12-2008, 10:55 PM   #6
Assertnfailure
as[org].addListener(this)
 
Assertnfailure's Avatar
 
Join Date: Dec 2005
Location: LA, California
Posts: 838
Default

Quote:
Originally Posted by Jas_The_Ace View Post
Thanks Assert that's very reassuring

My game uses one projector exe that has one Loader. The loader only holds one swf at a time, so if you change game it just replaces the old one.

Interesting idea to turn all the games into projectors but thats a lot of Meg.
1) You don't have to turn all the games into projectors. Just create one projector interface that lets you swap between games (and then just compile the games as swf files).

2) You can prevent filesize overhead by compiling common classes/assets into the main projector. For class files, Flex Builder 3 has a means of doing this for you...otherwise you'd probably have to write some compiler directives to handle that sort of thing.
Assertnfailure is offline   Reply With Quote
Old 09-16-2008, 05:30 PM   #7
maskedMan
Obfuscated Coder
 
maskedMan's Avatar
 
Join Date: Apr 2008
Posts: 686
Default

One of the biggest things you'll have to watch out for when migrating to AS3 is that each module will have to be absolutely meticulous about cleaning up after itself when it's unloaded. Leave no listener un-removed, and leave no timeline, interval, Timer object, or SoundChannel playing. Read up on some of the articles written on the topic by Colin Moock and Grant Skinner for just exactly what to watch out for.
__________________
man.mask = mask_mc;

Sigh. The AS3 version just doesn't look at nice as
'man.setMask(mask_mc);'
maskedMan is offline   Reply With Quote
Old 09-26-2008, 11:31 AM   #8
Jas_The_Ace
Registered User
 
Join Date: Sep 2008
Posts: 22
Default

Thanks Masked Man. This looks very important.

Could you please post a link to Colin Moock's. I read Grant Skinner's 3 Acticles, but I'm still waiting for the 4th one.

Can anybody please tell me how the garbage collector works when AS3 loads an AS2 movie and then unloads it?
Jas_The_Ace is offline   Reply With Quote
Old 09-26-2008, 04:27 PM   #9
maskedMan
Obfuscated Coder
 
maskedMan's Avatar
 
Join Date: Apr 2008
Posts: 686
Default

Here is the link to Colin Moock's article. It's by no means as exhaustive as Grant Skinner's writings, but it provides a handy checklist.

http://www.moock.org/blog/archives/000279.html

EDIT:

Also, this is another Skinner article on the topic, written after the original 3

http://www.gskinner.com/blog/archive...e_to_unlo.html
__________________
man.mask = mask_mc;

Sigh. The AS3 version just doesn't look at nice as
'man.setMask(mask_mc);'

Last edited by maskedMan; 09-26-2008 at 04:33 PM..
maskedMan is offline   Reply With Quote
Old 10-08-2008, 01:19 PM   #10
kbrouill
Registered User
 
Join Date: Aug 2008
Posts: 4
Default Projector loading other swfs

I am doing a similar thing. I created a projector and it loads one swf at a time, depending on what button the user presses. The problem that I am having is that I cannot pass parameters to the loaded swf. When my main program was a swf file, I could pass parameters when I loaded. Anyone know how to pass parameters when a projector loads a swf?

Here is the request I am making:

requeststring = "MyProgram.swf?gh=1&htmlh=10&stgt=" + gtargument[j];
kbrouill is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables between swf's hothousegraphix ActionScript 2.0 10 06-26-2006 10:18 PM
suggestions for splitting up a large task? jsebrech ActionScript 2.0 9 04-11-2005 07:35 PM
Freelancer project electronic ink Projects and Positions 0 06-30-2003 12:41 PM
Need help/advice on large multimedia project architechure jdriscol ActionScript 1.0 (and below) 3 11-06-2002 06:07 PM
New Project Lucremonkey Projects and Positions 5 04-04-2002 04:18 PM


All times are GMT. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.