A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] Type was not found or was not a compile-time constant

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    63

    resolved [RESOLVED] Type was not found or was not a compile-time constant

    I have a AS3 need to call 2 functions in a WS to get 2 return parameters.

    But, it has

    Compile Error:
    1046: Type was not found or was not a compile-time constant: OperationEvent.
    function onResult(e:OperationEvent):void {
    function onFault(e:OperationEvent):void {
    function onResult1(e:OperationEvent):void {
    function onFault1(e:OperationEvent):void {

    Code:
    function GetStreamName(opName:String) {
       var ws = new WebService("http://[publicip]/WebService/Service.asmx?wsdl");
       var op:Operation = new Operation(ws);   
       op.addEventListener(OperationEvent.COMPLETE, onResult);
       op.addEventListener(OperationEvent.FAILED, onFault);
       op.CheckStreamName(opName);
    }
    
    function onResult(e:OperationEvent):void {	      
       for (var prop in e.data){
    		   trace (e.data[prop]);
       }
       streamName = String(e.data);
    }
       
    function onFault(e:OperationEvent):void {
    	trace (e.data);
    	prompt.text = "Fail";
    }
    
    function GetOpID(opName:String) {
       var ws = new WebService("http://[publicip]/WebService/Service.asmx?wsdl");
       var op:Operation = new Operation(ws);   
       op.addEventListener(OperationEvent.COMPLETE, onResult1);
       op.addEventListener(OperationEvent.FAILED, onFault1);
       op.CheckOpID(opName);
    }
    
    function onResult1(e:OperationEvent):void {	      
       for (var prop in e.data){
    		   trace (e.data[prop]);
       }
       OpID = String(int(e.data));
    }
       
    function onFault1(e:OperationEvent):void {
    	trace (e.data);
    	prompt.text = "Fail";
    }

  2. #2

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    63
    I imported those as source files.

    1046: Type was not found or was not a compile-time constant: WebServiceCall.

    1180: Call to a possibly undefined method WebServiceCall.

  4. #4

  5. #5
    Member
    Join Date
    Jun 2009
    Posts
    63
    I use http://www.wellconsidered.be/as3-webservice-component/

    There are 3 methods in a webservice.

    I can call the first method from AS3. However, I cannot call the 2nd and 3rd methods and have the following error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at be.wellconsidered.services.webservice::WebServiceC all/::createSoapCall()
    at be.wellconsidered.services.webservice::WebServiceC all$iinit()
    at be.wellconsidered.services::Operation/loadMethod()
    at be.wellconsidered.services::WebService/::executeQeuedOperations()
    at be.wellconsidered.services::WebService/:nDescrExtractComplete()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
    at flash.events::EventDispatcher/dispatchEvent()
    at be.wellconsidered.services.webservice::WebServiceM ethodCollection/extract()
    at be.wellconsidered.services::WebService/:nDescrLoaded()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/flash.net:URLLoader:nComplete()

  6. #6
    Member
    Join Date
    Jun 2009
    Posts
    63
    I fixed it, it was due to the improper parameters passing.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center