[osflash] unloading classes (Mariano Cerrutti)

Mariano Cerrutti vscorza at gmail.com
Wed Sep 26 13:36:11 PDT 2007


thank you very much Soren (and Grant :) ), will try it right away!

let you know about it

cheers
Mariano

On 9/26/07, Søren Thulesen <st at cyberion.dk> wrote:
>
> Hi Mario.
> I had a similar problem once. Got this solution from Grant Davies (thanx
> mate!!!!)
>
> --- from Grants mail ---
> The  clean class loader is pretty creative
>
> 1st thing, none of your assets/graphics.classes should exist on frame 1 of
> your fla, always frame 2 or later
>
> I had to create a "seed" swf to do this, in the flash ide create a symbol
> called clearClassLoader
>
> In frame 1 of this symbol, create a keyframe and add this code :
>
> #initclip 0
> _global.ASSetPropFlags(_global.com.tm, null, 0,2);
> _global.com.myclass.=undefined;  // this will "wipe" the myclass class
> from
> memory
> _global.com.myotherclass = undefined;  // this will wipte the myotherclass
> from memory
> _global.com.mypackage = undefined; // this will wipe all classes belonging
> to the com.mypackage package.
>
> #endinitclip
>
> Make sure that symbol is set to export on frame 1 of your movie clip.
> What this does now, is when this clip loads, before any symbols are loaded
> or put on the stage, it clears the classes you put in the code above.
>
> ----
>
> i actually didn't do all the frame stuff that Grant suggested. I have an
> arp
> application loading forms and in these forms I have classes with the same
> names but different functionality. Problem is that Flash doesn't recognize
> that the class is different, so I just wipes the packages containing my
> classes, like Grant suggests in the example above.
>
> good luck!
>
>   Soeren
>
>
>
> > I have this problem with an app that's loading and unloading externals
> swf
> > via MovieClipLoader.  It seems like the classes definitions contained
> > within
> > the loaded swfs are overlapping.
> > For instance, we are loading different games from within a landing app.
> > If
> > we load a game twice everything breaks and the app freezes.
> >
> > Any idea on this?  Any way to unload the loaded classes?
> >
> > thanks in advance
> > cheers
> > Mariano
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL:
> >
> http://osflash.org/pipermail/osflash_osflash.org/attachments/20070926/4c27214b/attachment.html
> >
> > ------------------------------
> >
> > _______________________________________________
> > osflash mailing list
> > osflash at osflash.org
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
> >
> > End of osflash Digest, Vol 29, Issue 38
> > ***************************************
> >
>
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20070926/f324d1b8/attachment.html 


More information about the osflash mailing list