flash builder 4.6 - native application issues - - actionscript-3

I'm trying to follow a tutorial here:
http://www.as3nui.com/airkinect-2-0-is-here/
which deals with developing an AirKinect application in Flash Builder 4.6, which I've installed. But when I follow the steps, a bunch of menu commands that the tutorial accesses are not available to me. I'm developing an Actionscript project. When I go to the project properties, and click the actionscript build path from the left, in the video there are 3 tabs - source path tab, library tab, and native extensions tab, but I don't see native extensions tab. Furthermore, on the left, he has a menu called Actionscript build packaging - I do not have this. Lastly, he uses a command stage.nativeWindow.visible = false - when I use that it says it is an undefined property. I think that all of these issues have to do some how with the matter of native applications in flash builder, but I'm not sure. Anyone know what's going on?

You've probably started your project with the wrong settings. When you create a new ActionScript Project in Flash Builder 4.6, you can choose how it will run: in a browser or using AIR:
You should select the button "Desktop (runs in Adobe AIR)" under 'Application Type'. Then you will also see that native extensions tab in your project properties.
I don't know how to change an existing project into an AIR Desktop project but it should not be too difficult to create a new one and move your existing code into it.

Related

ActionScript 3- Wrap DYLIB to be used with AS3

I have to create Flash application with AS3 and use functions in DYLIB.
Let say the function name is Open();
Is it possible? And how do I add the DYLIB into my AS3 project?
EDIT
Ok as I can see from the comment, I need to wrap the DYLIB. I am not sure how to do it. Can anyone help ?
To get a dynamic library to work with AIR you must create an ANE (AIR Native Extension) that uses the dylib. The ANE you create should expose parts of the library that you require as AS3 functions.
There are many tutorials available for creating ANEs, start with:
https://www.adobe.com/devnet/air/articles/extending-air.html
Once you've created the ANE that accesses the dylib, when packaging your application you must go through a few additional steps to correctly sign the dynamic library.
make sure you are using AIR 27+
add a Frameworks directory to your application at the root level
ensure this directory is packaged with your application
place any dynamic libs and frameworks in this directory
These libraries will then be correctly signed with your application certificate.

Some spark components missing after overlaying flex SDK with AIR

I want to create a flex mobile application.
I merged the contents of Adobe AIR SDK 4.0.0(build:1390) with Adobe flex SDK 4.6
Now, when I create a new flex mobile application in Flash Builder, I don't have the "ViewNavigatorApplication" or "View" spark components. Compiling gives the error:
Could not resolve s:ViewNavigatorApplication to a component implementation.
I noticed that "mobilecomponents.swc" disappears from the list of fils after merging AIR SDK with flex SDK. The "ViewNavigatorApplication" component is in this file.
I tried adding the "mobilecomponents.swc" manually, and the result was the application compiled but showd a blank white screen.
The same problem exists with Apache flex SDK 4.12.1
There are no problems when I used this overlayed flex and AIR for a pure AS3 project.
Ok, problem solved!
For anyone else stuck in this situation:
Note that I was trying to install the SDK manually. I red somewhere that Apache Flex SDK installer will prevent many of this issues by automatically doing things, altough I haven't tested it myself.
Back to my situation, this link saved me:
http://riatiger.com/blog/2013/08/overlay-adobe-air-3-8-over-flex-sdk-4-6/
The key point in the link:
...you should download original AIR SDK
without the new compiler, or you will face a bunch of weird messages
during project compilation.
So, you should download the AIR SDK from http://airdownload.adobe.com/air/win/download/latest/AdobeAIRSDK.zip and not the normal download page of AIR SDK. When you overlay this version of AIR SDK into flex SDK, you will notice that no files are overriden.
After doing this edit the "frameworks/airmobile-config.xml" file and remove the 2 occurrences of "{airHome}/frameworks/" to prevent a compile error.
After doing all the steps add the new flex SDK folder again in order to apply all the changes.

Is it possible to add Native Extensions to Actionscript Library projects?

I've got an ActionScript Library project which is shared between an ActionScript and an ActionScript Mobile project. It works nicely for sharing everything I need in the two projects, but I'd now like to share an Adobe Native Extension between the two projects.
There's a 'Native Extensions' tab for adding them on the [ActionScript Build Path] screen in both the AS and AS Mobile projects, but not the ActionScript Library project.
I tried adding the ANE via the 'Add SWC' dialog on the [Build Path] screen in the Library project (there is a filter for *.ane on the file browser), but the project then failed to run with a VerifyError: Error #1014: Class myANE could not be found.
Does anyone know if it is possible to add ANEs to ActionScript Library projects, or can they only be added directly to ActionScript or ActionScript Mobile projects?
Many thanks in advance for any advice.
Not in Flash Builder, no. You can do it in IntelliJ (I am in the middle of trying to make the switch right now and that has been a fantastic feature so far). If your ANE is open source, as quite a few are, it is likely the SWC used by the dev to compile the ANE is included in the source code, or you could generate yourself. The SWC is the only portion of the ANE required to compile any kind of AIR app or library. You'll have runtime errors if you don't include the ANE in the app, but that is a given regardless.
So if you have the SWC or can compile one, add that as an external library to your project.

