It's early in the morning, but it seems to me your not finishing the
tween in your test. Try calling the stop() method before you unload.
There may be a call to setInterval that doesn't get cleared if you
don't.
That begs the question of why you want to unload and reload it. there
must be a way for you to save the extra load. What about setting
visible to false or moving it off stage?
On 5/25/06, Nik Derewianka <[EMAIL PROTECTED]> wrote:
Hi all,
Basically i attachMovie my character (which is an AS2.0 class extended
MovieClip) to _root, then move it back and forwards across the screen
using the Tween class, unloadMovie my character, go to a different
frame, attachMovie my character back again, but this time it seems as
though there are two or more Tween objects trying to control my
character. If i reattachMovie using a different instance name, then
it will work fine.
So how do i completely unload my MC and my Tween so that there are no
references hanging around ?? How can i find out how many references
there are for a given object (similar to the ref count in lingo
objects in Director) ?? And is this only happening because of AS 2.0
?
Heres my stripped down test movie:
mc with ID of idRedbelly1, AS2.0 class of code.Crawlie2 which contains:
--------------------------------------
import mx.transitions.Tween;
import mx.transitions.easing.*;
class code.Crawlie2 extends MovieClip {
private var Walker:Tween;
public function StartWalking(){
Walker = new Tween(this, "_x",None.easeNone,this._x,this._x +
200,1,true);
Walker.onMotionFinished = function(){this.yoyo();};
};
};
--------------------------------------
frame 1, symbol named btn on the stage, the following as a frame script:
--------------------------------------
btn.onPress = function() {
_root.test.removeMovieClip();
_root.test.unloadMovie();
_root.gotoAndPlay("part2");
}
_root.attachMovie("idRedbelly1","test",_root.getNextHighestDepth(),{_x:50,_y:50});
_root.test.StartWalking();
stop();
--------------------------------------
frame 10 with marker name of "part2", following frame script:
--------------------------------------
_root.attachMovie("idRedbelly1","test",_root.getNextHighestDepth(),{_x:50,_y:25});
_root.test.StartWalking();
stop();
--------------------------------------
I also tried a version that set Walker to null before i unloaded the
MC but that didn't work either.
Any help is greatly appreciated,
--
:: Nik Derewianka ::
:: freelance director programmer ::
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
Weldon MacDonald
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com