Be a Supporter!

deleating an instance

  • 228 Views
  • 5 Replies
New Topic Respond to this Topic
TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
deleating an instance 2009-02-22 13:26:44 Reply

sorry for the dumb question, but i'm making a collection game and i want you to have to collect coins that are at the corners of the levels. once the mouse rolls over them, i want them to disappear and add one to the var cancont. any help?

TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to deleating an instance 2009-02-22 13:39:23 Reply

sry for double post, but i tried

on(rollOver){
	removeMovieClip(this);
}

thought i should mention.

GodlyKira
GodlyKira
  • Member since: Dec. 21, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to deleating an instance 2009-02-22 14:34:47 Reply

removeMovieClip only removes an mc attached dynamically, but there is the visible property

this._visible = false


BBS Signature
TheSongSalad
TheSongSalad
  • Member since: Jan. 17, 2009
  • Offline.
Forum Stats
Member
Level 19
Audiophile
Response to deleating an instance 2009-02-22 14:41:04 Reply

thanks, that'll work i think.

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to deleating an instance 2009-02-22 16:20:39 Reply

At 2/22/09 02:34 PM, GodlyKira wrote: removeMovieClip only removes an mc attached dynamically, but there is the visible property

this._visible = false

Alternatively apply swapDepths to the MC and then it can be removed with AS

on(rollOver){
this.swapDepths(789);
this.removeMovieClip();
}

- - Flash - Music - Images - -

BBS Signature
51lver
51lver
  • Member since: Jan. 14, 2008
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to deleating an instance 2009-02-22 16:36:18 Reply

you could also use the unload movie clip function

on(rollOver){
this.unloadMovie();
}

that works with no depth problems :)

hope i helped