@@ -866,7 +866,6 @@ this.createjs = this.createjs||{};
866866
867867 if ( props ) {
868868 this . pluginData = props . pluginData ;
869- if ( props . override ) { Tween . removeTweens ( target ) ; }
870869 }
871870 if ( ! this . pluginData ) { this . pluginData = { } ; }
872871
@@ -969,41 +968,6 @@ this.createjs = this.createjs||{};
969968 arr . splice ( i , 0 , plugin ) ;
970969 } ;
971970
972- /**
973- * Registers or unregisters a tween with the ticking system.
974- * @method _register
975- * @param {Tween } tween The tween instance to register or unregister.
976- * @param {Boolean } paused If `false`, the tween is registered. If `true` the tween is unregistered.
977- * @static
978- * @protected
979- */
980- Tween . _register = function ( tween , paused ) {
981- var target = tween . target ;
982- if ( ! paused && tween . _paused ) {
983- // TODO: this approach might fail if a dev is using sealed objects
984- if ( target ) { target . tweenjs_count = target . tweenjs_count ? target . tweenjs_count + 1 : 1 ; }
985- var tail = Tween . _tweenTail ;
986- if ( ! tail ) { Tween . _tweenHead = Tween . _tweenTail = tween ; }
987- else {
988- Tween . _tweenTail = tail . _next = tween ;
989- tween . _prev = tail ;
990- }
991- if ( ! Tween . _inited && createjs . Ticker ) { createjs . Ticker . addEventListener ( "tick" , Tween ) ; Tween . _inited = true ; }
992- } else if ( paused && ! tween . _paused ) {
993- if ( target ) { target . tweenjs_count -- ; }
994- var next = tween . _next , prev = tween . _prev ;
995-
996- if ( next ) { next . _prev = prev ; }
997- else { Tween . _tweenTail = prev ; } // was tail
998- if ( prev ) { prev . _next = next ; }
999- else { Tween . _tweenHead = next ; } // was head.
1000-
1001- tween . _next = tween . _prev = null ;
1002- }
1003- tween . _paused = paused ;
1004- } ;
1005-
1006-
1007971// events:
1008972
1009973// public methods:
@@ -1070,61 +1034,6 @@ this.createjs = this.createjs||{};
10701034 return this . _addAction ( scope || this . target , callback , params || [ this ] ) ;
10711035 } ;
10721036
1073- /**
1074- * Adds an action to set the specified props on the specified target. If `target` is null, it will use this tween's
1075- * target. Note that for properties on the target object, you should consider using a zero duration {{#crossLink "Tween/to"}}{{/crossLink}}
1076- * operation instead so the values are registered as tweened props.
1077- * <h4>Example</h4>
1078- *
1079- * myTween.wait(1000).set({visible:false}, foo);
1080- *
1081- * @method set
1082- * @param {Object } props The properties to set (ex. `{visible:false}`).
1083- * @param {Object } [target] The target to set the properties on. If omitted, they will be set on the tween's target.
1084- * @return {Tween } This tween instance (for chaining calls).
1085- * @chainable
1086- */
1087- p . set = function ( props , target ) {
1088- return this . _addAction ( target || this . target , this . _set , [ props ] ) ;
1089- } ;
1090-
1091- /**
1092- * Adds an action to play (unpause) the specified tween. This enables you to sequence multiple tweens.
1093- * <h4>Example</h4>
1094- *
1095- * myTween.to({x:100}, 500).play(otherTween);
1096- *
1097- * @method play
1098- * @param {Tween } [tween] The tween to play. Defaults to this tween.
1099- * @return {Tween } This tween instance (for chaining calls).
1100- * @chainable
1101- */
1102- p . play = function ( tween ) {
1103- return this . _addAction ( tween || this , this . _set , [ { paused :false } ] ) ;
1104- } ;
1105-
1106- /**
1107- * Adds an action to pause the specified tween.
1108- *
1109- * myTween.pause(otherTween).to({alpha:1}, 1000).play(otherTween);
1110- *
1111- * Note that this executes at the end of a tween update, so the tween may advance beyond the time the pause
1112- * action was inserted at. For example:
1113- *
1114- * myTween.to({foo:0}, 1000).pause().to({foo:1}, 1000);
1115- *
1116- * At 60fps the tween will advance by ~16ms per tick, if the tween above was at 999ms prior to the current tick, it
1117- * will advance to 1015ms (15ms into the second "step") and then pause.
1118- *
1119- * @method pause
1120- * @param {Tween } [tween] The tween to pause. Defaults to this tween.
1121- * @return {Tween } This tween instance (for chaining calls)
1122- * @chainable
1123- */
1124- p . pause = function ( tween ) {
1125- return this . _addAction ( tween || this , this . _set , [ { paused :true } ] ) ;
1126- } ;
1127-
11281037 // tiny api (primarily for tool output):
11291038 p . w = p . wait ;
11301039 p . t = p . to ;
@@ -1150,27 +1059,6 @@ this.createjs = this.createjs||{};
11501059
11511060
11521061// private methods:
1153- /**
1154- * Adds a plugin to this tween.
1155- * @method _addPlugin
1156- * @param {Object } plugin
1157- * @protected
1158- */
1159- p . _addPlugin = function ( plugin ) {
1160- var ids = this . _pluginIds || ( this . _pluginIds = { } ) , id = plugin . ID ;
1161- if ( ! id || ids [ id ] ) { return ; } // already added
1162-
1163- ids [ id ] = true ;
1164- var plugins = this . _plugins || ( this . _plugins = [ ] ) , priority = plugin . priority || 0 ;
1165- for ( var i = 0 , l = plugins . length ; i < l ; i ++ ) {
1166- if ( priority < plugins [ i ] . priority ) {
1167- plugins . splice ( i , 0 , plugin ) ;
1168- return ;
1169- }
1170- }
1171- plugins . push ( plugin ) ;
1172- } ;
1173-
11741062 // Docced in AbstractTween
11751063 p . _updatePosition = function ( jump , end ) {
11761064 var step = this . _stepHead . next , t = this . position , d = this . duration ;
@@ -1499,65 +1387,6 @@ this.createjs = this.createjs||{};
14991387 return tween ;
15001388 } ;
15011389
1502- /**
1503- * Removes one or more tweens from this timeline.
1504- * @method removeTween
1505- * @param {Tween } ...tween The tween(s) to remove. Accepts multiple arguments.
1506- * @return Boolean Returns `true` if all of the tweens were successfully removed.
1507- **/
1508- p . removeTween = function ( tween ) {
1509- var l = arguments . length ;
1510- if ( l > 1 ) {
1511- var good = true ;
1512- for ( var i = 0 ; i < l ; i ++ ) { good = good && this . removeTween ( arguments [ i ] ) ; }
1513- return good ;
1514- } else if ( l === 0 ) { return true ; }
1515-
1516- var tweens = this . tweens ;
1517- var i = tweens . length ;
1518- while ( i -- ) {
1519- if ( tweens [ i ] === tween ) {
1520- tweens . splice ( i , 1 ) ;
1521- tween . _parent = null ;
1522- if ( tween . duration >= this . duration ) { this . updateDuration ( ) ; }
1523- return true ;
1524- }
1525- }
1526- return false ;
1527- } ;
1528-
1529- /**
1530- * Recalculates the duration of the timeline. The duration is automatically updated when tweens are added or removed,
1531- * but this method is useful if you modify a tween after it was added to the timeline.
1532- * @method updateDuration
1533- **/
1534- p . updateDuration = function ( ) {
1535- this . duration = 0 ;
1536- for ( var i = 0 , l = this . tweens . length ; i < l ; i ++ ) {
1537- var tween = this . tweens [ i ] ;
1538- var d = tween . duration ;
1539- if ( tween . loop > 0 ) { d *= tween . loop + 1 ; }
1540- if ( d > this . duration ) { this . duration = d ; }
1541- }
1542- } ;
1543-
1544- /**
1545- * Returns a string representation of this object.
1546- * @method toString
1547- * @return {String } a string representation of the instance.
1548- **/
1549- p . toString = function ( ) {
1550- return "[Timeline]" ;
1551- } ;
1552-
1553- /**
1554- * @method clone
1555- * @protected
1556- **/
1557- p . clone = function ( ) {
1558- throw ( "Timeline can not be cloned." )
1559- } ;
1560-
15611390// private methods:
15621391
15631392 // Docced in AbstractTween
@@ -1871,76 +1700,6 @@ this.createjs = this.createjs||{};
18711700 **/
18721701 Ease . backInOut = Ease . getBackInOut ( 1.7 ) ;
18731702
1874- /**
1875- * @method circIn
1876- * @param {Number } t
1877- * @static
1878- * @return {Number }
1879- **/
1880- Ease . circIn = function ( t ) {
1881- return - ( Math . sqrt ( 1 - t * t ) - 1 ) ;
1882- } ;
1883-
1884- /**
1885- * @method circOut
1886- * @param {Number } t
1887- * @static
1888- * @return {Number }
1889- **/
1890- Ease . circOut = function ( t ) {
1891- return Math . sqrt ( 1 - ( -- t ) * t ) ;
1892- } ;
1893-
1894- /**
1895- * @method circInOut
1896- * @param {Number } t
1897- * @static
1898- * @return {Number }
1899- **/
1900- Ease . circInOut = function ( t ) {
1901- if ( ( t *= 2 ) < 1 ) return - 0.5 * ( Math . sqrt ( 1 - t * t ) - 1 ) ;
1902- return 0.5 * ( Math . sqrt ( 1 - ( t -= 2 ) * t ) + 1 ) ;
1903- } ;
1904-
1905- /**
1906- * @method bounceIn
1907- * @param {Number } t
1908- * @static
1909- * @return {Number }
1910- **/
1911- Ease . bounceIn = function ( t ) {
1912- return 1 - Ease . bounceOut ( 1 - t ) ;
1913- } ;
1914-
1915- /**
1916- * @method bounceOut
1917- * @param {Number } t
1918- * @static
1919- * @return {Number }
1920- **/
1921- Ease . bounceOut = function ( t ) {
1922- if ( t < 1 / 2.75 ) {
1923- return ( 7.5625 * t * t ) ;
1924- } else if ( t < 2 / 2.75 ) {
1925- return ( 7.5625 * ( t -= 1.5 / 2.75 ) * t + 0.75 ) ;
1926- } else if ( t < 2.5 / 2.75 ) {
1927- return ( 7.5625 * ( t -= 2.25 / 2.75 ) * t + 0.9375 ) ;
1928- } else {
1929- return ( 7.5625 * ( t -= 2.625 / 2.75 ) * t + 0.984375 ) ;
1930- }
1931- } ;
1932-
1933- /**
1934- * @method bounceInOut
1935- * @param {Number } t
1936- * @static
1937- * @return {Number }
1938- **/
1939- Ease . bounceInOut = function ( t ) {
1940- if ( t < 0.5 ) return Ease . bounceIn ( t * 2 ) * .5 ;
1941- return Ease . bounceOut ( t * 2 - 1 ) * 0.5 + 0.5 ;
1942- } ;
1943-
19441703 /**
19451704 * Configurable elastic ease.
19461705 * @method getElasticIn
0 commit comments