Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Juan Pablo Califano
For display objects, another option could be using the ADDED_TO_STAGE and REMOVED_FROM_STAGE events to initialize and destroy the object. In many cases, at least. In some others, especially if initialization is expensive, it could be better to have explicit methods for that. But I think in the gen

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Juan Pablo Califano
Running a GC cycle is rather intensive and can definitely have an impact on performance. It's a trade-off. You hold some memory for a little longer than you actually need, but you save on performance (and many times, memory is just sitting there with no one using it anyway... also, allocating and d

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Matt S.
On Wed, Jan 6, 2010 at 6:15 PM, Karl DeSaulniers wrote: > So there is no way to fire the garbage collector from actionscript? > This seems odd to me if that is the case. If the flash applications > performance is dependent partly on how well the garbage is taken out, > wouldn't there be a class ma

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Karl DeSaulniers
So there is no way to fire the garbage collector from actionscript? This seems odd to me if that is the case. If the flash applications performance is dependent partly on how well the garbage is taken out, wouldn't there be a class made for that so we can control it? Or is it too risky to be m

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Henrik Andersson
Event listeners will be destroyed along with the object the listeners belong to. But they will keep on firing until the garbage collector feels like running. Do note that a listener does hold a reference to the listener function from the event source. This means that if the object has a listen

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Matt S.
Not only is it better, but definitely best practice. The most basic method is to include a listener destroyer function within the class so that it can deactivate itself before being removed, eg: SomeMovieClip.destroyMe(); removeChild(SomeMovieClip); SomeMovieClip = null; there are fancier ways to

Re: [Flashcoders] Best MovieClip removal practice

2010-01-06 Thread Karl DeSaulniers
Could you do? SomeMovieClip.removeListener(someListener); removeChild(SomeMovieClip); SomeMovieClip = null; No need to wait for the trash man. Again, I am still thinking in AS2. Not sure of AS3 equivalent. Karl Sent from losPhone On Jan 6, 2010, at 4:19 PM, ktt wrote: Hello, After remov

[Flashcoders] Best MovieClip removal practice

2010-01-06 Thread ktt
Hello, After removeChild(SomeMovieClip); SomeMovieClip = null; it will removed and will wait for garbage collector. But maybe it is better to remove most unwanted listeners before nullifying the MovieClip and not wait for garbage collector? It should save some memory space and time for actually

Re: [Flashcoders] detect and remove listeners

2010-01-06 Thread ktt
Thank you all for answers. Method with array recording really works nicely :-) BTW - while searching for this method I've found other useful listener tips too: http://www.almogdesign.net/blog/actionscript-3-event-listeners-tips-tricks/ --- On Wed, 1/6/10, Taka Kojima wrote: > From: Taka Kojima

Re: [Flashcoders] A utility to extract Actionscript from an FLA, and create .as files

2010-01-06 Thread Greg Ligierko
This resource probably appeared on the list some time ago. It is a good start point if you like to recombine a JSFL: http://dynamicflash.com/jsfl/#Library I can see oyFashDoc.jsfl file builds XML tracing results to the output screen, which is finally saved as an XML file. You should probably just

[Flashcoders] A utility to extract Actionscript from an FLA, and create .as files

2010-01-06 Thread matt stuehler
All, I'm inheriting a rather large Flash application in which all of the Actionscript is stored in the FLA. Specifically, the FLA has dozens of movie clips, and each clip has it's own Actionscript (typically on the first frame). Is there any way to extract all of the Actionscript into separate .a

Re: [Flashcoders] detect and remove listeners

2010-01-06 Thread Taka Kojima
Yeah, that is the best way... that way you can also properly make sure you handle removing all of them when you no longer need an object. You can either create a helper class, with static methods or extend MovieClip or Sprite and have all of your classes extend from the new class. Store everythin

RE: [Flashcoders] detect and remove listeners

2010-01-06 Thread David Hunter
i always just keep track in my head. if i miss one then i normally know cos something goes drastically wrong! i have toyed with the idea of storing them in a multi-dimensional array but never tried it. so i guess each object/movieclip would have an array or there would be an array mirroring an

Re: [Flashcoders] how to reduce file size caused by redundant classes in loaded-in movies

2010-01-06 Thread Juan Pablo Califano
I never actually tryed it, but I remember I bookmarked a link about this some time ago, maybe you find it useful: http://exanimo.com/actionscript/flash-cs3-and-exclude-xml/ Cheers Juan Pablo Califano 2010/1/6 Andrew Sinning > A swf that I am loading in to a parent movie has symbols that are li

Re: [Flashcoders] hen's teeth...

2010-01-06 Thread Meinte van't Kruis
alchemy is only good if you don't need to pass information back and forth from AS3 to C alot of times. So for instance, you would want to keep processing as long as you can within alchemy, before passing it back to AS3. A good example is JPEG encoding (and decoding done by ByteArray.org), where alo

Re: [Flashcoders] hen's teeth...

2010-01-06 Thread Meinte van't Kruis
Joa Ebert's apparat can be found here: http://blog.joa-ebert.com/2009/08/11/apparat-is-now-open-source/ As far as Cannassa is concerned, he is best known for Haxe, which uses alchemy opcodes here and there(with his flash.memory imple

[Flashcoders] how to reduce file size caused by redundant classes in loaded-in movies

2010-01-06 Thread Andrew Sinning
A swf that I am loading in to a parent movie has symbols that are linked to classes that are already available in the parent movie. This is causing the file size of the loaded-in movie to become much larger than it would otherwise be. The problem is that the symbols import classes which impor

[Flashcoders] flash- javascript -Clearing data for seesion id

2010-01-06 Thread yuva rani
Hi All, If any body knows the how to communiate the flash SWF when the *new session * is opened by means of JAVAscript. I have tried for all types of browser.Let me know any body knows send me the samples or samples links.. Thanks in advance.. Regards, Yuvarani.v ___

Re: [Flashcoders] detect and remove listeners

2010-01-06 Thread Karl DeSaulniers
Maybe create a class or function that applies and removes the listeners? Karl On Jan 6, 2010, at 5:21 AM, Henrik Andersson wrote: ktt wrote: Hello, What is the best method to iterate through MovieClip children, check if they have listeners and if they have - remove them? It is not possi

Re: [Flashcoders] detect and remove listeners

2010-01-06 Thread Henrik Andersson
ktt wrote: Hello, What is the best method to iterate through MovieClip children, check if they have listeners and if they have - remove them? It is not possible to get a list of the listeners. This means that you can not remove them. You can however detect if there is any at all for a given

Re: [Flashcoders] hen's teeth...

2010-01-06 Thread John McCormack
Meinte van't Kruis wrote: Seeing the whole apparat project of Joa Ebert or the stuff Nicolas Cannasse Are their projects available to see? implementing some alchemy to speed things up. As far as I understand it, the C++ code is still converted into Flash's byte codes, so any performance

Re: [Flashcoders] hen's teeth...

2010-01-06 Thread Karl DeSaulniers
Now there's something for flash to aspire to, yeah? Becoming an assembly language and browser language in one. Would help with the whole iphone thing wouldn't it? lol Speed and performance wise i mean. Becoming a semi-native language. if they do that and say AS4 becomes a assembly+ language, coul

Re: [Flashcoders] hen's teeth...

2010-01-06 Thread Meinte van't Kruis
I was also thinking in the lines of alchemy, and the amazing stuff people pull of using that. Seeing the whole apparat project of Joa Ebert or the stuff Nicolas Cannasse pulls off... When reading about that, I think a bit of a c++ or even assembler knowledge would've helped a great deal, since I'm