Object seen only on touching the screen on iphone.

Software: Away3D 4.x

NaveenMyName, Newbie
Posted: 19 April 2012 05:33 PM   Total Posts: 3

Hi,

I am loading a simple 3D object as follows:

_loader = new Loader3D();
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
_loader.addEventListener(LoaderEvent.LOAD_ERRORonLoadError);
_loader.load( new URLRequest('vase.awd') )

private function 
onResourceComplete(ev LoaderEvent) : void
{
_loader
.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);
_view.scene.addChild(_loader);
trace('Loaded Resource');

On running on the iPhone emulator on desktop (on FlashBuilder) the object loads fine.

But on iPhone the object can be seen only when I touch the screen. When I release the touch the object disappears. On touching again the object appears back.

Object is loaded successfully in both desktop emulator and iPhone as the trace message comes only once for both cases.

Any ideas for what I should do to get the object to appear after loading on iPhone without having to touch the screen?

Thanks.

   

NaveenMyName, Newbie
Posted: 19 April 2012 05:46 PM   Total Posts: 3   [ # 1 ]

Well, apologies, the object is loading now on iPhone as well. it was only taking time to load.

But the problem is once I touch and release the object disappears from screen. I am guessing this is because of the settings for rotation in this function.

private function onEnterFrame(ev Event) : void
  {
   _loader
.rotationY stage.mouseX stage.stageWidth/2;
   
_view.camera.* (stage.mouseY stage.stageHeight/2);
   
_view.camera.lookAt(_loader.position);
   
_view.render();
  

How does this function remove the object when I release the touch on iPhone? Something to do with the difference in touch and mouse behaviors?

Thanks.

 

   

NaveenMyName, Newbie
Posted: 23 April 2012 05:36 PM   Total Posts: 3   [ # 2 ]

The solution for this can be found here:

http://www.actionscript.org/forums/showthread.php3?t=256902

Have to use a different set of events.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X