@@ -324,17 +324,21 @@ lib.pause = function( whatToPause )
324
324
if targetType and not tween ._generatedByComposer then
325
325
if targetType == " all" then
326
326
tween ._paused = true
327
+ tween ._resume = false
327
328
elseif targetType == " tag" then
328
329
if tween .tag == iterationTarget then
329
330
tween ._paused = true
331
+ tween ._resume = false
330
332
end
331
333
elseif targetType == " displayobject" then
332
334
if tween ._target == iterationTarget then
333
335
tween ._paused = true
336
+ tween ._resume = false
334
337
end
335
338
elseif targetType == " transition" then
336
339
if tween == iterationTarget then
337
340
tween ._paused = true
341
+ tween ._resume = false
338
342
end
339
343
end
340
344
end
@@ -374,29 +378,33 @@ lib.resume = function( whatToResume )
374
378
-- iterate the table
375
379
376
380
local transitionTable = lib ._transitionTable
381
+
377
382
-- if enterframe was run already, if we have any running tweens they won't be in the lib._transitionTable variable, but in lib._enterFrameTweens
378
383
if # transitionTable == 0 then
379
384
transitionTable = lib ._enterFrameTweens
380
385
end
381
386
382
387
for i ,tween in ipairs ( transitionTable ) do
383
- -- check for any cancel lib variables
384
- -- only cancel if the tween was not generated by the composer library
385
- local shouldResumeTween = false
388
+ -- check for any resume lib variables
389
+ -- only resume if the tween was not generated by the composer library
386
390
if targetType and not tween ._generatedByComposer then
387
391
if targetType == " all" then
388
392
tween ._resume = true
393
+ tween ._paused = false
389
394
elseif targetType == " tag" then
390
395
if tween .tag == iterationTarget then
391
396
tween ._resume = true
397
+ tween ._paused = false
392
398
end
393
399
elseif targetType == " displayobject" then
394
400
if tween ._target == iterationTarget then
395
401
tween ._resume = true
402
+ tween ._paused = false
396
403
end
397
404
elseif targetType == " transition" then
398
405
if tween == whatToResume then
399
406
tween ._resume = true
407
+ tween ._paused = false
400
408
end
401
409
end
402
410
end
@@ -471,7 +479,7 @@ function lib:enterFrame ( event )
471
479
-- create a local copy of the transition table, to avoid a race condition
472
480
local currentActiveTweens = lib ._transitionTable
473
481
lib ._enterFrameTweens = lib ._transitionTable
474
-
482
+
475
483
lib ._transitionTable = {}
476
484
477
485
-- get the current event time
@@ -482,7 +490,6 @@ function lib:enterFrame ( event )
482
490
483
491
-- iterate the transition table
484
492
for i ,tween in ipairs ( currentActiveTweens ) do
485
-
486
493
-- if the transition object is paused
487
494
if tween ._paused then
488
495
-- handle tweens marked as paused
@@ -511,7 +518,7 @@ function lib:enterFrame ( event )
511
518
512
519
-- nil out the lastPausedTime variable of the transition object
513
520
tween ._lastPausedTime = nil
514
- tween ._paused = false
521
+ tween ._paused = nil
515
522
516
523
-- dispatch the onResume method on the object
517
524
local listener = tween ._onResume
0 commit comments