Is this any quicker/simpler? Optimisation tennis, anyone?
var result = { outputNumber:Math.random() };
function (__number outputNumber) main ()
{
return result;
}
On 1 Aug 2008, at 00:00, Christopher Wright wrote:
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/
_______________________________________________
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/adrian%40clayinteractive.co.uk
This email sent to [EMAIL PROTECTED]
_______________________________________________
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]