Typically, I would check for undefined, like so
Code: Select all
if(filters[child].effect.name)
Code: Select all
if(filters[child].effect.name != undefined)
Code: Select all
if(filters[child].effect.name != null)
checking for an xml node
Code: Select all
if(filters[child].contains(effect)){
I get the same error. Also, this style check seems to be working in other cases. Am I getting moved off the track by some other condition that I'm not accounting for?
1:21 p.m. followup
a little more info about what I'm doing. I'm iterating xml nodes in a for in construct.
Code: Select all
var filters = clip.filter;
if(filters){ //this style undefined works here
for(child in filters){
//if I do a alert(typeof filters[child]) here I get a series of xml nodes and then a final undefined node which I think is my problem.
}
}
1:53 pm follow up
So, the basis of all my problems was a bug in logic
Code: Select all
var filters = clip.filter;
Code: Select all
var filters = clip.filter.children();