/usr/share/gnome-js/tweener/tweener.js is in gnome-js-common 0.1.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 | /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* Copyright 2008 litl, LLC. All Rights Reserved. */
/**
* Tweener
* Transition controller for movieclips, sounds, textfields and other objects
*
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
* @version 1.31.71
*/
/*
Licensed under the MIT License
Copyright (c) 2006-2007 Zeh Fernando and Nate Chatellier
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
http://code.google.com/p/tweener/
http://code.google.com/p/tweener/wiki/License
*/
//log("Loading tweener.js");
const TweenList = imports.tweener.tweenList;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
var _inited = false;
var _engineExists = false;
var _transitionList = null;
var _tweenList = null;
var _timeScale = 1;
var _specialPropertyList = [];
var _specialPropertyModifierList = [];
var _specialPropertySplitterList = [];
/*
* Ticker should implement:
*
* property FRAME_RATE
* start()
* stop()
* getTime() gets time in milliseconds from start()
* signal prepare-frame
*
*/
var _ticker = null;
var _prepareFrameId = 0;
/* default frame ticker */
function FrameTicker() {
this._init();
}
FrameTicker.prototype = {
FRAME_RATE: 65,
_init : function() {
},
start : function() {
this._currentTime = 0;
var me = this;
this._timeoutID =
Mainloop.timeout_add(Math.floor(1000 / me.FRAME_RATE),
function() {
me._currentTime += 1000 / me.FRAME_RATE;
me.emit('prepare-frame');
return true;
});
},
stop : function() {
if ('_timeoutID' in this) {
Mainloop.source_remove(this._timeoutID);
delete this._timeoutID;
}
this._currentTime = 0;
},
getTime : function() {
return this._currentTime;
}
};
Signals.addSignalMethods(FrameTicker.prototype);
_ticker = new FrameTicker();
/* TODOs:
*
* Special properties:
*
* Special properties are 'proxy' properties used in Tweener to tween
* (animate) things that are not proper properties per se. One example
* given is the 'frame' of an object in ActionScript, which is not an
* object property. Using the special property '_frame' you could animate
* it like this:
*
* Tweener.addTween(myMovieClip, {_frame:20, time:1});
*
* which would be equivalent to applying a fast-forward to it.
*
* This properties need a special support in the code, and I've removed it
* for now until we see the need for it in our clutter based stuff.
*/
/* This is a bit pointless now, but let's keep it anyway... */
function _init() {
if (_inited)
return;
_inited = true;
}
function setFrameTicker(ticker) {
_ticker = ticker;
}
function _startEngine() {
if (_engineExists)
return;
_engineExists = true;
_tweenList = new Array();
if (!_ticker) {
throw new Error("Must call setFrameTicker()");
}
_prepareFrameId = _ticker.connect('prepare-frame',
_onEnterFrame);
_ticker.start();
}
function _stopEngine() {
if (!_engineExists)
return;
_engineExists = false;
_tweenList = false;
_ticker.disconnect(_prepareFrameId);
_prepareFrameId = 0;
_ticker.stop();
}
function _getCurrentTweeningTime(tweening) {
return _ticker.getTime();
}
function _removeTweenByIndex(i) {
_tweenList[i] = null;
var finalRemoval = arguments[1];
if (finalRemoval != undefined && finalRemoval)
_tweenList.splice(i, 1);
return true;
}
function _resumeTweenByIndex(i) {
var tweening = _tweenList[i];
if (tweening == null || !tweening.isPaused)
return false;
var currentTime = _getCurrentTweeningTime(tweening);
tweening.timeStart += currentTime - tweening.timePaused;
tweening.timeComplete += currentTime - tweening.timePaused;
tweening.timePaused = undefined;
tweening.isPaused = false;
return true;
};
/* FIXME: any way to get the function name from the fn itself? */
function _callOnFunction(fn, fnname, scope, fallbackScope, params)
{
if (fn) {
var eventScope = scope ? scope : fallbackScope;
try {
fn.apply(eventScope, params);
} catch (e) {
logError(e, "Error calling " + fnname);
}
}
}
function _updateTweenByIndex(i) {
var tweening = _tweenList[i];
if (tweening == null || !tweening.scope)
return false;
var currentTime = _getCurrentTweeningTime(tweening);
if (currentTime < tweening.timeStart)
return true; // Hasn't started, so return true
var scope = tweening.scope;
var t, b, c, d, nv;
var isOver = false;
if (tweening.isCaller) {
do {
t = ((tweening.timeComplete - tweening.timeStart)/tweening.count) *
(tweening.timesCalled + 1);
b = tweening.timeStart;
c = tweening.timeComplete - tweening.timeStart;
d = tweening.timeComplete - tweening.timeStart;
nv = tweening.transition(t, b, c, d);
if (currentTime >= nv) {
_callOnFunction(tweening.onUpdate, "onUpdate", tweening.onUpdateScope,
scope, tweening.onUpdateParams);
tweening.timesCalled++;
if (tweening.timesCalled >= tweening.count) {
isOver = true;
break;
}
if (tweening.waitFrames)
break;
}
} while (currentTime >= nv);
} else {
var mustUpdate;
if (currentTime >= tweening.timeComplete) {
isOver = true;
mustUpdate = true;
} else {
mustUpdate = tweening.skipUpdates < 1 ||
!tweening.skipUpdates ||
tweening.updatesSkipped >= tweening.skipUpdates;
}
if (!tweening.hasStarted) {
_callOnFunction(tweening.onStart, "onStart", tweening.onStartScope,
scope, tweening.onStartParams);
for (name in tweening.properties) {
var pv;
if (tweening.properties[name].isSpecialProperty) {
// It's a special property, tunnel via the special property function
if (_specialPropertyList[name].preProcess != undefined) {
tweening.properties[name].valueComplete = _specialPropertyList[name].preProcess(scope, _specialPropertyList[name].parameters, tweening.properties[name].originalValueComplete, tweening.properties[name].extra);
}
pv = _specialPropertyList[name].getValue(scope, _specialPropertyList[name].parameters, tweening.properties[name].extra);
} else {
// Directly read property
pv = scope[name];
}
tweening.properties[name].valueStart = isNaN(pv) ? tweening.properties[name].valueComplete : pv;
}
mustUpdate = true;
tweening.hasStarted = true;
}
if (mustUpdate) {
for (name in tweening.properties) {
var property = tweening.properties[name];
if (isOver) {
// Tweening time has finished, just set it to the final value
nv = property.valueComplete;
} else {
if (property.hasModifier) {
// Modified
t = currentTime - tweening.timeStart;
d = tweening.timeComplete - tweening.timeStart;
nv = tweening.transition(t, 0, 1, d, tweening.transitionParams);
nv = property.modifierFunction(property.valueStart, property.valueComplete, nv, property.modifierParameters);
} else {
// Normal update
t = currentTime - tweening.timeStart;
b = property.valueStart;
c = property.valueComplete - property.valueStart;
d = tweening.timeComplete - tweening.timeStart;
nv = tweening.transition(t, b, c, d, tweening.transitionParams);
}
}
if (tweening.rounded)
nv = Math.round(nv);
if (property.isSpecialProperty) {
// It's a special property, tunnel via the special property method
_specialPropertyList[name].setValue(scope, nv, _specialPropertyList[name].parameters, tweening.properties[name].extra);
} else {
// Directly set property
scope[name] = nv;
}
}
tweening.updatesSkipped = 0;
_callOnFunction(tweening.onUpdate, "onUpdate", tweening.onUpdateScope,
scope, tweening.onUpdateParams);
} else {
tweening.updatesSkipped++;
}
}
if (isOver) {
_callOnFunction(tweening.onComplete, "onComplete", tweening.onCompleteScope,
scope, tweening.onCompleteParams);
}
return !isOver;
}
function _updateTweens() {
if (_tweenList.length == 0)
return false;
for (var i = 0; i < _tweenList.length; i++) {
if (_tweenList[i] == undefined || !_tweenList[i].isPaused) {
if (!_updateTweenByIndex(i))
_removeTweenByIndex(i);
if (_tweenList[i] == null) {
_removeTweenByIndex(i, true);
i--;
}
}
}
return true;
}
/* Ran once every 'frame'. It's the main engine, updates all existing tweenings */
function _onEnterFrame() {
if (!_updateTweens())
_stopEngine();
return true;
};
const restrictedWords = {
time: true,
delay: true,
userFrames: true,
skipUpdates: true,
transition: true,
transitionParams: true,
onStart: true,
onUpdate: true,
onComplete: true,
onOverwrite: true,
onError: true,
rounded: true,
onStartParams: true,
onUpdateParams: true,
onCompleteParams: true,
onOverwriteParams: true,
onStartScope: true,
onUpdateScope: true,
onCompleteScope: true,
onOverwriteScope: true,
onErrorScope: true
};
function _constructPropertyList(obj) {
var properties = new Object();
var modifiedProperties = new Object();
for (var istr in obj) {
if (restrictedWords[istr])
continue;
if (_specialPropertySplitterList[istr] != undefined) {
// Special property splitter
var splitProperties = _specialPropertySplitterList[istr].splitValues(obj[istr], _specialPropertySplitterList[istr].parameters);
for (var i = 0; i < splitProperties.length; i++) {
if (_specialPropertySplitterList[splitProperties[i].name] != undefined) {
var splitProperties2 = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
for (var j = 0; j < splitProperties2.length; j++) {
properties[splitProperties2[j].name] = {
valueStart: undefined,
valueComplete: splitProperties2[j].value,
arrayIndex: splitProperties2[j].arrayIndex,
isSpecialProperty: false
};
}
} else {
properties[splitProperties[i].name] = {
valueStart: undefined,
valueComplete: splitProperties[i].value,
arrayIndex: splitProperties[i].arrayIndex,
isSpecialProperty: false
};
}
}
} else if (_specialPropertyModifierList[istr] != undefined) {
// Special property modifier
var tempModifiedProperties = _specialPropertyModifierList[istr].modifyValues(obj[istr]);
for (var i = 0; i < tempModifiedProperties.length; i++) {
modifiedProperties[tempModifiedProperties[i].name] = {
modifierParameters: tempModifiedProperties[i].parameters,
modifierFunction: _specialPropertyModifierList[istr].getValue
};
}
} else {
properties[istr] = {
valueStart: undefined,
valueComplete: obj[istr]
};
}
}
// Adds the modifiers to the list of properties
for (istr in modifiedProperties) {
if (properties[istr]) {
properties[istr].modifierParameters = modifiedProperties[istr].modifierParameters;
properties[istr].modifierFunction = modifiedProperties[istr].modifierFunction;
}
}
return properties;
}
function PropertyInfo(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
this._init(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters);
}
PropertyInfo.prototype = {
_init: function(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
this.valueStart = valueStart;
this.valueComplete = valueComplete;
this.originalValueComplete = originalValueComplete;
this.arrayIndex = arrayIndex;
this.extra = extra;
this.isSpecialProperty = isSpecialProperty;
this.hasModifier = Boolean(modifierFunction);
this.modifierFunction = modifierFunction;
this.modifierParameters = modifierParameters;
}
};
function _addTweenOrCaller(target, tweeningParameters, isCaller) {
if (!target)
return false;
var scopes; // List of objects to tween
if (target instanceof Array) {
// The first argument is an array
scopes = target.concat(); // XXX: To copy the array I guess
} else {
// The first argument(s) is(are) object(s)
scopes = new Array(target);
}
var obj;
if (isCaller) {
obj = tweeningParameters;
} else {
obj = TweenList.makePropertiesChain(tweeningParameters);
var properties = _constructPropertyList(obj);
// Verifies whether the properties exist or not, for warning messages
for (istr in properties) {
if (_specialPropertyList[istr] != undefined) {
properties[istr].isSpecialProperty = true;
} else {
for (var i = 0; i < scopes.length; i++) {
if (scopes[i][istr] == undefined)
log("The property " + istr + " doesn't seem to be a normal object property of " + scopes[i] + " or a registered special property");
}
}
}
}
// Creates the main engine if it isn't active
if (!_inited) _init();
if (!_engineExists) _startEngine();
// Creates a "safer", more strict tweening object
var time = isNaN(obj.time) ? 0 : obj.time;
var delay = isNaN(obj.delay) ? 0 : obj.delay;
var transition;
// FIXME: Tweener allows you to use functions with an all lower-case name
if (typeof obj.transition == "string") {
transition = imports.tweener.equations[obj.transition];
} else {
transition = obj.transition;
}
if (!transition)
transition = imports.tweener.equations["easeOutExpo"];
var tween;
for (var i = 0; i < scopes.length; i++) {
if (!isCaller) {
// Make a copy of the properties
var copyProperties = new Object();
for (istr in properties) {
copyProperties[istr] = new PropertyInfo(properties[istr].valueStart,
properties[istr].valueComplete,
properties[istr].valueComplete,
properties[istr].arrayIndex,
{},
properties[istr].isSpecialProperty,
properties[istr].modifierFunction,
properties[istr].modifierParameters);
}
}
tween = new TweenList.TweenList(scopes[i],
_ticker.getTime() + ((delay * 1000) / _timeScale),
_ticker.getTime() + (((delay * 1000) + (time * 1000)) / _timeScale),
false,
transition,
obj.transitionParams);
tween.properties = isCaller ? null : copyProperties;
tween.onStart = obj.onStart;
tween.onUpdate = obj.onUpdate;
tween.onComplete = obj.onComplete;
tween.onOverwrite = obj.onOverwrite;
tween.onError = obj.onError;
tween.onStartParams = obj.onStartParams;
tween.onUpdateParams = obj.onUpdateParams;
tween.onCompleteParams = obj.onCompleteParams;
tween.onOverwriteParams = obj.onOverwriteParams;
tween.onStartScope = obj.onStartScope;
tween.onUpdateScope = obj.onUpdateScope;
tween.onCompleteScope = obj.onCompleteScope;
tween.onOverwriteScope = obj.onOverwriteScope;
tween.onErrorScope = obj.onErrorScope;
tween.rounded = obj.rounded;
tween.skipUpdates = obj.skipUpdates;
tween.isCaller = isCaller;
if (isCaller) {
tween.count = obj.count;
tween.waitFrames = obj.waitFrames;
}
if (!isCaller) {
// Remove other tweenings that occur at the same time
removeTweensByTime(tween.scope, tween.properties, tween.timeStart, tween.timeComplete);
}
// And finally adds it to the list
_tweenList.push(tween);
// Immediate update and removal if it's an immediate tween
// If not deleted, it executes at the end of this frame execution
if (time == 0 && delay == 0) {
var myT = _tweenList.length-1;
_updateTweenByIndex(myT);
_removeTweenByIndex(myT);
}
}
return true;
};
function addTween(target, tweeningParameters) {
return _addTweenOrCaller(target, tweeningParameters, false);
};
function addCaller(target, tweeningParameters) {
return _addTweenOrCaller(target, tweeningParameters, true);
};
function _getNumberOfProperties(object) {
var totalProperties = 0;
for (var name in object)
totalProperties ++;
return totalProperties;
}
function removeTweensByTime(scope, properties, timeStart, timeComplete) {
var removed = false;
var removedLocally;
for (var i = 0; i < _tweenList.length; i++) {
removedLocally = false;
if (_tweenList[i] &&
scope == _tweenList[i].scope &&
timeComplete > _tweenList[i].timeStart &&
timeStart < _tweenList[i].timeComplete) {
for (name in _tweenList[i].properties) {
if (properties[name]) {
_callOnFunction(_tweenList[i].onOverwrite, "onOverwrite", _tweenList[i].onOverwriteScope,
_tweenList[i].scope, _tweenList[i].onOverwriteParams);
_tweenList[i].properties[name] = undefined;
delete _tweenList[i].properties[name];
removedLocally = true;
removed = true;
}
}
if (removedLocally &&
_getNumberOfProperties(_tweenList[i].properties) == 0) {
_removeTweenByIndex(i);
}
}
}
return removed;
};
function _pauseTweenByIndex(i) {
var tweening = _tweenList[i];
if (tweening == null || tweening.isPaused)
return false;
tweening.timePaused = _getCurrentTweeningTime(tweening);
tweening.isPaused = true;
return true;
};
function _splitTweens(tween, properties) {
var originalTween = _tweenList[tween];
var newTween = originalTween.clone();
for (var i = 0; i < properties.length; i++) {
var name = properties[i];
if (originalTween.properties[name]) {
originalTween.properties[name] = undefined;
delete originalTween.properties[name];
}
}
var found = false;
for (name in newTween.properties) {
found = false;
for (var i = 0; i < properties.length; i++) {
if (properties[i] == name) {
found = true;
break;
}
}
if (!found) {
newTween.properties[name] = undefined;
delete newTween.properties[name];
}
}
_tweenList.push(newTween);
return _tweenList.length - 1;
}
function _affectTweens(affectFunction, scope, properties) {
var affected = false;
if (!_tweenList)
return false;
for (var i = 0; i < _tweenList.length; i++) {
if (!_tweenList[i] || _tweenList[i].scope != scope)
continue;
if (properties.length == 0) {
// Can check everything
affectFunction(i);
affected = true;
} else {
// Must check whether this tween must have specific properties affected
var affectedProperties = new Array();
for (var j = 0; j < properties.length; j++) {
if (_tweenList[i].properties[properties[j]]) {
affectedProperties.push(properties[j]);
}
}
if (affectedProperties.length > 0) {
var objectProperties = _getNumberOfProperties(_tweenList[i].properties);
if (objectProperties == affectedProperties.length) {
// The list of properties is the same as all properties, so affect it all
affectFunction(i);
affected = true;
} else {
// The properties are mixed, so split the tween and affect only certian specific
// properties
var splicedTweenIndex = _splitTweens(i, affectedProperties);
affectFunction(splicedTweenIndex);
affected = true;
}
}
}
}
return affected;
};
function _isInArray(string, array) {
var l = array.length;
for (var i = 0; i < l; i++) {
if (array[i] == string)
return true;
}
return false;
}
function _affectTweensWithFunction(func, args) {
var properties = new Array();
var scope = args[0];
var affected = false;
var scopes;
if (scope instanceof Array) {
scopes = scope.concat();
} else {
scopes = new Array(scope);
}
for (var i = 1; args[i] != undefined; i++) {
if (typeof(args[i]) == "string" && !_isInArray(args[i], properties)) {
if (_specialPropertySplitterList[args[i]]) {
// special property, get splitter array first
var sps = _specialPropertySplitterList[arguments[i]];
var specialProps = sps.splitValues(scope, null);
for (var j = 0; j < specialProps.length; j++)
properties.push(specialProps[j].name);
} else
properties.push(args[i]);
}
}
// the return now value means: "affect at least one tween"
for (var i = 0; i < scopes.length; i++) {
affected = affected || _affectTweens(func, scopes[i], properties);
}
return affected;
}
function resumeTweens() {
return _affectTweensWithFunction(_resumeTweenByIndex, arguments);
};
function pauseTweens() {
return _affectTweensWithFunction(_pauseTweenByIndex, arguments);
};
function removeTweens() {
return _affectTweensWithFunction(_removeTweenByIndex, arguments);
};
function _mapOverTweens(func) {
var rv = false;
if (_tweenList == null)
return false;
for (var i = 0; i < _tweenList.length; i++) {
if (func(i))
rv = true;
}
return rv;
}
function pauseAllTweens() {
return _mapOverTweens(_pauseTweenByIndex);
};
function resumeAllTweens() {
return _mapOverTweens(_resumeTweenByIndex);
};
function removeAllTweens() {
return _mapOverTweens(_removeTweenByIndex);
};
function getTweenCount(scope) {
if (!_tweenList)
return 0;
var c = 0;
for (var i = 0; i < _tweenList.length; i++) {
if (_tweenList[i] && _tweenList[i].scope == scope)
c += _getNumberOfProperties(_tweenList[i].properties);
}
return c;
};
function registerSpecialProperty(name, getFunction, setFunction,
parameters, preProcessFunction) {
_specialPropertyList[name] = {
getValue: getFunction,
setValue: setFunction,
parameters: parameters,
preProcess: preProcessFunction
};
}
function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {
_specialPropertyModifierList[name] = {
modifyValues: modifyFunction,
getValue: getFunction
};
}
function registerSpecialPropertySplitter(name, splitFunction, parameters) {
_specialPropertySplitterList[name] = {
splitValues: splitFunction,
parameters: parameters
};
}
//log("Done loading tweener.js");
|