GetChildIndex doesn't work like that, unfortaly it seems that getChildIndex
doesn't exist in away3d library.
I just want to get the index value of a object3d! When i click on the
object3d:
CubeOne: 0;
CubeTwo: 1;
Total number of childrem: 2!
Error: 1061: Call to a possibly undefined method getChildIndex through a
reference with static type away3d.containers:ObjectContainer3D.
I am passing the actual code i use. In the last code i translate the name of
variables for english and i think there was some misinterpretation...
package site
{
import away3d.core.base.Object3D;
import away3d.events.MouseEvent3D;
import caurina.transitions.Tweener;
import flash.display.Sprite;
public class Interacao3D extends Sprite
{
public static function inicializa():void {
//CUBES
Cria3D.cubes1.addOnMouseOver(efeito);
Cria3D.cubes2.addEventListener(MouseEvent3D.MOUSE_OVER, efeito);
Cria3D.cubes3.addEventListener(MouseEvent3D.MOUSE_OVER, efeito);
}
public static function efeito(evento:MouseEvent3D):void {
var objeto:Object3D = evento.object;
trace(Cria3D.conteiner3D.getChildIndex());
var child:Number = Cria3D.conteiner3D.getChildByName(objeto);
Tweener.addTween(objeto,{
width : 100,
height : 100,
depth : 100,
time : 0.5,
transition : "easeOutElastic"
});
}
}
}
2010/4/5 Michael Iv <[email protected]>
>
> Why do you write : Create3D.getChildIndex(object) and not
> :Create3D.getChildIndex(objectIndex)?
> If I get your code correctly the objectIndex is the nested object of the
> Create3D? What is "object"? Where it comes from ?
> Check your code better it seems you have got some variables targeting
> inconsistency .
>
>
>
>
> On Mon, Apr 5, 2010 at 5:54 AM, Evandro Eisinger <
> [email protected]> wrote:
>
>> Hello Guys!
>> I have a very annoying problem. I want to get the index value of
>> object3d (Cube), when i roll over that. But i can't do it!
>> The object's are inside of a conteiner3D.
>>
>> That's my code:
>>
>> public static function start():void {
>> //CUBOS
>> Create3D.cube1.addOnMouseOver(indexValue);
>> Create3D.cube2.addOnMouseOver(indexValue);
>> Create3D.cube3.addOnMouseOver(indexValue);
>> }
>>
>> public static function indexValue(evento:MouseEvent3D):void
>> {
>> var objectIndex:Object3D = evento.object;
>> trace(Create3D.getChildIndex(object));
>> }
>>
>> ...
>>
>> Please help me!
>>
>> Thx a lot guys!
>>
>>
>> --
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air |3D|Unity|
> www.neurotechresearch.com
> Tel:054-4962254
> [email protected]
> [email protected]
> skype:sasmaster1980
>