A little known feature (never used it myself) is that you can specify the type 
of an include:

http://bit.ly/7F9DJv

If you specify your includes as type="text", I think you can do what you want 
(include something that is not well-formed XML).

OTOH, you were probably on the right track in using mixins to separate out your 
functionality, but you have stumbled on one of the things that makes mixins 
powerful/dangerous.

I'd be interested to know more about the specific issue the swf10 compiler was 
having a problem with.  The LZX compiler is supposed to 'do the right thing' 
for you.  It does not actually write the mixin out as a class -- it just uses 
it as a template to write the flattened class chain that your mixins specify.  
So, I think there is either a bug in the compiler, or a bug in your 
modularization.

On 2009-12-03, at 16:19, Rami Ojares / AMG Oy wrote:

> I wrote about this earlier on the user's list but now that I decided to make 
> the leap to swf 10 runtime I got into trouble.
> 
> My issue is this.
> 
> I have tons of methods in a class/view (doesn't matter which).
> 
> <view
>       <method_1/>
>       ...
>       <mwthod_n/>
> </view>
> 
> For the sake of source code organization I split it into many parts.
> 
> First I tried to just to include the methods (as in including an instance)
> 
> 
> <view>
>       <include href="methods_relating_to_issue_A.lzx"/>
>       <include href="methods_relating_to_issue_A.lzx"/>
>       <include href="methods_relating_to_issue_A.lzx"/>
> </view>
> 
> Here the problem was that the included files must have a single root.
> When including a library, the library tag takes care of this.
> 
> So I wrote the includes as mixins and got away with that on swf8.
> 
> <view with="methods_relating_to_issue_A, methods_relating_to_issue_B, 
> methods_relating_to_issue_C"/>
> 
> But on swf10 flex compiler complains that I refer to methods in some of the 
> mixins that are not inside that same mixin. I think it is a reasonable 
> complaint since you could use the mixin anywhere you like and then those 
> references would cause problems.
> 
> The correct way is to include the methods as "instances" using the include 
> tag.
> 
> So what I would need is a tag like
> 
> <instance>
>       <method_1/>
>       ...
>       <mwthod_n/>
> </instance>
> 
> And when I include such a file that instance tag would simply disappear.
> 
> What do you think?
> Should I file a New Feature or Improvement into Jira?
> 
> - rami


Reply via email to