Hi Andrew 

You have one of two approaches you can take when working with exclude files. 

If you want your skin swf to be the "owner" of the skin classes *and* provided 
that you will be loading the skin.swf into your main movie *prior* to 
attempting to access any of the skin classes, then you would apply the exclude 
xml against the main.swf. Now if you change your skin classes you will need to 
republish just the skin.swf. In theory this approach makes your main.swf file 
smaller and makes maintenance easier. 

If you want your main.swf to own the classes but the skin swf to merely utilize 
them, then you would apply the exclude file against your skin.swf file. This 
would be the case if you have several "skins" that you want to load, but only 
want to republish the main.swf when you change your classes. 

But either way, the exclude xml prevents those classes from being compiled into 
the swf that it is applied against. The swf still compiles and does error 
checking against those classes but it simply doesn't include the class 
definitions. The expectation is that the class will be loaded into memory and 
be present at runtime prior to the first call to instantiate the class. 

When I was developing for AS2 I would basically build out the project for the 
most part, then start looking at using exclude.xml files to optimize the load 
strategy. Or, if there were multiple swfs loading the same classes then I would 
make a single class library swf that I would load in first in my load strategy 
so that I was assured that I would not get interference patterns occuring. By 
interference I mean the situation where the first instance of a class loaded is 
the one used, if you mess up and publish one file but another references it and 
loads first then the older version of the class will be used, not the newer 
version. In these cases I just make sure I have one swf that loads the classes 
upfront and worry strictly about republishing it, then later optimize out the 
classes from the other files when I'm nearer the end of the project. 

AS2 had its way of dealing with things, AS3 changes most of those premises. AS3 
doesn't allow the use of exclude xml, you have to play other tricks such as 
class libraries that are "external" in Flex Builder and the like and deal with 
ApplicationDomain and the ilk, none of which are valid for AS2 development. 

Sincerely 
Mark R. Jonkman 

----- Original Message ----- 
From: "Andrew Sinning" <and...@learningware.com> 
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com> 
Sent: Tuesday, May 19, 2009 10:35:13 AM GMT -05:00 US/Canada Eastern 
Subject: Re: [Flashcoders] unexpected result with linked classes in embedded 
swfs 

Jordan, Mark et all advised: 
> If you are going to have your class used throughout various linked 
> swfs, then keep it in your main movie and exclude the class from the 
> links swfs when compiling (using an exclude xml file). 
Thanks! This is really helpful. It seems so stupid of me to program 
the skins this way, and having to keep recompiling them (as I thought I 
had to) was really becoming a pain. My skins take a lot longer to 
compile than main movie, even though they contain much less AS. Must be 
the graphics.... 

So, in my library in the skin, I will link the symbols to the external 
AS in the same way, but then I'll use an exclude file to prevent them 
from actually getting compiled into the swf? Then when the skin-swf 
gets loaded into the main the symbols will "find" their classes? 

_______________________________________________ 
Flashcoders mailing list 
Flashcoders@chattyfig.figleaf.com 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to