Skip navigation
Currently Being Moderated

How to create an air application that uses the molehill api?

Feb 28, 2011 2:41 AM

Hi.

I was able to get the molehill api working for firefox and ie (by following instructions here : http://labs.adobe.com/technologies/flashplatformruntimes/incubator/) but i cant figure out how to create an air application that can do the same (there is no mention of it on instructions page either :S) ?

I am using Adobe Flash CS5 and have set my Adobe Air version to 2 which is the latest i guess?, whenever i try to test the AIR movie i get errors telling me stage3D is not a compile time constant (ie its not recognizing any of the display3D classes :S ).

Another que. : when i try to set the context3DRenderMode to directx9 or openlgl for a web browser it automatically sets it to software :S (my computer supports both directx9 and opengl, i have CUDA  support too, my gfx card = Nvidia GT 8600) ? Heres the code i am using to check which rendering mode is assigned : -

 

import flash.geom.Rectangle;
import flash.events.Event;
import flash.display3D.Context3DRenderMode;
import flash.text.TextField;
import flash.display.Stage3D;

var traceMessageBox:TextField = new TextField()
traceMessageBox.background = true
traceMessageBox.backgroundColor = 0x00FF00
traceMessageBox.border = true
traceMessageBox.borderColor = 0x000000
traceMessageBox.width = 200
traceMessageBox.height = 25
traceMessageBox.x = (stage.stageWidth - traceMessageBox.width)/2
traceMessageBox.y = (stage.stageHeight - traceMessageBox.height)/2

stage.stage3Ds[0].viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight)
stage.stage3Ds[0].addEventListener(Event.CONTEXT3D_CREATE,_onContext3DCreate)
stage.stage3Ds[0].requestContext3D("directx9")

function _onContext3DCreate(e:Event){
     var stage3d:Stage3D = e.target as Stage3D
     traceMessageBox.text = "Context3D = " + stage3d.context3D.driverInfo
}

addChild(traceMessageBox)

 

And heres the output in firefox 4 beta edition :

 

molehillTestOnBrowser.jpg

 

Thanks For Help

 
Replies
  • Currently Being Moderated
    Feb 28, 2011 9:02 AM   in reply to FurqanIqbal

    You would need a newer version of Adobe AIR than what is currently available for download. AIR has the Flash Player compiled into it, so even if you were able to swap out your playerglobal.swc and get the compiler to work; most likely using FlashBuilder Hero version mentioned on the incubator site, you still would ot be able to install/run the application you created.

    Sean

     

    PS.

    You can see what version of Flash Player is supported in AIR by using the capabilities class version. If you write this to a TextField in AIR you can see the version of Flash Player your current AIR runtime supports. You need 11.x.x.x to get the molehill features.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2011 11:09 AM   in reply to FurqanIqbal

    I know Adobe just released AIR 2.6 for Android last week http://blogs.adobe.com/air/2011/02/adobe-air-2-6-for-android-is-now-av ailable.html ; but has not yet released 2.6 for WIN, MAC or Linux. That blog post mentions it will be released before the end of the 1st half of 2011, unfortunatley I don't think 2.6 supports 3D/molehill APIs but it probably supports the new StageVideo that was just released with Flash Player 10.2. So as far as an AIR runtime that supports molehill being available soon will probably not be till after that 2.6 AIR for desktops ships which could be as late as 06/31/2011 (technically the end of the 1st half of 2011).

    Sorry,

    Sean

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2011 1:01 PM   in reply to FurqanIqbal

    Hi,

     

    The Incubator only has builds for Flash Player at this time, so you can not currently create AIR applications that utilize the highlighted features.

     

    Also, please keep in mind that these are pre-release builds for developer testing and feedback only.They are not intended for commercial development or deployment.

     

    best,

    Emmy

    Group Product Manager, Adobe Flash Runtimes

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2011 2:01 PM   in reply to Emmy Huang

    Thank you Emmy for clarifying the Air incubator matter. I guess what led to the confusion is that Away3D site was talking about Flash player 11 and Air 3 incubator. Quote from the site : "In order to compile the source, you’ll also need to follow the  instructions for installing and compiling files for Flash Player 11  & AIR 3." And from the Adobe Labs site : "These are early builds of Flash Player or AIR and may not be as stable as a final release." But as you and Sean mentioned, we will first see the release of Air 2.6.. As a side note if you could confirm my suspisions Emmy, the new "flash.hid" package in the language reference of Flash 11 concerns some sort of "human interface device" capabilities and not the new 3D APIs. Thank you

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 1, 2011 3:25 PM   in reply to elousami

    elousami >> It's been known for a while that Incubator would have some sort of support for gamepads/steering wheels/etc. A brief look at the HID classes suggests this is the case.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points