Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtensionContext error while creating Native Extension in Flex 3.6 SDK

I'm creating native extension with Flex 3.6. Coded native side then created Flex Library Project and then create .ane file. Finally imported .ane file to myFlex Project.
Here is the problem I had. While I'm debugging app, "1046: Type was not found or was not a compile-time constant: ExtensionContext" error occurs. Attached the Library project .as class .

Thanks in Advance

package com.extension.samples
{
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import flash.external.ExtensionContext;

    public class NetworkConnectionANE extends EventDispatcher
    {
        public var _extContext : ExtensionContext;

        public function NetworkConnectionANE(target:IEventDispatcher=null)
        {
            _extContext = ExtensionContext.createExtensionContext("com.extension.samples.NetworkConnectionANE", null);
            super(target);
        }
        public function Connect(path:String):int
        {
            return _extContext.call("nativeFunc", path);
        }
        public function dispose():void
        {
            _extContext.dispose();
        }
    }
}

Edit: I tried to use .swc file that created from library project in another Flex Desktop app, but the same error
Also tried with _extContext = ExtensionContext.createExtensionContext("com.extension.samples.NetworkConnectionANE","");
Edit: The problem about Flex SDK,no problem in SDK 4.6. Now the question is, How to use Extension in lib project in Flex 3.6 SDK ?

like image 872
nadir.shpz Avatar asked Jul 29 '26 03:07

nadir.shpz


1 Answers

Right click on the project in flash builder goto properties of project and add air libraries in the flex library compiler.

like image 155
Ullas Hunka Avatar answered Aug 01 '26 20:08

Ullas Hunka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!