Question

I am trying to build a ActionScript side library for my SIP library Adobe AIR native extension following this blog from Adobe, in FlashDevelop IDE. When I build the project I get the following compile time error:

C:\Users\Osama Mohammed\Documents\AndroidSIPManager\src\in\innovative\androidsipmanager\AndroidSIPManager.as(1): col: 9 Error: Syntax error: expecting identifier before in.

I don't know why am I getting that error, although my syntax is right. I get this error when I write package name after package keyword in any ActionScript 3 project in ActionScript file, Eg. package my.package { ..., but don't get it when no package name is written after package keyword. Following is my AndroidSIPManager.as code:

package in.innovative.androidsipmanager //getting error here
{
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;

    /**
     * ...
     * @author Osama Mohammed Shaikh
     */
    public class AndroidSIPManager extends EventDispatcher 
    {
        private var extContext:ExtensionContext;

        public function AndroidSIPManager(target:IEventDispatcher=null) 
        {
            super(target);      

            extContext = ExtensionContext.createExtensionContext("in.innovative.SIPLibExtension", "sip");
            if (!extContext)
            {
                throw new Error("SIP Library extension is not supported on this platform");
            }
        }

        public function initialize(enum_transport:int, agent:String, STUNServer:String, STUNServerPort:int):int
        {
            return int (extContext.call("initialize", enum_transport, agent, STUNServer, STUNServerPort));
        }

        public function setUserInfo(userName:String, displayName:String, authName:String, password:String, localSIPPort:int, userDomain:String, SIPServer:String, SIPServerPort:int, outboundServer:String, outboundServerPort:int):int
        {
            return int (extContext.call("setUserInfo", userName, displayName, authName, password, localSIPPort, userDomain, SIPServer, SIPServerPort, outboundServer, outboundServerPort));
        }

        public function portSipCall(callee:String, enum_mediaType:int):Number
        {
            return Number (extContext.call("portSipCall", callee, enum_mediaType));
        }
    }
}

Please help me solve the problem.

Était-ce utile?

La solution

Problem is that in is reserved word. This is the reason, why you're able to compile project after removing the package name completely.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top