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: Global variables inside JS



I suggest using the "Object" object instead. I don't recommend using the "this" object, since it causes QC to crash when used in the with(this){} construct. It sometimes crashes if you even try to type that!

Note that this isn't a global variable -- different patches won't see it. But it allows you to store a variable within a patch from iteration to iteration. See: 
http://www.quartzcompositions.com/phpBB2/viewtopic.php?t=95

I haven't tried to look for pre-existing properties in the object yet. I suspect you won't find anything interesting since 99% of QC won't exist within the _javascript_ paradigm.

Dan Neuman
Ottawa

On 28 Feb06, at 02:34|28Feb, Roger Bolton wrote:

someone was asking a while ago about global variable inside _javascript_ in quartz composer,


I noticed someone had posted on the quartzcompositions forums that this is possible,


just use the "this" object e.g


this.foo = 2;


creates a "foo" property with the value 2 on the runtime object, which is kept among executions of the patch


 _______________________________________________
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



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.