Launch LibGDX project with Android Studio

I've used "setup UI" to generate my LibGDX game projects.
Then I've imported them into Android Studio . It didn't show any errors at first , but when I've tried to run the android project , it gave me strange errors like :
java: cannot find symbol
symbol: variable super
location: class com.yan.waterworld.MainActivity
Here is an image :
How can it be solved (or worked around) ?
Update:
Since Android Studio 0.8.0 it is now possible to run Java and Android modules. This will not work by following these instructions (Android studio is based on Intellij).
Gradle Configuration
Old:
They have forums and notice here: https://code.google.com/p/libgdx/wiki/AndroidStudio
Using libgdx with Android Studio
At Google I/O 2013, the Android tools
team released Android Studio, and IDE based on IntelliJ IDEA, focusing
on pure Android development.
Android Studio is sadly unfit for libgdx projects at this time, as it
only allows the creation of Android projects. Standard Java projects
are not supported, and it is unclear if this will ever become
available.
Libgdx's cross-platform nature does not lend itself well to
development with Android Studio. This should not be a big hindrance,
as libgdx projects don't benefit much from Android Studios
capabilities. E.g. the layout preview is irrelevant for libgdx
applications, as they don't use native Android UI widgets. The inline
documentation support for Android APIs is also not needed for libgdx
applications.
However, we'll try to make developing libgdx applications with the new
Android Gradle build system possible in the near future.
If you must use Android Studio, check out this thread on the forums.
Alternatively you can use Intellij IDEA with libgdx, potentially with
Maven.
Creating games in gdx works perfectly fine in Android Studio. The best way to create a project for Android Studio is through gdx-setup. Please go to the following article
http://www.todroid.com/android-gdx-game-creation-part-i-setting-up-up-android-studio-for-creating-games/
It explains my experience in using the gdx-setup application, how to run it on the PC platform and steps for importing the gradle project and building a project in gradle.
When you have finished the article, hopefully you will have a fully working sample game template in which you can start building your game.
I tried to use a similiar method used for native libraries for now.
Last night, I was able to run examples; as a scratch project in Android Studio and wrote a quick guideline
Hope it helps you as well, but I am still learning so sorry in advance for any missing info or mistakes ;)
Here's the link.. http://bgnstudio.wordpress.com
I tried to use this way in detail:
create a new project in Android Studio.
From the libgdx nightly build, get;
Libgdx.so files within the armeabi/armeabi-v7a folders as needed.
Gdx.jar and gdx-source.jar
Gdx-backend-android.jar
Create lib and libs directories under project folder .
Copy armeabi* folders , gdx.jar and gdx-source.jar files under the “lib” directory.
Also copy the gdx-backend-android.jar into the “libs” directory.
*
In project tree; add gdx.jar and gdx-backend-android.jar as library.
In library settings, add gdx-source.jar under gdx.jar; Then open
module settings and add these libraries as dependencies. And check
them for compile.
Archive the armeabi folders together with parent directory to zip files and rename extension from zip to jar.
armeabi.jar : “/lib/armeabi/libgdx.so”
armeabi-v7a.jar :“/lib/armeabi-v7a/libgdx.so”
And move these jar files under “libs” directory.
Final apperance of the folders will be like this:
|-lib
|---gdx.jar
|---gdx-sorces.jar (added as source library of gdx.jar in library settings)
|-libs
|--- armeabi.jar
|--- armeabi-v7a.jar
|--- gdx-backend-android.jar
Now modify build.gradle file as well:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile files('lib/gdx.jar')
compile files('libs/gdx-backend-android.jar')
compile fileTree(dir: 'libs' , include:'*.jar')
}
Have you tried IntelliJ 13? Download it here . This new version covers most of the function of Android Studio, but still it can make Java Project. Take a look at this article
This EAP build includes all of the new features of Android Studio except for the new project wizard and the AppEngine cloud endpoints integration. These latter features will also appear in our EAP builds in the coming weeks.
take a look at libdgx documentation:
https://code.google.com/p/libgdx/wiki/IntelliJIDEALibgdx
mark the Advanced->IDEA checkbox at libgdx project setup tool, create the project and import it from android studio(you will need add the assets folder to desktop launcher or maybe somethings like this), it works for me.

Any *normal* way to use direct rendermode for mobile application in Flash Builder 4.6?

I tried to make a mobile app (air 3.2) utilising Stage3D in Flash Builder 4.6, but whenever I tried to debug the application I got an error saying Stage3D is unavailable.
I had to manually edit bin-debug/MyApp.xml and set <renderMode>direct</renderMode> for it to work.
Is there any normal way to select direct render mode in Flash Builder without having to edit app XML manually?
Unfortunately there is no way "yet" to select render mode in Flash Builder. You have to manually edit render mode in app XML. It's the only way as it should be. If you ever develop any mobile application, you would likely see the same routine here.
Furthermore, there is an app xml file in source file. Edit render mode there instead. You don't need to edit your xml file in bin debug folder as the file is auto generated and changed every time you debug.