Howto swap instances with actionscript?

How can I swap instances using actionscript? Similar to the way you would when you use the swap symbols button on the propertys tool bar.

I want to swap the graphics of the mouse after an event occurs.

Thanks for any help!

okay, well the best way I’ve come up with so far is to make a movie clip, and to place the different symbols into it and use actionscript to change between the frames .

You can do that or just tell a new graphic to snap to the mouse…

onClipEvent(enterFrame) {
this._x = _root._xmouse ;
this._y = _root._ymouse;

using that type of code you can only have one at a time

I’ve been using
[AS]startDrag(“hand”, true);

I guess your code is an alternative way of doing it that is backward compatible with flash 5.

thanks for your help :slight_smile:

Sure…either one works :)…

Create different frames inside the mouse movieclip symbol, add a stop() action to frame 1 (so it doesn’t start off looping through them)

Then on the events you want just use [AS]mouseMovieClipSymbolInstanceName.gotoAndStop(frameNumWithCorrectPointer)[/AS]

If I understood correctly :stuck_out_tongue: