Re: [Flashcoders] Removing movieClip from memory

2010-10-30 Thread Olivier Besson

A summary of how unloading 'stuff' became quite complex:
http://blog.gludion.com/2008/07/as3-might-become-usable-in-multi-swf.html

Henrik Andersson a écrit :

Objects can not be destroyed explicitly.

You need to do your own cleanup work and then wait for the garbage 
collector to reclaim the memory.


The garbage collector is unpredictable and may or may not run at all. 
If you need any specific work done at a specific time, do it yourself.



Also, the stopAllSounds method is a bad hack. It really does stop all 
the sounds. Even ones that you may have wanted left alone. I never use 
it.

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




--
Olivier Besson (gludion) - (33 1) 44 64 78 99
http://www.gludion.com
http://blog.gludion.com

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


[Flashcoders] Removing movieClip from memory

2010-10-25 Thread m...@rcello
Hi Folks!

I have a doubt of how to remove a movieClip from the stage using
removeChild.
I put some sample code in this message and the mc 'ball' has a sound in it.
The process to attach a movie clip on Stage works fine! Also the process to
remove but...

Why does the sound still play without the object on Stage?
What can I do to remove it really from the memory?

var ball:MovieClip = new Ball();
ball.x = ball.y = 100;
addChild(ball);
stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
function onClick(evt:MouseEvent):void {
stage.removeEventListener(MouseEvent.CLICK, onClick);
this.removeChild(ball);
ball=null
trace(ball)
}

If somebody help me to fix it and continue my job, I'll be very thankful!

-- 
Marcelo
-
Email - Msn - GTalk
marcelo.tec...@gmail.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Removing movieClip from memory

2010-10-25 Thread Nathan Mynarcik
import flash.media.SoundMixer;

SoundMixer.stopAll();

Nathan Mynarcik
nat...@mynarcik.com
www.mynarcik.com

http://www.mynarcik.com/feed/rss.xml
http://www.twitter.com/NMynarcik
http://www.facebook.com/pages/Nathan-Mynarcik-Interactive-Web-Developer/265263144230
  http://www.linkedin.com/in/nathanmynarcik




On Mon, Oct 25, 2010 at 1:37 PM, m...@rcello marcelo.tec...@gmail.com wrote:

 Hi Folks!

 I have a doubt of how to remove a movieClip from the stage using
 removeChild.
 I put some sample code in this message and the mc 'ball' has a sound in it.
 The process to attach a movie clip on Stage works fine! Also the process to
 remove but...

 Why does the sound still play without the object on Stage?
 What can I do to remove it really from the memory?

 var ball:MovieClip = new Ball();
 ball.x = ball.y = 100;
 addChild(ball);
 stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
 function onClick(evt:MouseEvent):void {
stage.removeEventListener(MouseEvent.CLICK, onClick);
this.removeChild(ball);
ball=null
trace(ball)
 }

 If somebody help me to fix it and continue my job, I'll be very thankful!

 --
 Marcelo
 -
 Email - Msn - GTalk
 marcelo.tec...@gmail.com
 ___
 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


Re: [Flashcoders] Removing movieClip from memory

2010-10-25 Thread m...@rcello
Hi Nathan. Thanks to answering me.

The sound really stoped, but if If put a EnterFrame function inside a ball
starting a trace (for example), it continue working inside a function.
But the sound was a sample. the object still working hidden in memory.
Do you have any ideia how to destroy an object with sounds, functions etc?

Thanks again!


On Mon, Oct 25, 2010 at 3:54 PM, Nathan Mynarcik nat...@mynarcik.comwrote:

 import flash.media.SoundMixer;

 SoundMixer.stopAll();

 Nathan Mynarcik
 nat...@mynarcik.com
 www.mynarcik.com

 http://www.mynarcik.com/feed/rss.xml
 http://www.twitter.com/NMynarcik
 
 http://www.facebook.com/pages/Nathan-Mynarcik-Interactive-Web-Developer/265263144230
 
  http://www.linkedin.com/in/nathanmynarcik




 On Mon, Oct 25, 2010 at 1:37 PM, m...@rcello marcelo.tec...@gmail.com
 wrote:

  Hi Folks!
 
  I have a doubt of how to remove a movieClip from the stage using
  removeChild.
  I put some sample code in this message and the mc 'ball' has a sound in
 it.
  The process to attach a movie clip on Stage works fine! Also the process
 to
  remove but...
 
  Why does the sound still play without the object on Stage?
  What can I do to remove it really from the memory?
 
  var ball:MovieClip = new Ball();
  ball.x = ball.y = 100;
  addChild(ball);
  stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
  function onClick(evt:MouseEvent):void {
 stage.removeEventListener(MouseEvent.CLICK, onClick);
 this.removeChild(ball);
 ball=null
 trace(ball)
  }
 
  If somebody help me to fix it and continue my job, I'll be very thankful!
 
  --
  Marcelo
  -
  Email - Msn - GTalk
  marcelo.tec...@gmail.com
  ___
  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




-- 
Marcelo
-
Email - Msn - GTalk
marcelo.tec...@gmail.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Removing movieClip from memory

2010-10-25 Thread Henrik Andersson

Objects can not be destroyed explicitly.

You need to do your own cleanup work and then wait for the garbage 
collector to reclaim the memory.


The garbage collector is unpredictable and may or may not run at all. If 
you need any specific work done at a specific time, do it yourself.



Also, the stopAllSounds method is a bad hack. It really does stop all 
the sounds. Even ones that you may have wanted left alone. I never use it.

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