I’d guess that means that it can’t find stdFuncs since you shouldn’t get an error passing null into the parameters so the only place on that line that you try to access a property is of stdFuncs.

 


From: [email protected] [mailto:[email protected]] On Behalf Of Greg Johnson
Sent: Tuesday, November 08, 2005 1:27 PM
To: [email protected]
Subject: [flexcoders] Flex 2:Class Problem?

 

I finally got some time to setup classes for some common functions
and it was working, then I rolled it out to all parts of the
application and now it balks on me.

Here is the error in debug view
----------------------------
[SWF] C:\Documents and Settings\gjohnson\My
Documents\Flex\mr_new\bin\mr-debug.swf - 1,611,760 bytes after
decompression
Flex accessibility startup: true
TypeError: Error #1009: null has no properties.
----------------------------

Here is the error from the flash player
----------------------------
TypeError: Error #1009: null has no properties.
      at mr/doResultGetPeople()[C:\Documents and
Settings\gjohnson\My Documents\Flex\mr_new\mrCFCHandlers.as:105]
      at mr/___Operation15_result()[C:\Documents and
Settings\gjohnson\My Documents\Flex\mr_new\mr.mxml:55]
      at flash.events::EventDispatcher/dispatchEvent()
      at
mx.rpc::AbstractOperation/http://www.macromedia.com/2005/flex/mx/inter
nal::dispatchRpcEvent()
[C:\dev\max\sdk\frameworks\mx\rpc\AbstractOperation.as:167]
      at
mx.rpc.soap::Operation/http://www.macromedia.com/2005/flex/mx/internal
::resultHandler()
[C:\dev\max\sdk\frameworks\mx\rpc\soap\Operation.as:592]
      at flash.events::EventDispatcher/dispatchEvent()
      at
mx.rpc::Producer/http://www.macromedia.com/2005/flex/mx/internal::ackn
owledge()[C:\dev\max\sdk\frameworks\mx\rpc\Producer.as:59]
      at mx.messaging.channels$1021
$private::HTTPMessageResponder/completeHandler()
[C:\dev\max\sdk\frameworks\mx\messaging\channels\DirectHTTPChannel.as:
237]
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/URLLoader$502$private::onComplete()
---------------------


Here are the germain parts of my code
------------------------
mr.mxml
------------------------
      <!-- Managment Reporting Main Web Service Definition -->
      <mx:WebService id="mr_main" wsdl="{removed for posting}"
fault="stdFuncs.cfcerr('mr_main','', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" showBusyCursor="true">
            <mx:operation name="getPeopleByName_cfc"
result="doResultGetPeople(event.result)" fault="stdFuncs.cfcerr
('mr_main','getPeopleByName_cfc', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" />
            <mx:operation name="getDeptPIDs_cfc"
result="doResultGetDepartmentPIDs(event.result)"
fault="stdFuncs.cfcerr('mr_main','getDeptPIDs_cfc',
event.fault.faultcode, event.fault.faultstring,
event.fault.description, event.fault.detail)" />
            <mx:operation name="getCompany_cfc"
result="doResultGetCompany(event.result)" fault="stdFuncs.cfcerr
('mr_main','getCompany_cfc', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" />
            <mx:operation name="getPerson_cfc"
result="doResultGetPerson(event.result)" fault="stdFuncs.cfcerr
('mr_main','getPerson_cfc', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" />
            <mx:operation name="getDeptList_cfc"
result="doResultGetDeptList(event.result)" fault="stdFuncs.cfcerr
('mr_main','getDeptList_cfc', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" />
            <mx:operation name="getPermissions_cfc"
result="doResultGetPermissions(event.result)" fault="stdFuncs.cfcerr
('mr_main','getPermissions_cfc', event.fault.faultcode,
event.fault.faultstring, event.fault.description,
event.fault.detail)" />
      </mx:WebService>
----------------------
mycode.as
----------------------
import mx.collections.ArrayCollection;
[Bindable]
public var investigatorResultsGrid_dp:ArrayCollection = new
ArrayCollection();
      public var stdFuncs:stdlib;

//********************** Get People CFC **********************
// Caller
public function getPeople(name:String, deptcode:String,
deptname:String):Void{
      mr_main.getPeopleByName_cfc(name, deptcode, deptname, getPIDs
());
}

// Result Handler
public function doResultGetPeople(result:Array):Void {
        // ******* it errors on the following line ********
      stdFuncs.CFC2AS(result,investigatorResultsGrid_dp);
      investigatorResultsGrid.visible=true;
      investigatorResultsGrid.selectedIndex=0;
      selections_vs.selectedIndex=0;
      selectionsPanel.visible=true;
      getPerson();
}
----------------------

Here is the class
-----------------
stdlib.as
-----------------
package {
      import mx.collections.ArrayCollection;
      import mx.events.DragEvent;
      public interface stdlib {
            function CFC2AS(newArray:Array,
oldArray:ArrayCollection):Void
            function getToday():String
            function doDragDrop(event:DragEvent):Void
            function detectDoubleClick(event:Object,
functionToCall_func:Function, ... args):Boolean
            function dateAssign(dateOut:Date, dateIn:Object):Date
            function cfcerr(cfcName:String, functionName:String,
faultCode:String, faultString:String, description:String,
details:String):Void
            function asErr(fileName:String, functionName:String,
errorMsg:String):Void
            function err(message:String):Void
      }
}
----------------------
cfc.as
----------------------
package stdlib.CFC {
      import stdlib;
      import mx.collections.ArrayCollection;

      public class cfc implements stdlib {
           
            public function CFC2AS(newArray:Array,
oldArray:ArrayCollection):Void {
                  oldArray.removeAll();
                for(var i:int =0; i < newArray.length; i++){
                      oldArray.addItem(newArray[i]);
                }
            }
           
      }
}
---------------------


Here are the variables when it hits the error
----------------------
result = (Object) [] (0x36d6c1e)
      [0] = Object (0x36daa26)
      [1] = Object (0x36e2626)
      CASEINSENSITIVE = (Number) 1
      constructor = Object$
      DESCENDING = (Number) 2
      length = (Number) 1
      NUMERIC = (Number) 16
      RETURNINDEXEDARRAY = (Number) 8
      UNIQUESORT = (Number) 4
investigatorResultsGrid_dp = (Object) mx.collections::ArrayCollection
(0x34f5586)
      _list = mx.collections::ArrayList (0x350f346)
      _sort = null
      autoUpdateCounter = (Number) 0
      constructor = Object$
      DEPENDENCY_LINK = (Number) 0
      eventDispatcher = flash.events::EventDispatcher (0x350e58e)
      filter = null
      length = (Number) 1
      list = mx.collections::ArrayList (0x350f346)
      localIndex = null
      pendingUpdates = null
      revision = (Number) 1
      sort = null
      source = [] (0x350e5b6)
      supportsFilter = (Boolean) false
      supportsSort = (Boolean) true
------------------

The directories where the class files are have been added to the
class path definition in Flex Builder.

Any ideas would be helpful.

Thanks
Greg









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to