flex - Binding to an specific property of objects in an array -


I am using Flex so that a small form can be created. I currently have a list component, that I want to populate with a list of font names.

I am receiving fonts using Font.enumerateFonts (true); . It returns an array of flash.text.Font objects.

The font object contains a fontName property that is the string of that font name.

My problem is that I can not understand how the dataprider of the list is to be tied to the font objects' font name in Array.

Is there any way to do this just with bondage? And is not making a new array of strings through font objects?

You probably have an example of labelField property of list control:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Mx: application xmlns: mx = "http://www.adobe.com/2006/mxml" layout = "absolute" initialize = "onInitialize ()" & gt; & Lt; Mx: script & gt; & Lt ;! [CDATA [Import mx.collections.ArrayCollection; [Bindable] Private Vengeance Fonts: Array Collection; Start at Personal Function (): Zero {fonts = New Array Collection (Fonts. Animated Fonts (True)); }] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: list data provider = "{fonts}" labelField = "fontName" /> & Lt; / Mx: Applications & gt; Also keep in mind that I am using an Array for binding (unlike an array) because the arrays do not support the binding you expect. 

Hope that helps! Feel free to post back any questions, please.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -