Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print a random integer - Works in Screen Savers



On Aug 2, 2005, at 8:02 PM, Sam Bauers wrote:

I've read through the list so far and noticed earlier a problem people had generating random numbers in screen savers. I have written a small macro that seems to work in both QC and as a screen saver, so I thought I'd share.

The only problem is it generates the same numbers each time you launch the screen saver. :)


You can use the System Time patch to make unique random numbers for each launch (e.g., system time modulo 1.0), but there's some kind of disconnect between System Time and Javascript in the screen saver environment, so if you try to use Javascript to store this number, you get NaN instead. But only as a screen saver--in QC it works fine, oddly enough.

-D

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >Print a random integer - Works in Screen Savers (From: Sam Bauers <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.