So, I think I got this figured out. QML doesn't support the for each ( ... in ...) construct, just for ( ... in ...), thus requiring me to use subscripts.
----- Original Message ---- From: Jason H <scorp...@yahoo.com> To: Jason H <scorp...@yahoo.com>; qt-qml@trolltech.com Sent: Thu, November 18, 2010 7:47:42 PM Subject: Re: [Qt-qml] QML JS Weirdness Minor correction, when I replace the array in animationSet with the animations parameter, it still doesn't work. (I had tested it that way but in my experiments I accidentally left it when I copied for the message) ----- Original Message ---- From: Jason H <scorp...@yahoo.com> To: qt-qml@trolltech.com Sent: Thu, November 18, 2010 7:44:12 PM Subject: [Qt-qml] QML JS Weirdness The following does not work. However is I replace the animationSet function with individual lines of {animation}.running = {value} then it works. Also please the comment points out an annoyance. Can anyone tell me if I am wong, or if QML is wrong. Qt 4.7.0 function animationSet(animations,value) { for (var animation in [textAnimation, eyeAnimation, eyeOutline, pulseAnimation]) { if (value == false && animation.running == true) // animations, when running== false and re-set to false { // will emit Completed !?!1 animation.running = false; } else { animation.running = true; } } } function start() { stop(); root.visible=true; animationSet([textAnimation, eyeAnimation, eyeOutline, pulseAnimation, mainAnimation], true); console.log("start called for "+ name); } _______________________________________________ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml _______________________________________________ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml