We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
eval (Read 1074 times)
eval
Jun 24th, 2005, 9:45pm
 
hello everybody
as you can guess for my question, at the moment i'm a little more comfortable with flash, but hope soon it'll change

how do i make something similar to the eval function
i mean i need to make dinamic references to stored data and don't know how
in flash every object is an array of it's parent object and can evaluate data the way parentObject.["someName"+ index] where index can be a number
thanks a lot
Re: eval
Reply #1 - Jun 25th, 2005, 2:58am
 
i would sugest to make an array for somename, then just use the index as the array index, or if it needs to be arbitary, you van look in to Hashtables or Vectors, but that would be slightly more difficult (and complicated!)

In processing arrays have to have a set size, so you would have to know a limit to the index variable. Vectors on the other hand, can expand as needed. Hashtables are like using associative arrays in flash, where you use, say a string instead of a number as array access

Java references
Vector: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html

Hashtable: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Hashtable.html
Page Index Toggle Pages: 1