I am looking to generate a random value at the start of a composition and have it remain static until the composition stops and starts again. I'm assuming JavaScript would be an easy way to do this, and here's what I'm trying so far, to no avail. Any suggestions? I messed around with a sample and hold patch, but couldn't get it to grab fast enough that the value didn't change a bit at the start.

Try this as your javascript code:

var hasRun = false;
var result = new Object();
function (__number outputNumber) main ()
{
        if(!hasRun)
                result.outputNumber = Math.random();
        if(!_testMode)
                hasRun = true;
        return result;
}

should output a single random number, and then never do anything until the composition restarts.

--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to