Flash Builder emulation and mobile device react differently. MultiTouch support and AssetLibrary Question

Software: Away3D 4.x

m_pedro, Newbie
Posted: 27 January 2013 04:15 PM   Total Posts: 7

I am coding an actionscript mobile project using FlashBuilder 4.6. I have a couple of questions regarding multitouch support and the AssetLibrary.

1. I have implemented a swipe gesture into my code to move an object around the screen. Upon testing and debugging in the emulator I notice that Multitouch.supportsGestureEvents always returns false in the emulator but works just fine on my device. Do the emulators not support this ability? This is not a huge issue since it is working on my device, however makes debugging my code much harder.

2. Another Issue I have run into is using the AssetLibrary. I use the AssetLibrary to load 3 different embedded models and add them to the scene. Again something strange is happening where I run the emulator and I see all of the models just fine, but now when I run on the mobile device, only one of my models is present. Is it possible I am running out of memory already and only one model is visible? or am I using the AssetLibrary incorrectly. Below is my code for loading the models. 2 of the models are 90kb and the other is 1.25 mb. I have also tried the Loader3D method and the same results. I should also mention these are in the awd2 format.

3. I am also curious the difference between the AssetLibrary and the Loader3D. I have had some trouble finding the answer to this. Does the library handle all types of assets and the loader3D is just for 3d models?

[Embed(source="object1.awd"mimeType="application/octet-stream")]
  
private var object1Model:Class;
  
  
[Embed(source="object2.awd"mimeType="application/octet-stream")]
  
private var object2Model:Class;
  
  
[Embed(source="object3.awd"mimeType="application/octet-stream")]
  
private var object3Model:Class; 
Parsers.enableAllBundled();
   
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);
   
AssetLibrary.loadData(new object1Model());
   
AssetLibrary.loadData(new object2Model());
   
AssetLibrary.loadData(new object3Model()); 
private function onAssetComplete(event:AssetEvent):void
  {
   
   
if (event.asset.assetType == AssetType.MESH
   
{
    
var mesh:Mesh event.asset as Mesh;
    
mesh.castsShadows true;
    
view.scene.addChild(mesh);
   

  } 

Any help or information on this topics would be greatly appreciated. Thank you very much for your time.

   

Avatar
loth, Sr. Member
Posted: 28 January 2013 08:43 AM   Total Posts: 236   [ # 1 ]

hello
i think you have to add this

AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);

to test final parsing of model and and launch enterframe fonction.

also parse one by one files
you model is big (>1mb) for mobile so is long

for multiTouch i think is your setting
that work on flash develop.

   

m_pedro, Newbie
Posted: 28 January 2013 11:13 AM   Total Posts: 7   [ # 2 ]

Thanks for the reply loth,

After another day of research I actually managed to fix all of my problems and everything is working fine on the mobile device now. I will look into the RESOURCE_COMPLETE though because it seems this may suit my needs.

Thanks again

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X