I am using Flex to create a small form. All I have at the moment is a List component, that I want to populate with a list of font names.I am getting the fonts using Font.enumerateFonts(true);. This returns an array of flash.text.Font objects.
The Font objects have a fontName property that is a String of that fonts name.My problem is that I can't figure out how to bind the List's dataProvider to the fontName property of each of the Font objects in the Array.Is there a way to do this just with binding? and not creating a new array of Strings by looping through the Font objects?
I am pretty new to flex, specially to mxml part. There are some confusing things for me.[code]...
So question is how do I access that button's properties. I want when something happens in Xyz file, button's (someId) visibility to become false. If Abc.mxml was AS class file then it would be easy, just make object etc., but how to get if it's mxml file.
i would like to update the numbers i've added to an array from variables, when thosevariables change. is it possible change these variables and have the array update utomatically?
var first:Number = 1; var second:Number = 2; var myArray:Array = new Array(first, second);
I am created a dynamically adding a VBox, that contains two images. Into a Custom Component that is derived from UIComponent. The problem is the Vbox that contains the two image is only a really tiny size. I would like the VBox stretch to the size of the two images. This is how I am creating the Vbox....
Is it bad practice/design to nest components inside components using Flex 4? Should I simply be creating components and inserting them into my main application as below, or doesn't it matter?
I'm used to building web apps using proper architectures, but relatively new to the RIA space.One of the issues in rich client app is approaches to handling communication across components. (I've played around using the EventBroker concept.)In a recent Flex3/AS app I was looking at they took an approach that seemed to work pretty well, but I wonder about the drawbacks (or any other pros)...They took the concept of having a singleton object that would hold objects that could be used obviously from any components within the app by a simple call to...
var myAppModel:AppModel = AppModel.getInstance();
You thus could put any objects in there that you wanted access to from different components. It seemed to serve as the equivalent of a "Session" in the JEE space. I'm not so sure from an OO perspective it's the best thing to do, but it did seem to work pretty well.
I've posted my question on other forum but without success so I couraged myself to ask here too. I've got an application (see image) which consists mainly from two different components. It is media player similar to winamp or so. Two main components are MainPanel and second one Playlist. These contain several other components so MainPanel constains Buttons objects TimeCounter or TrackDescriptionWidnow etc. and Playlist contains AlbumNext AlbumPrev buttons, Display which holds Textfields with names of tracks. So the thing which is most complicated is actually communicatig between some objects. Let's say I click on the track in the Playlist. In fact many objects need data when other one changes its state. When I click NextTrackButton in MainPanel, next songName displayed in the Playlist needs to shine, or if the ShuffleButton is pressed one of the random song will be played. My question is how to communicate between objects that are not in the propagation scope when events occur For example if some object fire an event in the playlist(Component2) only objects that come from Stage through Engine can listen for that event. So objects in MainPanel can not hear dispatched event. I've got many events, many objects listening for some of them, and I ended up with the total mess who is listening for. I register events to my class by public static const EVENT_NAME; and then dispatch it on that occured situtation. I managed to add some events listener to Engine and set bubbling to true, this way Engine can listen for most of the events, but then I have to dispatc new event to the other component to make it listening. Do you know how to communicate properly between differently scoped objects?
Here is what I'm trying to do. I have some TextArea objects inside a HGroup, created in the mxml part. I want them to have an id of an element of a bidimensional Array, a matrix. I'm having problems declaring the TextArea objects as Array components. I've tried a lot of formats and google it, but I found nothing relevant.
I did suppress warnings in flex compiler using "-show-binding-warnings=false". But what I am interested to achieve is to suppress run time warnings (especially binding warnings - since I am getting data in model mostly in XML structures and it is fine for me if its unable to bind to its nested child nodes) in console (I am working on flex on Eclipse with the flex plug in). Is there a way to achieve it?
I'm writing a Flex application using Flash Builder 4 and I'm having a bit of trouble with an AS3 object.Essentially, it is a BorderContainer, with a few buttons and images, and programming logic that determines how these interact with eachother and a database.
What I want to be able to do is configure the layout/style of the inner components using MXML and CSS. I can configure the inherited objects, but not ones that I have defined.[code]...
I have this variable in Model class:[code]I've used BindingUtils to get notified when the XML changes:[code]Function onChange gets triggered when I assign an XML to the variable, but not when I change some attribute of the XML: Model.getInstance().someXml.@attr = "newValue";
first one shows playheadtime of videodisplay and another is also used for same purpose. the difference is that when we are in add mode(decided from a flag variable) both should show current playheadtime using binding. but when we are in edit mode(again decided from flag) the latter label should remain static, to be more specific, the value retrived from database.how can I do that using actionscript. I tried ChangeWathcer but I found it a bit tricky. Is there any other simpler way or am I missing something. following is my code.
private function init():void { if (queFlag == 'a')
I want to load key/values configuration pairs stored in XML file. To bind a collection of data i know i need to use the ArrayList class, but the problem is that i want to be able to bind the loaded values using their corresponding keys and not by their indexes in the ArrayList object. For example i want to be able to do this :
[Code]...
So the question is how to bind the key/value pairs loaded form XML. I don't want to go manually set variables, i want to bind them so when they are loaded the are set automatically. Did anyone had to do something like that ?
I have a datagrid that gets its data from a webservice.When data from the webservice is retrived it calls the following function:
private function onListReg():void { arrRegOld = WSAutoreg.list.lastResult as ArrayCollection; arrReg = WSAutoreg.list.lastResult as ArrayCollection;
[code].....
The intent is when I hit a update button, it compares arrRegOld with arrReg and see if any values have changes. The problem is whenever I change values on the Datagrid it changes on both the dataProvider and on both ArrayCollections.What should I do so that the binding applies only to one ArrayCollection?
I'm having some troubles with binding data. I have an application that contains a viewstack of components. Let's say I have comp1, comp2 and comp3 inside the viewstack. Each component, has its own data class --> comp1Data.as, comp2Data.as and comp3Data.as. All values in each component are binded to the corresponding data in it's data object.
A click in a control in comp1 leads to comp3, the same goes for comp2. Clicking a control in comp2 leads to comp3. When going from comp1 to comp3, comp3Data.as is initialized and and comp3 displays the binded values. When going from comp2 to comp3, comp3Data.as is also initialized but the binded values are not displayed...
I am using flex SDK 3.5. I have model.as and in it i have an ArrayCollection (name it arr_mod) which is Bindable.
From my mxml i link to this arr_mod in three places: 1) in DataGrid i set dataprovider={arr_mode} ...
2) in Button i add new item to the arr_mod this way: mx:Button .. click = "{arr_mod.addItem(new Item)}"
3) in textBox i want to add mx:TextBox text="{mySpecialCounterFunc(arr_mod)}" note that in the Script of mxml arr_mod is Bindable as well as in the class definition in model.as
The problem is, that when clicking on button, mySpecialCounterFunc is not called! it should be called, since i use {} and this should listen to changes in arr_mod (a change that was made in the button should cause a new item to be added.. and than the listener to respond). While The DataGrid is updated correctly! By the way, if i change arr_mod to simple String or Int it works.. i.e. mySpecialCounterFunc is called Why??
I'd like to add a derived property to flex:[code]However, derived won't update when I change a or b.Is there a better (faster) way to make derived update than giving a and b setter methods which invalidate it?added keyword "get".This makes more sense now, I hope.
Is it possible to bind a property (don't know which) of the mx:Image control, so that it is (should be) possible to get in form of a bytearray? (using Flex 4) i have to forward the bytearray to a WCF service to be stored and afterwards retrieved!
I've been kinda stuck in trying to organize data and bind them to a Repeater in one my applications.What I did at first, was to save an array of arrays, so that I could've accessed any value very easily. But then I realized that I needed to bind them to a Repeater, so I had to switch to an ArrayCollection of arrays. But the Binding issues weren't solved, since there are still arrays (not bindable) inside the ArrayCollection.Below an example of what I want to do:
<mx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var arr:ArrayCollection = new ArrayCollection(
[code]....
the traces show that the array size changes, but the repeater doesn't update.
I have several components where I want to enable buttons based on passing a username to a function. I want to dynamically bind the "enabled" property on a button so that if the "somethingChanged" event fires, a button may become enabled or disabled. But, I'm not sure where to fire the "somethingChanged" event. It's possible that I may need to fire the "somethingChanged" event from several places in the application. Is this possible with a bound static function?
EventManager.as public class EventManager():void { [Bindable(event="somethingChanged")] public static function hasAccess(myVal:String):Boolean { }} [Code] .....
I need to bind a property to an edit control and have the control write its value back to the same property. The problem is, I'm setting the source value before the control is created:
<mx:Panel> <mx:Script> <![CDATA[ [Bindable] public var editedDocument: XML;
But I get a warning from Flex that the binding wouldn't work that way and it doesn't. It works the first time I load up the component but every time I change findFriendsPaginationElement it doesn't reflect on the component. Do you know how I can go about doing this? (making changing a value in the binding variable changes the status of an element inside a component?)
I am trying to bind an ArrayCollection result coming in from the server to my DataGrid created dynamically in AS. The result data is not getting Displayed in the Grid. var dg:DataGrid = new DataGrid(); dg.width=650; dg.dataProvider=someArrayCollfromServer;
I am adding the dgColumn as runtime based on some data from a XML and it is the same as defined in below static format. But if I use the same code and create the DataGrid as a Flex Component as below, it works fine. <mx:DataGrid id="dg" width="100%" height="100%" dataProvider="{someArrayCollfromServer}"> <mx:columns> <mx:DataGridColumn dataField="Value" headerText="Value"/> <mx:DataGridColumn dataField="Code" headerText="Code" /> </mx:columns> </mx:DataGrid>
This works fine. Is there some functionality or implementation different as far as DataGrid is concerned in Flex and AS.