elveatles
08-05-2008, 09:04 PM
Hello,
I'm trying to figure out how I can use a for in loop to change all the boolean values of many instances of a custom class all at the same time.
for(var i:Boid in boidArray)
{
i.go = goBool;
}
With this little bit of code, the goBool would equal true onMouseDown and false onMouseUp. So in turn, all the instances of the Boid class would be true onMouseDown and false onMouseUp.
Instead it gives me the error 1067:Implicit coercion of a value of type string to an unrelated type Boid.
The Boid class already exists and so does the "go" boolean. What are your thoughts?
I'm trying to figure out how I can use a for in loop to change all the boolean values of many instances of a custom class all at the same time.
for(var i:Boid in boidArray)
{
i.go = goBool;
}
With this little bit of code, the goBool would equal true onMouseDown and false onMouseUp. So in turn, all the instances of the Boid class would be true onMouseDown and false onMouseUp.
Instead it gives me the error 1067:Implicit coercion of a value of type string to an unrelated type Boid.
The Boid class already exists and so does the "go" boolean. What are your thoughts?