- Impact
- 5
The Tween function is not working... can anyone tell me what is messed up??!
thanks
thanks
PHP:
if (_global.$tweenManager == undefined)
{
_global.$tweenManager = new zigo.tweenManager();
}
else
{
_global.$tweenManager.cleanUp();
_global.$tweenManager.init();
} // end if
com.robertpenner.easing.Back;
com.robertpenner.easing.Bounce;
com.robertpenner.easing.Circ;
com.robertpenner.easing.Cubic;
com.robertpenner.easing.Elastic;
com.robertpenner.easing.Expo;
com.robertpenner.easing.Linear;
com.robertpenner.easing.Quad;
com.robertpenner.easing.Quart;
com.robertpenner.easing.Quint;
com.robertpenner.easing.Sine;
var Mp = MovieClip.prototype;
Mp.addListener = function ()
{
if (!this._listeners)
{
AsBroadcaster.initialize(this);
} // end if
this.addListener.apply(this, args);
};
ASSetPropFlags(Mp, "addListener", 1, 0);
Mp.tween = function (props, pEnd, seconds, animType, delay, callback, extra1, extra2)
{
if (_global.$tweenManager.isTweenLocked(this))
{
trace("tween not added, this movieclip is locked");
return(undefined);
} // end if
if (arguments.length < 2)
{
trace("tween not added, props & pEnd must be defined");
return(undefined);
} // end if
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
props = props.split(" ").join("").split(",");
}
else
{
props = [props];
} // end if
} // end if
if (!(pEnd instanceof Array))
{
pEnd = [pEnd];
while (pEnd.length < props.length)
{
pEnd.push(pEnd[0]);
} // end while
} // end if
if (seconds == undefined)
{
seconds = 2;
}
else if (seconds < 0.010000)
{
seconds = 0;
} // end if
if (delay < 0.010000 || delay == undefined)
{
delay = 0;
} // end if
switch (typeof(animType))
{
case "string":
{
animType = animType.toLowerCase();
if (animType == "linear")
{
var eqf = com.robertpenner.easing.Linear.easeNone;
}
else if (animType.indexOf("easeoutin") == 0)
{
var t = animType.substr(9);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeOutIn;
}
else if (animType.indexOf("easeinout") == 0)
{
var t = animType.substr(9);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeInOut;
}
else if (animType.indexOf("easein") == 0)
{
var t = animType.substr(6);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeIn;
}
else if (animType.indexOf("easeout") == 0)
{
var t = animType.substr(7);
t = t.charAt(0).toUpperCase() + t.substr(1);
var eqf = com.robertpenner.easing[t].easeOut;
} // end if
if (eqf == undefined)
{
var eqf = com.robertpenner.easing.Expo.easeOut;
} // end if
break;
}
case "function":
{
var eqf = animType;
break;
}
case "object":
{
if (animType.ease != undefined && animType.pts != undefined)
{
var eqf = animType.ease;
extra1 = animType.pts;
}
else
{
var eqf = com.robertpenner.easing.Expo.easeOut;
} // end if
break;
}
default:
{
var eqf = com.robertpenner.easing.Expo.easeOut;
}
} // End of switch
switch (typeof(callback))
{
case "function":
{
callback = {func: callback, scope: this._parent};
break;
}
case "string":
{
var ilp;
var funcp;
var scope;
var args;
var a;
ilp = callback.indexOf("(");
funcp = callback.slice(0, ilp);
scope = funcp.slice(0, funcp.lastIndexOf("."));
func = funcp;
args = callback.slice(ilp + 1, callback.lastIndexOf(")")).split(",");
var i = 0;
while (i < args.length)
{
a = args[i];
if (a != undefined)
{
args[i] = a;
} // end if
i++;
} // end while
callback = {func: func, scope: scope, args: args};
break;
}
} // End of switch
if (_global.$tweenManager.autoStop)
{
_global.$tweenManager.removeTween(this);
} // end if
if (delay > 0)
{
_global.$tweenManager.addTweenWithDelay(delay, this, props, pEnd, seconds, eqf, callback, extra1, extra2);
}
else
{
_global.$tweenManager.addTween(this, props, pEnd, seconds, eqf, callback, extra1, extra2);
} // end if
};
Mp.stopTween = function (props)
{
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
var _l3 = props.split(" ").join("").split(",");
}
else
{
_l3 = [_l3];
} // end if
} // end if
_global.$tweenManager.removeTween(this, _l3);
};
Mp.isTweening = function (prop)
{
return(_global.$tweenManager.isTweening(this, prop));
};
Mp.getTweens = function ()
{
return(_global.$tweenManager.getTweens(this));
};
Mp.lockTween = function ()
{
_global.$tweenManager.lockTween(this, true);
};
Mp.unlockTween = function ()
{
_global.$tweenManager.lockTween(this, false);
};
Mp.isTweenLocked = function ()
{
return(_global.$tweenManager.isTweenLocked(this));
};
Mp.isTweenPaused = function (prop)
{
return(_global.$tweenManager.isTweenPaused(this, prop));
};
Mp.pauseTween = function (props)
{
var _l4;
if (props != undefined)
{
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
var _l3 = props.split(" ").join("").split(",");
}
else
{
_l3 = [_l3];
} // end if
} // end if
_l4 = {};
while (_l3 != null)
{
var _l5 = _l3;
_l4[_l3[_l5]] = true;
} // end while
} // end if
_global.$tweenManager.pauseTween(this, _l4);
};
Mp.unpauseTween = function (props)
{
var _l4;
if (props != undefined)
{
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
var _l3 = props.split(" ").join("").split(",");
}
else
{
_l3 = [_l3];
} // end if
} // end if
_l4 = {};
while (_l3 != null)
{
var _l5 = _l3;
_l4[_l3[_l5]] = true;
} // end while
} // end if
_global.$tweenManager.unpauseTween(this, _l4);
};
Mp.pauseAllTweens = function ()
{
_global.$tweenManager.pauseTween();
};
Mp.unpauseAllTweens = function ()
{
_global.$tweenManager.unpauseTween();
};
Mp.stopAllTweens = function ()
{
_global.$tweenManager.stopAll();
};
Mp.ffTween = function (props)
{
var _l4;
if (props != undefined)
{
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
var _l3 = props.split(" ").join("").split(",");
}
else
{
_l3 = [_l3];
} // end if
} // end if
_l4 = {};
while (_l3 != null)
{
var _l5 = _l3;
_l4[_l3[_l5]] = true;
} // end while
} // end if
_global.$tweenManager.ffTween(this, _l4);
};
Mp.rewTween = function (props)
{
var _l4;
if (props != undefined)
{
if (typeof(props) == "string")
{
if (props.indexOf(",") > -1)
{
var _l3 = props.split(" ").join("").split(",");
}
else
{
_l3 = [_l3];
} // end if
} // end if
_l4 = {};
while (_l3 != null)
{
var _l5 = _l3;
_l4[_l3[_l5]] = true;
} // end while
} // end if
_global.$tweenManager.rewTween(this, _l4);
};
Mp.alphaTo = function (destAlpha, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_alpha"], [destAlpha], seconds, animType, delay, callback, extra1, extra2);
};
Mp.scaleTo = function (destScale, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_xscale", "_yscale"], [destScale, destScale], seconds, animType, delay, callback, extra1, extra2);
};
Mp.sizeTo = function (destSize, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_width", "_height"], [destSize, destSize], seconds, animType, delay, callback, extra1, extra2);
};
Mp.slideTo = function (destX, destY, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_x", "_y"], [destX, destY], seconds, animType, delay, callback, extra1, extra2);
};
Mp.rotateTo = function (destRotation, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_rotation"], [destRotation], seconds, animType, delay, callback, extra1, extra2);
};
_global.getColorTransObj = function (type, amt, rgb)
{
switch (type)
{
case "brightness":
{
var _l4 = 100 - Math.abs(amt);
var _l6 = 0;
if (amt > 0)
{
_l6 = 256 * (amt / 100);
} // end if
return({ra: _l4, rb: _l6, ga: _l4, gb: _l6, ba: _l4, bb: _l6});
}
case "brightOffset":
{
_l6 = 256 * (amt / 100);
return({ra: 100, rb: _l6, ga: 100, gb: _l6, ba: 100, bb: _l6});
}
case "contrast":
{
var _l2 = {};
_l2.ra = _l2.ga = _l2.ba = amt;
_l2.rb = _l2.gb = _l2.bb = 128 - 1.280000 * amt;
return(_l2);
}
case "invertColor":
{
_l2 = {};
_l2.ra = _l2.ga = _l2.ba = 100 - 2 * amt;
_l2.rb = _l2.gb = _l2.bb = amt * 2.550000;
return(_l2);
}
case "tint":
{
if (rgb == undefined || rgb == null)
{
break;
} // end if
var _l8 = rgb >> 16;
var _l9 = rgb >> 8 & 255;
var _l7 = rgb & 255;
var _l5 = amt / 100;
_l2 = {rb: _l8 * _l5, gb: _l9 * _l5, bb: _l7 * _l5};
_l2.ra = _l2.ga = _l2.ba = 100 - amt;
return(_l2);
}
} // End of switch
return({rb: 0, ra: 100, gb: 0, ga: 100, bb: 0, ba: 100});
};
Mp.brightnessTo = function (bright, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("brightness", bright)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.brightOffsetTo = function (percent, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("brightOffset", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.contrastTo = function (percent, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("contrast", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.colorTo = function (rgb, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("tint", 100, rgb)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.colorTransformTo = function (ra, rb, ga, gb, ba, bb, aa, ab, seconds, animType, delay, callback, extra1, extra2)
{
var _l2 = {ra: ra, rb: rb, ga: ga, gb: gb, ba: ba, bb: bb, aa: aa, ab: ab};
this.tween(["_ct_"], [_l2], seconds, animType, delay, callback, extra1, extra2);
};
Mp.invertColorTo = function (percent, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("invertColor", percent)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.tintTo = function (rgb, percent, seconds, animType, delay, callback, extra1, extra2)
{
this.tween(["_ct_"], [getColorTransObj("tint", percent, rgb)], seconds, animType, delay, callback, extra1, extra2);
};
Mp.getFrame = function ()
{
return(this._currentframe);
};
Mp.setFrame = function (fr)
{
this.gotoAndStop(Math.round(fr));
};
Mp.addProperty("_frame", Mp.getFrame, Mp.setFrame);
Mp.frameTo = function (endframe, duration, animType, delay, callback, extra1, extra2)
{
if (endframe == undefined)
{
var _l2 = this._totalframes;
} // end if
this.tween("_frame", _l2, duration, animType, delay, callback, extra1, extra2);
};
var TFP = TextField.prototype;
if (!TFP.origAddListener)
{
TFP.origAddListener = TFP.addListener;
ASSetPropFlags(TFP, "origAddListener", 1, 0);
TFP.addListener = function ()
{
if (!this._listeners)
{
AsBroadcaster.initialize(this);
} // end if
this.origAddListener.apply(this, args);
};
} // end if
var $_$methods = ["tween", "stopTween", "isTweening", "getTweens", "lockTween", "isTweenLocked", "unlockTween", "isTweenPaused", "pauseTween", "unpauseTween", "pauseAllTweens", "unpauseAllTweens", "stopAllTweens", "ffTween", "rewTween", "getFrame", "setFrame", "_frame", "frameTo", "alphaTo", "brightnessTo", "colorTo", "colorTransformTo", "invertColorTo", "tintTo", "scaleTo", "sizeTo", "slideTo", "rotateTo", "brightOffsetTo", "contrastTo"];
for (var $_$i in $_$methods)
{
ASSetPropFlags(Mp, $_$methods[$_$i], 1, 0);
if ($_$methods[$_$i].toLowerCase().indexOf("frame") == -1)
{
TFP[$_$methods[$_$i]] = Mp[$_$methods[$_$i]];
ASSetPropFlags(TFP, $_$methods[$_$i], 1, 0);
} // end if
} // end of for...in
delete Mp;
delete TFP;
delete $_$methods;
delete $_$i;
about.alphaTo(100, 1, "linear", 0.500000);
store.alphaTo(100, 1, "linear", 1);
products.alphaTo(100, 1, "linear", 1.500000);
gifts.alphaTo(100, 1, "linear", 2);
weddings.alphaTo(100, 1, "linear", 2.500000);
events.alphaTo(100, 1, "linear", 3);
press2.alphaTo(100, 1, "linear", 3.500000);
contact.alphaTo(100, 1, "linear", 4);
about.onRelease = function ()
{
getURL("about.html");
};
store.onRelease = function ()
{
getURL("/shop/store.cfm");
};
products.onRelease = function ()
{
getURL("products.html");
};
gifts.onRelease = function ()
{
getURL("gift_bouquets.html");
};
weddings.onRelease = function ()
{
getURL("weddings.html");
};
events.onRelease = function ()
{
getURL("events.html");
};
press2.onRelease = function ()
{
getURL("press.html");
};
contact.onRelease = function ()
{
getURL("contact.html");
};















