Sorting data in records by index - problem


I have problem with sorting data in records by its index. In example:

set orderlist to {1, 2, 3}
set FrameDataIdx to {{frameText:"Text 1, ", frameIndex:1}, {frameText:"Text 2, ", frameIndex:2}, {frameText:"Text 3, ", frameIndex:3}}

set TitleCont to ""
repeat with i in FrameDataIdx
	repeat with xi in orderlist
		if (frameIndex of i) = xi then
			set TitleCont to TitleCont & (frameText of i)
		end if
	end repeat
end repeat

After run, the variable TitleCont is empty. But it should be "Text 1, Text 2, Text 3, "
Where I make mistake?



the index variable xi contains a reference to the list item, not the list item itself.
For an equation test you have to explicitly deference the list item

if (frameIndex of i) = contents of xi

Of course!
I forgot about content/object reference issues in AppleScript
Thank You very much.