문제

I want to use something like that:

var addFunction:Function = needParentNode ? parentNode.appendChild: resultArray.push;

for each(var element:* in elements){
    addFunction(element);
}

But parentNode is XML, so parentNode.appendChild returns an XMLList because of E4X syntax. parentNode['appendChild'] is the same. I know that i can get a wrapper with

function(item:*){parentNode.appendChild(item)}

But is there a way way to get this function without such complications?

도움이 되었습니까?

해결책

Try this,

parentNode.AS3::appendChild

Specifying namespace might help.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top