This content has been marked as final. Show 4 replies
Ok, If you have already declared your variables in instance scope, then you can just do:
Yes thank you so much that is exactly what i was trying to figure out.
So if you will bear with me, so I understand:
You need to declare a local variable within your function to take the result, then you use the e4x parenthetical with the command "attribute" to pick out the specific value. This seems to be what I was missing.
I had already assigned the value to a bindable public variable and was trying to parse that but was missing this 'attribute' tag I guess.
Can you use a public variable the same way?
Yes to the public var, in fact that is really more normal.
The expression inside the parentheses evaluates to a Boolean. It can literally be anything that does, including calling out to another function. I do this when I have a very complex criteria.
Both attribute("attributeName") and @attributeName are used to access xml attributes (...label="CM"...). Note I used both in my example. The difference is that when used in a filter expression, @attributeName will error if ANY node in the xml does not have an "attributeName" attribute declared. attribute() does not error. So I always use attribute() in filter expressions.
If you go back and look through the docs Amy pointed out you will see this all discussed, though perhaps not as concisely.
Thanks, when it comes to those documents I guess I need a filter on my search to understand how to filter.
Where I seem to have trouble is in the finer points of the syntax, not having enough familiarity I can miss something like the subtle nuance between using an @ vs. a ("xxx") due to the potential issue of an error-out. The double equal signs thing was a major "gotcha" for me for a long time because I'd seen them used both ways (either "=" or "==") in different parts of the code.
I'm only now beginning to 'see' the different grammar of mxml, actionscript and things like e4x.
I really appreciate your patient help.