Hi Aji,
I did use the push method - is there an issue with that?
tracing sn.y does correctly trace the y value, but the sprites still don't
update in the render. And now, the STRANGEST thing; after reading Nick's
post, I took out the IF statement:
for each(var sn :Sprite3D in snowflakes)
{
// var sn :Sprite3D = snowflakes[i];
sn.y -= 10;
// if(sn.y < 0)
// {
// sn.y = 300;
// }
// trace("updating",sn.y,"flakes");
}
and that worked!
Then just by putting the trace statement back in it doesn't?!
So following from that I tried putting the IF statement before everything
else:
for each(var sn :Sprite3D in snowflakes)
{
if(sn.y < 0)
{
sn.y = 300;
}
// var sn :Sprite3D = snowflakes[i];
sn.y -= 10;
// tr("updating",sn.y,"flakes");
}
and that WORKS!
completely bizarre.
Kevin.
On Wed, Nov 3, 2010 at 8:12 AM, Aji Pamungkas
<[email protected]>wrote:
> Hello Kevin,
>
> Did you use push method on your snowflakes array ?
>
> Or have you tried this :
> for each (var sn:Sprite3D in snowflakes)
>
> {
> sn.y -=10;
> if(sn.y < 0)
> {
> sn.y = 300;
> }
> trace(sn.y);
> }
>
>
>
> --
> Aji Pamungkas
>
> On Wed, Nov 3, 2010 at 8:58 AM, Aji Pamungkas <
> [email protected]> wrote:
>
>> Hello Nick,
>>
>> The question is, what would you do if they stop ? Currently, you just set
>> them to stay at the same position.
>>
>> For example, let's say object mcs number 0 (arrayOf3DAssets[0]), at frame
>> n, it's absolute value of deltaX, deltaY and deltaZ are less than 0.1, and
>> you set :
>> arrayOf3DAssets[0].x = newPosX = changingArrayOfXYZLocations[0][0];
>> arrayOf3DAssets[0].y = newPosY = changingArrayOfXYZLocations[0][1];
>> arrayOf3DAssets[0].z = newPosZ = changingArrayOfXYZLocations[0][2];
>>
>> Next Frame, at frame n+1,
>> deltaX = arrayOf3DAssets[0].x - changingArrayOfXYZLocations[0][0];
>> deltaY = arrayOf3DAssets[0].y - changingArrayOfXYZLocations[0][1];
>> deltaZ = arrayOf3DAssets[0].z - changingArrayOfXYZLocations[0][2];
>>
>> Obviously, deltaX, deltaY and deltaZ are 0. Why ?
>> Because x,y,z value of arrayOf3DAssets[0] has the same value with [0],
>> [1] and [2] of changingArrayOfXYZLocations[0]. And because 0 is less than
>> 0.1, arrayOf3DAssets[0] will do this again :
>> arrayOf3DAssets[0].x = newPosX = changingArrayOfXYZLocations[0][0];
>> arrayOf3DAssets[0].y = newPosY = changingArrayOfXYZLocations[0][1];
>> arrayOf3DAssets[0].z = newPosZ = changingArrayOfXYZLocations[0][2];
>>
>> again, again and again in the next frames. arrayOf3DAssets[0] will never
>> move, until you change the value in :
>> changingArrayOfXYZLocations[0][0];
>> changingArrayOfXYZLocations[0][1];
>> changingArrayOfXYZLocations[0][2];
>>
>>
>> --
>> Aji Pamungkas
>>
>> On Wed, Nov 3, 2010 at 7:18 AM, Nick <[email protected]> wrote:
>>
>>> I'm having a similar issue with MovieClipSprite in v3.6.0 They move
>>> initially, but as soon as they get to where they're going, they won't
>>> move anymore. As long as they keep moving, they'll continue to accept
>>> a new location (from changingArrayOfXYZLocations) and move to it. But
>>> as soon as they stop moving, that's it, they refuse to move anymore.
>>> There will be a few assets on stage and some will move while the
>>> others stop. If I take out the lines that set the assets specifically
>>> to where they're going when they get close and instead never let them
>>> get to their destination, then they keep working as expected.
>>>
>>> var mcs:MovieClipSprite;
>>>
>>> var deltaX:Number;
>>> var stepX:Number;
>>> var newPosX:Number;
>>> var deltaY:Number;
>>> var stepY:Number;
>>> var newPosY:Number;
>>> var deltaZ:Number;
>>> var stepZ:Number;
>>> var newPosZ:Number;
>>>
>>> for (i = 0; i < arrayOf3DAssets.length; i++)
>>> {
>>> mcs = arrayOf3DAssets[i];
>>>
>>> deltaX = mcs.x - changingArrayOfXYZLocations[i][0];
>>> stepX = deltaX / SPEED;
>>> newPosX = mcs.x - stepX;
>>> deltaY = mcs.y - changingArrayOfXYZLocations[i][1];
>>> stepY = deltaY / SPEED;
>>> newPosY = mcs.y - stepY;
>>> deltaZ = mcs.z - changingArrayOfXYZLocations[i][2];
>>> stepZ = deltaZ / SPEED;
>>> newPosZ = mcs.z - stepZ;
>>>
>>> if (Math.abs(deltaX) < .1) newPosX =
>>> changingArrayOfXYZLocations[i]
>>> [0];
>>> if (Math.abs(deltaY) < .1) newPosY =
>>> changingArrayOfXYZLocations[i]
>>> [1];
>>> if (Math.abs(deltaZ) < .1) newPosZ =
>>> changingArrayOfXYZLocations[i]
>>> [2];
>>>
>>> mcs.x = newPosX;
>>> mcs.y = newPosY;
>>> mcs.z = newPosZ;
>>> }
>>>
>>> _camera3D.hover();
>>> _view.render();
>>>
>>> Any thoughts or suggestions?
>>>
>>> Thanks, Nick
>>
>>
>>
>
>
>