• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1507
  • Last Modified:

Remove attach movie clips

Hi,

There is code that attach image from library. It will attach image every-time user on Mouse up. There is also a clear movie clip button. My question is how to remove all the attach movie clips on the stage at once.

Thanks




i = 5;
_root.onMouseUp = function() {
		this.attachMovie("dot","dot"+(i+1),i++,{_x:_xmouse, _y:_ymouse});
	}
};
// 3. BUTTON "ERASE":
// --------------------
buttonErase.onPress = function() {
	_root["dot"+(i+1)].removeMovieClip();
};

Open in new window

0
Brian Lin
Asked:
Brian Lin
1 Solution
 
ZefferCommented:
you will need a hitTest on the button so you don't put a copy of dot on the button when you click it.
buttonErase.onPress = function() {
      if(hitTest(this)){
            _root.onMouseUp = null;
      }
      for(i=0;i<100;i++){
      _root["dot"+(i+1)].removeMovieClip();
      }
};

Z

0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now