Categories
Blog News Programming

flex error 1180: Call to a possibly undefined method SortField.

Here I was, following a very nice tutorial showing you how to use an XMLListCollection with a nice example with source view enabled (thank you Bruce Phillips, btw!) when suddenly flexbuilder starts to complain about error 1180 : Call to a possibly undefined method Sortfield.

Even when the sortfield function is right there in the same function !?

It turns out, after quite a bit of googling around finding not very much, that flexbuilder for once did *not* automagically write the import statement for the sortfield. It did so for the sort function, but not for the sortfield function. I don’t know if this only happened to me or if this is so all the time.

But here, the advantage of working with flexbuilder turned to a disadvantage – I expected it to add the import statement necessary for it all by itself; for once, it did not do it.

All I needed to do was to add the  import mx.collections.SortField; to get things working again. Still, I lost some programming time looking for a solution to this problem, so I’m blogging this in case you have a similar experience.

(Visited 592 times, 1 visits today)

2 replies on “flex error 1180: Call to a possibly undefined method SortField.”

Thanks ran into same problem using same Bruce P example. Perhaps someone should come up with a Flex Import Explorer. They seem to have one for everything else.

Leave a Reply to alex Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.