Do you re-render after changing the visibility? Like so:

myView.render();


Cheers
/R



On Apr 25, 11:16 am, jojo <[email protected]> wrote:
> I have 3 .obj files I load in and want to (for now) simply scroll thru
> displaying/hiding them using a button. When I try to hide/show them
> with obj1.visible=false; or obj1.visible=true; via button it simply
> does not work.
>
> //loading 3 files
> obj1 = Obj.load("obj1.obj")
> obj2 = Obj.load("obj1.obj")
> obj3 = Obj.load("obj1.obj")
>
> //add 1st to the scene only
> scene.addChild(obj1);
>
> //create a button
> textBut=new Button();
> addChild(textBut);
>
> // button listener
> textBut.addEventListener( MouseEvent.MOUSE_DOWN, txtButMouseDown );
>
> //button handler to scroll thru objects ensuring 2 are removed and 1
> added
> if(objtoload == 3){objtoload=0}
> objtoload=objtoload+1;
>
> if (objtoload==1){
>         trace("objtoload load 1");
>         obj2.visible=false;
>         obj3.visible=false;
>         obj1.visible=true;}
> if (objtoload==2){
>         trace("objtoload load 2");
>         obj3.visible=false;
>         obj1.visible=false;
>         obj2.visible=true;}
> if (objtoload==3){
>         trace("objtoload load 3");
>         obj2.visible=false;
>         obj1.visible=false;
>         obj3.visible=true;}
>
> nothing done in the onEnterFrame, however ... hmm ...
>
> I think the logic of swapping is solid (the traces of objtoload look
> good) so maybe the fact nothing is done in onEnterFrame is making it
> fail?
>
> The failure mode is obj1 displays and on button press obj1 stays and
> nothing else appears. No compile or runtime errors. Subsequent button
> clicks increments objtoload (1 to 3) but nothing displays except obj1.
>
> I uploaded the little project (with assets) into the group upload area
> as Test67.zip if anyone wants to try it for me ...
>
> http://groups.google.com/group/away3d-dev/web/Test67.zip
>
> Thanks in advance.

Reply via email to