The script below works during development, and it also works when it's part of a standalone stack (.exe).
But the very same script, when it is part of a stack that's been opened by another stack, will cause a crash when it gets to aeCrossFade gets.
Code: Select all
on mouseUp
// Check if AE is available
if "animationEngine" is not among the lines of the stacksInUse then exit mouseUp
set the cpDigitFadeEffect of this card to true
put "poz-" & field "poz" into tDigitPozGp
put "pt-" & field "out" into tPrevDigitImg
put "pt-" & field "in" into tNewDigitImage
// Check that tPrevDigitImg & tNewDigitImage
// (the two images that will be cross-faded) exist.
if there is not an image tNewDigitImage \
of group tDigitPozGp of group "gpDigits" \
of group "gpPointsAndAlldone2" then
answer "no tNewDigitImage"
else
answer "there is a tNewDigitImage"
end if
if there is not an image tPrevDigitImg \
of group tDigitPozGp of group "gpDigits" \
of group "gpPointsAndAlldone2" then
answer "no tPrevDigitImg"
else
answer "there is a tPrevDigitImg"
end if
// The two images exist and AE is running,
// so do the fade.
aeCrossFade \
the long ID of image tNewDigitImage \
of group tDigitPozGp of group "gpDigits" \
of group "gpPointsAndAlldone2", \
the long ID of image tPrevDigitImg \
of group tDigitPozGp of group "gpDigits" \
of group "gpPointsAndAlldone2", \
200
wait until the cpDigitFadeEffect of this card is false with messages
end mouseUp
on aeCrossFadeDone
set the cpDigitFadeEffect of this card to false
end aeCrossFadeDone
At first I thought the problem might be references to image objects, which happen to be embedded in groups withing groups (withing groups!). Which is why the script includes "if there is" twice.
There are other AE functions in the same stack (aeChangeRect and aeFadeOut), and these work no problem.
Any ideas?
Thank you.
--
Nicolas Cueto