나는 내 액션 스크립트 코드에서 이상한 것을보고있다.flex/actionscript 지정이 실패 했습니까?
나는 두 개의 클래스 foo와 bar, bar extends foo를 가지고있다. 모델 클래스에서 나는 foo 멤버 변수를 가지며, bar 객체를 foo 변수에 할당합니다. 그러나 할당 후에 foo 변수는 null입니다.
[Bindable] public var f:foo;
public function someFunc(arr:ArrayCollection):void {
if(arr.length > 0) {
var tempBar:bar = arr.getItemAt(0) as bar;
if(tempBar != null) {
tempBar.someProp++;
f = tempBar;
// f is now null
}
}
}
내가 잘못하고있는 것에 대한 아이디어가 있습니까?
selectedCustomerJob : 널 (null)
jobToSelect 유형 : com.intuit.sb.cdm.v2
[Bindable] public var selectedCustomerJob:IDSCustomer;
public function selectedJobByIdCallback(evt:Event):void
{
var temp:IDSDTOArrayCollection = evt.currentTarget as IDSDTOArrayCollection;
if(null != temp && temp.length > 0)
{
selectedCustomerJob = IDSJob(temp.getItemAt(0));;
trace(" selectedCustomerJob: " + flash.utils.getQualifiedClassName(selectedCustomerJob));
trace(" jobToSelect type: " + flash.utils.getQualifiedClassName(temp.getItemAt(0)));
trace("jobToSelect super class: " + flash.utils.getQualifiedSuperclassName(temp.getItemAt(0)));
}
}
이 추적 출력은 다음과 같습니다 여기에 편집
정확한 코드 :: IDSJob
jobToSelect 슈퍼 클래스 : com.intuit.sb.cdm.v2 :: IDSCustomer