Skip to main content
Inspiring
June 17, 2008
Question

removing a class

  • June 17, 2008
  • 11 replies
  • 596 views
Hi all - this might be the silliest question around, but I just can't seem
to figure it out.

I've created a highlighter tool, that allows the user to highlight text on
the stage. I'm initializing the external class by using:

import highlighter;
var myhighlighter:highlighter = new highlighter();

But when the user goes to the next frame, I can't figure out how to turn the
thing off. How can I delete the myhighlighter variable?

I've tried:

delete myhighlighter

and

myhighlighter=null;

But nothing has worked. I know this has got to be easy, but I just can't
seem to figure it out. Thanks for your help.




This topic has been closed for replies.

11 replies

Inspiring
June 18, 2008
I generally build in a delete function or clear function into my custom classes (depending on how I build it). I would write a function in the class to clear itself, then call that.

myhighlighter.clearHilight(); //or something like that.

If you didn't want to do that, does highlighter extend MovieClip ? Because then you can removeMovieClip().