Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Prevent Stage autowiring on Modules

  1. #11

    Default

    You should still be able to get the module's applicationdomain through "myModule.loaderInfo.applicationDomain".

    Is there any simple way for us to just disable autowiring of Modules? I think this would be the simplest fix, avoiding all of the nasty memory problems I'm dealing with right now. Alternatively, we could just fail silently with an error trace to the console, without throwing the error.

    I know that this problem is fixable in a no-compromise manner, I just lack the time to dedicate thought to the solution

  2. #12
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default that still doesn't work

    [quote]
    You should still be able to get the module's applicationdomain through "myModule.loaderInfo.applicationDomain".
    [/code]

    well, that is exactly my frustration, if I do this inside the module:
    Code:
    var clsName:String = getQualifiedClassName(this);
    var b:Boolean = this.loaderInfo.applicationDomain.hasDefinition(clsName);
    Its comes up with 'false'. That's why I'm still stumped...

    But for now I've changed the FlexStageDefaultObjectSelector slightly so it rejects stage components for which it is unable to retrieve type information. That'll at least take care of the exceptions for now, until we can come up with a better solution.

    Changes have been committed to the trunk.

    cheers,

    Roland

  3. #13

    Default

    Thanks for committing that change to the trunk, it'll stifle our problems for now at least. When I get some time to look into this crazy mess, believe me, I will. Our current application depends on it, so when we come to a point where we can spend some time on it, I'll do my best to investigate it and figure this out.

    Till then, thanks so much for at least giving us a fix that will prevent the error from being thrown!

  4. #14
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default np

    Glad to help, let me know if you stumble upon any more trouble, we'll try and get things working a.s.a.p.

  5. #15

    Default

    Thanks a lot, we're all really grateful for your hard work on this project.

  6. #16
    Join Date
    Jul 2009
    Posts
    2

    Default this.moduleFactory.info().currentDomain

    [QUOTE=666shooter;252362]
    You should still be able to get the module's applicationdomain through "myModule.loaderInfo.applicationDomain".
    [/code]

    well, that is exactly my frustration, if I do this inside the module:
    Code:
    var clsName:String = getQualifiedClassName(this);
    var b:Boolean = this.loaderInfo.applicationDomain.hasDefinition(clsName);
    Its comes up with 'false'. That's why I'm still stumped...
    I was able to get the module's applicationdomain by using this.moduleFactory.info().currentDomain. See the code below to test it out:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" creationComplete="init()">
    <mx:Script>
    	<![CDATA[
    		import flash.utils.getQualifiedClassName;
    		private function init():void
    		{
    			//doesn't work, as you've discovered
    			var clsName:String = getQualifiedClassName( this );
    			trace( this.loaderInfo.applicationDomain.hasDefinition(clsName ) );  
    			//traces false
    			
    			//works
    			var foo:ApplicationDomain = this.moduleFactory.info().currentDomain as ApplicationDomain;
    			trace( foo.hasDefinition(clsName ) ); 
    			//traces true
    		}
    	]]>
    </mx:Script>
    </mx:Module>
    If you debug and look at the moduleFactory.info() object, there's some interesting stuff in there.

    HTH,

    Tom

  7. #17
    Join Date
    Jul 2009
    Posts
    2

    Default

    a google search for moduleFactory.info shows that Adobe uses that approach in mx.effects.EffectManager which you can see here: http://bit.ly/nKums.

  8. #18
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default thanks for the tip!

    Hi there,

    that code looks very interesting indeed, thanks for the heads up!

    Oh, one minor issue though, I will be on holiday for the coming three weeks. Perhaps I'll have some time this evening to look into this, but please don't be disappointed if I won't make it. In that case either someone else in the team may pick this up, and otherwise it'll be a while before I can look into this further.

    cheers,

    Roland

  9. #19
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    406

    Default SVN commit

    Ok, I used my lunchbreak to have a go at this. I think I have things working, the unit tests are giving me green bars at least.
    I haven't created any decent unit tests for the specific module functionality yet, but my little test app didn't give me any grave errors.
    If any of you can test this with your application then please do, the changes have been committed to the trunk.

    Thank you for all your help so far!

    cheers,

    Roland

  10. #20

    Default

    Roland, thanks so much for this fix. You guys are seriously champs.

    I'll give this a go as soon as possible. How do I compile the trunk into a SWC? There doesn't seem to be a build file in the trunk as there is in the tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •