PDA

View Full Version : I need Help deleting variables


neonard0
04-16-2006, 10:50 PM
Hi I'm soryy if my question is so absurd, but i'm just begining. Ok. I'm creating some component for a photo album and i made a screen shoot loader for the images but it has (well for me) a lot of vars, like strings or number, and some ColorTransform Objects (cause it component has a some functuionallity that i need, like automatic align and sizing), and i would like that in the moment that the screenshoot is fully loaded the component automatically deletes all the stuff that is not needed any longer. Cause there are many instances in the frame so all that garbage is huge.
Any idea !!!
I'll appreciate a lot, (I'm thinking to give the source (that is fully commented, but in spanish ;)) when I finisih it, so all the help is welcome)

neonard0
04-20-2006, 03:06 AM
Well, I am sorry for all the people that lost their time watching this post, cause the answer was too obvious, for deleting the var is the command:
delete var; //;(

But well i just begining and this could help anyone else, for those who have the same question, well the answer is this:
With the command "delete" you can delete all the vars (like nmbres and strings, or boolean too) that have been created without the prefix "var"
so the script
var my_var="Hi, you cant delete me";
delete my_var;//this will not work and the var will exist
but...
my_var=true;
delete my_var;//this var will not exist anymore

the same comand can aply to objects, so
cl=new Color(my_instance_mc);
delete cl;//the objet will not exist anymore

Well that's all folks. I hope this could help anyone :)