Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Locked

Compile SWF version 14 (Air 3.1) from Flash Pro CS55 possible?

Explorer ,
Dec 05, 2011 Dec 05, 2011

Copy link to clipboard

Copied

Dear Adobe community,

Has anyone been able to take an existing FLA file in Flash Pro CS55 and 'publish' an swf file as version 14 (Air 3.1)? I'm trying to use a native extension for iOS on GitHub, but my app has been on Flash Pro and hence have been publishing, then using ADT to compile the native extensions I need. However, to use iOS5 features (and add additional frameworks from Xcode like MessageUI), the swf file has to be version 14.

With the latest Flash Pro CS55 update, my compiled SWF files are version 13, and when I try to publish an ipa-ad-hoc file, it tells me the "root swf file version" is 13 while the extension (I'm assuming library.swf) is in version 14. I've of course tried overlaying the Air 3.1 SDK over the appropriate directories within CS55, as I did with Air 3.0 SDK, but no go?

thank you and with kind regards,

Alex

TOPICS
Development

Views

8.8K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Dec 17, 2011 Dec 17, 2011
The answer is yes.It took me a few hours to realise what was wrong. A while ago I overlayed SDK 3.1. I changed the version from 11 to 13 as suggested in step 12 in the instructions here:http://kb2.adobe.com/cps/908/cpsid_90810.htmlI remember having some trouble with this, but it finally worked. Now I had to switch up to 14, and I had the same problem. It took me a few hours to solve.There seem to be an undocumented issue with changing the version number in the players xml-files. It seems like th...

Likes

Translate

Translate
LEGEND ,
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

Hm, I overlayed 3.1 using the same old overlay instructions and the XML schema points to 3.1. I assumed that was good enough to be outputting 3.1.

How do you verify the version you're even outputting on the device? I'm interested in if I'm still somehow using 3.0 myself.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

Hi Ominous93,

I've overlayed 3.1 like you, but when I created a simple button that calls a native extension to pop open an sms or email composer page for iOS5 (per a GitHub repo here: https://github.com/pkoscierzynski/NativeMailExtension), when I use ADT to try to attach it, I get the error that the root swf (I'm assuming that's the compiled test SWF from CS55) version (13) is older than the swf in the extension (version 14). I've also updated my CS55 per adobe's update here: http://blogs.adobe.com/rgalvan/2011/11/adding-fp11-support-to-flash-pro-cs5-and-cs5-5.html, but seems to top off at 13, even with 3.1 overlayed. I wonder what I am doing wrong here.

with best,

Alex

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 06, 2011 Dec 06, 2011

Copy link to clipboard

Copied

I know what you mean. I'm wondering if there's a simple way to report what version of AIR was used in compiling an IPA, after you compile it. Not sure if System.capabilities or something similar might have a clue. I have 3.1 overlayed but from your post I wonder if I'm even using it. I'm using FP13. I don't see how the flash player matters when AIR is involved. I don't know where they internally overlap.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 07, 2011 Dec 07, 2011

Copy link to clipboard

Copied

Can I ask why you need to use SWF version 14 in the first place?

I have native extenstions running just fine with SWF version 13 (and AIR 3.1).

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2011 Dec 07, 2011

Copy link to clipboard

Copied

Hi user23890123,

I need swf-version 14, because (and please correct me if I'm mistaken), Air SDK 3.1 started support for being able to include non iOS-API-calls (beyond stuff like you see here on the samples: vibrate the phone, get battery level, pop up an alert, etc.). For example, being able to include the MessageUI framework to pop open an sms or email composer view, or features new to iOS5. You can now include a platform.xml file in the .ane file where your static library is, and include them like such:

<platform xmlns="http://ns.adobe.com/air/extension/3.1">

    <sdkVersion>5.0</sdkVersion>

    <linkerOptions>

              <!-- to use the MessageUI framework -->

        <option>-framework MessageUI</option>

    </linkerOptions>

</platform>

thank you,

Alex

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2011 Dec 08, 2011

Copy link to clipboard

Copied

Ah, well it looks like you're mostly correct. The extensions I'm using can be built with platform xmlns set to "http://ns.adobe.com/air/extension/2.5", and can run with swf-version 13 (still Air SDK version 3.1 though). The 3.1 namespace does require swf version 14 though.

I'm not sure what functionality was added in the 3.1 namespace, I was under the impression that the native code was already capable of "non iOS-API-calls". If you're the developer of the extension, and not just an inept user of extensions (like me ) I would recommend trying to get the extension running in the 2.5 namespace, at least until Adobe brings all of its software up to date.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2011 Dec 15, 2011

Copy link to clipboard

Copied

Try following this manual: http://kb2.adobe.com/cps/908/cpsid_90810.html

Replace existing AIR files with AIR 3.1 SDK and then change the version attribute of the player tag from 14.

Haven't tested it, but you can give it a try.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 17, 2011 Dec 17, 2011

Copy link to clipboard

Copied

The answer is yes.

It took me a few hours to realise what was wrong. A while ago I overlayed SDK 3.1. I changed the version from 11 to 13 as suggested in step 12 in the instructions here:

http://kb2.adobe.com/cps/908/cpsid_90810.html

I remember having some trouble with this, but it finally worked. Now I had to switch up to 14, and I had the same problem. It took me a few hours to solve.

There seem to be an undocumented issue with changing the version number in the players xml-files. It seems like the data from these files actually is stored inside the fla-file. This means that the data for a specific fla-file is not updated until you switch the Player-setting under Document>Publish. It worked for me after switching the setting to Air for Android and then back again to Air for iOS.

Hope this can help.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2012 Jan 16, 2012

Copy link to clipboard

Copied

Thanks anders.

Switching the publish settings did the trick for me. 

So far this is the only forum or place I have seen this suggestion, nice work and thanks for saving me the hours.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 10, 2012 Feb 10, 2012

Copy link to clipboard

Copied

Between versions of flash you'll always need to overlay and 'lie' about the version.

Download the lastest 'release' player and debugger, place them, and add to the Common/Configuration/Players XML schemas to point to the correct flash .SWC.

This will probably continue to happen over and over until everyone buys Flash Builder (like I did).

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2012 Feb 21, 2012

Copy link to clipboard

Copied

I was able to overlay 3.0 but when I try 3.1, I continue to get this namespace error.  Tried flipping it back and forth to different publish options and no success.  Seems stuck.   Any other way around this issue?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 10, 2015 Sep 10, 2015

Copy link to clipboard

Copied

LATEST

Hello huys, Why does it happenw ith Air Native Extension. I got error: "TypeError: Error #1009: Cannot access a property or method of a null object reference."

myown_ane_file.PNG

I have tried. But it doesn't work with Adobe Air SDK 18 because it hs bug?

I should description of extensions.xml with namepsace 18.0 ??

<?xml version="1.0" encoding="UTF-8"?>

<extension xmlns="http://ns.adobe.com/air/extension/18.0">

  <!-- This is the extension ID: the same unique string

    you defined in WindowsExtensionWrapper.as -->

  <id>net.sourceskyboxer.utils.WindowsLibrary.WindowsLibrary</id>

  <versionNumber>1.0.0</versionNumber>

  <platforms>

  <platform name="Windows-x86">

  <applicationDeployment>

  <!-- The name of the DLL file: -->

  <nativeLibrary>WindowsLibrary.dll</nativeLibrary>

  <!-- The names of the extension initializer

      and finalizer functions you defined

      in dllMain.cpp: -->

  <initializer>initializer</initializer>

  <finalizer>finalizer</finalizer>

  </applicationDeployment>

  </platform>

  </platforms>

</extension>

My c script for WindowsLibrary.dll

#include "FlashRuntimeExtensions.h"

#include <stdio.h>

#include "WindowsLibrary.h"

#include <stdlib.h>

#include <string.h>

FREObject isSupported(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])

{

  FREObject result;

  uint32_t isSupportedThisOS = 1;

  FRENewObjectFromBool(isSupportedThisOS, &result);

  return result;

}

// Example C:\\Windows or D:\\Windows

FREObject getWindowsDirectory(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])

