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: JavaScript and Structures



Answered my own question:

I was trying to set 

params["ScaleX"]= ScaleX;
params["ScaleY"]= ScaleY;

params['MeshRes']= MeshRes;

to variables that hadn't been declared as input ports.
Very silly.

Sorry to have wasted your time guys...

a|x




----- Original Message ----
From: Alex Drinkwater <email@hidden>
To: email@hidden
Sent: Friday, 4 July, 2008 11:54:34 AM
Subject: _javascript_ and Structures

Is there a problem with this JS code:

/*
Creates output structure from inputs
*/

__structure params = new Object();

function (__structure outputStruct) main (__number M,
__number N1,
__number N2,
__number N3,
__number Mb,
__number N1b,
__number N2b,
__number N3b,
__number dummy)
{
var result = new Object();

if(!_testMode) {
// Superformula controls
params["M"]= M;
params["N1"]= N1;
params["N2"]= N2;
params["N3"]= N3;
params["Mb"]= Mb;
params["N1b"]= N1b;
params["N2b"] = N2b;
params["N3b"] = N3b;
// Pre-transform controls
params["ScaleX"]= ScaleX;
params["ScaleY"]= ScaleY;
// Mesh resolution
params['MeshRes']= MeshRes;
}

result.outputStruct = params;
return result;
}

It's basically just taking a load of input values and making a structure out of them. Unfortunately, it seems very unreliably, for some reason. Sometimes it works fine, but just as often, it doesn't seem to produce an output. If I hover the mouse over the output port, I don't get a list of the structure items as I should, and Structure Key Member patches connected to the output aren't receiving any values. I've tried declaring the params __structure both inside and outside the main loop, which doesn't seem to make any difference.

Anyone any thoughts?

I'm using QC 3.0
MacOS 10.5.3
QuickTime 7.5
on a 1st-generation MacBook Pro.

Cheers,

a|x
http://machinesdontcare.wordpress.com


Not happy with your email address?
Get the one you really want - millions of new email addresses available now at Yahoo!


Not happy with your email address?
Get the one you really want - millions of new email addresses available now at Yahoo!
 _______________________________________________
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.