Scripted Motion alternates
I defined 2 different motions for an object in Flash, saved them as Presets and then copied each as Actionscript 3.0 and
pasted them seperately into a code frame 2 on my timeline. I was thinking that with Actionscript I should be able to select
between two motions given certain conditions.
Here's what I got:
var __animFactory_digitB1_mc:AnimatorFactory;
var __motion_digitB1_mc:MotionBase;
if (theProblem.getNum(2,0).length == 1) { // motion B1_12()
...
else { // NumberB.length > 1
if(__motion_digitB1_mc == null) { // motion B1_21()
__motion_digitB1_mc = new Motion();
__motion_digitB1_mc.duration = 11;
trace("B1_21 - null");
__motion_digitB1_mc.addPropertyArray("x", [0,8.14801,15.818,22.9697,29.5378,35.4456,40.6136,44.967,48.4119,50.8517,52.2]);
__motion_digitB1_mc.addPropertyArray("y", [0,-13.9714,-28.1932,-42.6989,-57.4889,-72.5474,-87.8582,-103.435,-119.244,-135.226,-151.35]);
__motion_digitB1_mc.addPropertyArray("scaleX", [1.000000]);
__motion_digitB1_mc.addPropertyArray("scaleY", [1.000000]);
__motion_digitB1_mc.addPropertyArray("skewX", [0]);
__motion_digitB1_mc.addPropertyArray("skewY", [0]);
__motion_digitB1_mc.addPropertyArray("rotationConcat", [0,36,72,108,144,180,216,252,288,324,360]);
__motion_digitB1_mc.addPropertyArray("blendMode", ["normal"]);
__motion_digitB1_mc.addPropertyArray("cacheAsBitmap", [false]);
__animFactory_digitB1_mc = new AnimatorFactory(__motion_digitB1_mc);
__animFactory_digitB1_mc.transformationPoint = new Point(0.500000, 0.500000);
} // end null
...
There was a flash motion already defined for the digitB1_mc. The trace statement fired showing this code was
executed. But the default flash motion executed, not this one. I know that at previous times, I have fooled around and got similar code to work. But why not this? It's like it ignores this motion altogether.
Note also: When I remove the default Flash motion and run the test, digitB1_mc does NOT move at all, again
ignoring this code(which the trace stmt says is executing).
What's going on?
Thanks