{

  FREObject result;

  const char *str = getenv("windir");

  FRENewObjectFromUTF8(strlen(str)+1, (const uint8_t *)str, &result);

  return result;

}

void contextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctions, const FRENamedFunction** functions)

{

  *numFunctions = 1;

  FRENamedFunction* func = (FRENamedFunction*)malloc(sizeof(FRENamedFunction)*(*numFunctions));

  func[0].name = (const uint8_t*)"getWindowsDirectory";

  func[0].functionData = NULL;

  func[0].function = &getWindowsDirectory;

  *functions = func;

}

void contextFinalizer(FREContext ctx)

{

  return;

}

void initializer(void** extData, FREContextInitializer* ctxInitializer, FREContextFinalizer* ctxFinalizer)

{

  *ctxInitializer = &contextInitializer;

  *ctxFinalizer   = &contextFinalizer;

}

void finalizer(void* extData)

{

  return;

}

h file:

/*

* WindowsLibrary.h

*

*  Created on: 10.09.2015

*      Author: Jens

*/

#ifndef WINDOWSLIBRARY_H_

#define WINDOWSLIBRARY_H_

#include "FlashRuntimeExtensions.h"

__declspec(dllexport) void initializer(void** extData, FREContextInitializer* ctxInitializer, FREContextFinalizer* ctxFinalizer);

