Flash Newbie trying to stop previous tween and onRollOver function onPress. I have gotten it to a point where it is stopping the onRollOver but it is stopping after the first rollover rather than onPress.
Here is my code, i have commented out the problem areas:
import mx.transitions.;
import mx.transitions.easing.;
import mx.transitions.Tween.*;
this.createEmptyMovieClip(“timer_mc”, this.getNextHighestDepth());
var mcl_obj9:Object = new Object();
mcl_obj9.onLoadInit = function(target9_mc:MovieClip) {
target9_mc._x = 410;
target9_mc._y = 10;
TransitionManager.start(target9_mc,{type:Fly, direction:Transition.IN, duration:1, easing:Elastic.easeInOut, startPoint:6});
var ogYScale = target9_mc._yscale;
var ogXScale = target9_mc._xscale;
new mx.transitions.Tween(target9_mc, "_xscale", mx.transitions.easing.Strong.easeOut, ogXScale, ogXScale-38, 30, false);
new mx.transitions.Tween(target9_mc, "_yscale", mx.transitions.easing.Strong.easeOut, ogYScale, ogYScale-38, 30, false);
target9_mc.onRollOver = function():Void {
var mcXScale:Tween = new Tween(target9_mc, "_xscale", Elastic.easeOut, 60, 64, 4, true);
var mcYScale:Tween = new Tween(target9_mc, "_yscale", Elastic.easeOut, 60, 64, 4, true);
//mcXScale.stop();
//mcYScale.stop();
};
target9_mc.onPress = function():Void {
//target9_mc.onRollOver = null;
target9_mc._y += 5;
target9_mc._x += 5;
target9_mc._xscale += 5;
target9_mc._yscale += 5;
if (target9_mc._x >= 300) {
target9_mc._x = 475;
}
if (target9_mc._y >= -1) {
target9_mc._y = 40;
}
if (target9_mc._xscale <= 150) {
target9_mc._xscale = 200;
}
if (target9_mc._yscale <= 150) {
target9_mc._yscale = 200;
}
target9_mc.onRollOver = function():Void {
target9_mc.spin_mc.gotoAndPlay();
}
};
};
var my_mcl9:MovieClipLoader = new MovieClipLoader();
my_mcl9.addListener(mcl_obj9);
my_mcl9.loadClip(“bottlebuild9.png”,this.createEmptyMovieClip(“img9_mc”, this.getNextHighestDepth()));
I tried bringing the mcXScale.stop(); mcYScale.stop(); and a ogXScale.stop(); and ogYScale.stop(); into the onPress function but that is just causing a really strange response. Any help would be great!!! Thanks a lot!!!
Joe