2010-04-15 6 views

답변

0

시도 : combobox 당신이

을 사용하는 콤보 내가이 있지만 작동 잘 모르겠어요입니다

combobox.collection.length 

. 컬렉션 보호 된 멤버 :(

-1

가 콤보 상자의 dataProvider는 ArrayCollection에입니다 때문에 컨트롤을 서브 클래 싱해야 할 수 있습니다 당신은 수를 계산하는 길이 속성을 사용할 수 있습니다

+0

틀렸어! 쓰기 전용 속성입니다. –

+0

아마 명확하지 않습니다. 내 의미는 arraycollection의 length 속성입니다. – michael

+0

'dataprovider'는 쓰기 전용 속성입니다. –

2
당신을 위해

임의의 생각 :..

var dp : Object = combobox.dataProvider ; 
if(dp is Array) 
{ 
    //do something cool 
} 
else if(dp is ArrayCollection){ 
    //do something equally as cool 
} 

...

+0

"Something cool"은 dp.length – adamcodes

2

나는이 작동하는지 확인했습니다

(comboBox.dataProvider as ArrayCollection).length 
+0

이었을 것입니다. 여러분은 dataProvider가 ArrayCollection이라고 가정하고 있습니다. 또한 Array 일 수도 있습니다. jeremy.mooer의 대답을보십시오. –

관련 문제