__declspec(dllexport) void inalizer(void* extData);

#endif /* WINDOWSLIBRARY_H_ */

AS3:

package net.sourceskyboxer.utils.WindowsLibrary

{

  import flash.events.EventDispatcher;

  import flash.events.IEventDispatcher;

  import flash.external.ExtensionContext;

  import flash.filesystem.File;

  public class WindowsLibrary extends EventDispatcher

  {

  private var _context:ExtensionContext;

  public function WindowsLibrary(target:IEventDispatcher=null)

  {

  super(target);

  _context = ExtensionContext.createExtensionContext("net.sourceskyboxer.utils.WindowsLibrary.WindowsLibrary", null);

  }

  public function isSupported():Boolean

  {

  return _context.call("isSupported");

  }

  public function _getWinDir():String

  {

  return this._context.call("getWindowsDirectory") as String;

  }

  }

}

And i have tried with Adobe Air SDK 18.0 and i get ane file okay and i have imported to ane manager from Flash Builder 4.6 and i tested it

<?xml version="1.0" encoding="utf-8"?>

<mx:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

  xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" creationComplete="onCreationCompleteHandler(event)">

  <fx:Script>

  <![CDATA[

  import mx.events.FlexEvent;

  import net.sourceskyboxer.utils.WindowsLibrary.WindowsLibrary;

  private var _winLib:WindowsLibrary;

  protected function onCreationCompleteHandler(event:FlexEvent):void

  {

  }

  protected function isSupportHandler(event:MouseEvent):void

  {

  txt.text = _winLib.isSupported().toString();

  }

  ]]>

  </fx:Script>

  <fx:Declarations>

  <!-- Platzieren Sie nichtvisuelle Elemente (z. B. Dienste, Wertobjekte) hier -->

  </fx:Declarations>

  <mx:TextInput id="txt" left="30" top="38"/>

  <mx:Button x="30" y="69" label="Check Support" click="isSupportHandler(event)"/>

</mx:WindowedApplication>

Than i got error:

ypeError: Error #1009: Cannot access a property or method of a null object reference.

  at MyTest/isSupportHandler()

  at MyTest/___TestWindowsDirectory_Button1_click()

Why not??

Please help solution Thanks!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines