492 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
+4 more
avenue28
says
Ok…so I’m getting my hands wet with AS3 and was looking into the basic functions. Now from what I could figure out from the internet and other resources, removeMovieClip in AS2 is replaced by removeChild in AS3 . But I realised that the mc is still there in the memory and just that it not there in the display list. How do I remove it entirely from the memory also? If I try deleting it by saying
delete my_mc
I get an error saying
1189: Attempt to delete the fixed property my_mc.  Only dynamically defined properties can be deleted.
Anyone can help? Thanks.
3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

you cant do that. if things are not on the stage and are no longer used by your scripts flash player will delete that stuff automatically.

492 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
+4 more
avenue28
says

oh…i see..thanks for clearing that up…I was just apprehensive that it will be using up that memory. Just imagine if I have a set of large images in a mc.

Can you point me to any nice online resource for AS3 …from basics?

905 posts
  • 8 Years of Membership
  • Collector Level 4
  • United States
unchartedrealms
says

There is a great video on tv.adobe.com about as3 CS4 . it is a great intro into as3

492 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
+4 more
avenue28
says
There is a great video on tv.adobe.com about as3 CS4 . it is a great intro into as3
Thanks for that. I’ll definitely look into it.
3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
ParkerAndKent
says

When you want to delete an object definitively you need to prepare it to be garbage collected. To do this you need of course to remove the object from the display list through removeChild(), but you also need to remove any relation that this object and its childs can have with other objects, like event listeners etc…

Anyway the garbage collection is not immediate, if you monitor your memory usage you will notice that the garbage collection happens with regular intervals.

3256 posts
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+11 more
ParkerAndKent
says

I use, as good practice, to register a listener for the Event.REMOVED_FROM_SATGE to any object that I know I will remove in my application and in this listener I delete all the relations that this object has with the rest of the application.

492 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
+4 more
avenue28
says
I use, as good practice, to register a listener for the Event.REMOVED_FROM_SATGE to any object that I know I will remove in my application and in this listener I delete all the relations that this object has with the rest of the application.

Wow…that is a great tip. I’ll keep that in mind. Thank you very much. :)

1234 posts
  • 6 Years of Membership
  • Affiliate Level 3
  • Author Level 7
  • Collector Level 3
+7 more
MBMedia
says
Can you point me to any nice online resource for AS3 …from basics?

http://www.actionscript.org/resources/authors/364/Bryan-Grezeszak

the 3 articles entitled “AS 3.0 Coming From 2.0” are what I always point people to for moving from AS2 to AS3

492 posts
  • 7 Years of Membership
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
+4 more
avenue28
says
http://www.actionscript.org/resources/authors/364/Bryan-Grezeszak

the 3 articles entitled “AS 3.0 Coming From 2.0” are what I always point people to for moving from AS2 to AS3

Thank you MBMedia. So you wrote them? Really great articles. Thanks for sharing.

by
by
by
by
by
by