Flex :: Make A Wrapped Property Bindable?
May 20, 2011
I have Class1 with a read-only bindable property called age:
public class Class1 {
private var _age:int;
[Bindable(event="ageChanged"]
[Code]....
Of course the [Bindable] tag there doesn't make sense. But how can I achieve the same effect?
I believe I can dispatch some sort of ageChanged event from Class2 up to Class1 and then have an event handler in Class1 dispatch another local ageChanged event to which I bind Class2's age property.
View 2 Replies
Similar Posts:
Dec 1, 2009
I have a class like this. Property "isPag" is based on filed "ecboardid", I found that when ecboardid is changed, UI controls seem not be able to detect that "isPag" is also changed. So, how to make a property like this bindable?[code]...
View 3 Replies
Sep 8, 2009
In my flex app I have a public bindable property.I want it so that every time the value of that property changes, a function gets triggered. I tried using ChangeWatchers, but it seems those only apply to built-in components like a text box change.i would like to do that same behavior with a property that changes at runtime.
View 4 Replies
Sep 20, 2011
I've got a component called Box.as that has following two properties, and have their getters & setters defined:
private var _busy:Boolean;
private var _errorMessage:String;
In MXML that uses this component I define it like this:
<components:Box skinClass="skins.components.BoxSkin"
busy="{presenter.boxBusy}"
errorMessage="{presenter.boxErrorMessage}"/>
Where presenter variable is defined here in MXML and a Presenter class has boxBusy and boxErrorMessage variables defined as bindable property change events:
[Bindable(event="propertyChange")]
function get boxBusy():Boolean;
function set boxBusy(value:Boolean):void;
[Code]....
PROBLEM is that whenever I change boxErrorMessage for the presenter, I see the affect in MXML but nothing happens at all when I change boxBusy. Is there something extra I need to do with boolean variable?
View 1 Replies
Jun 2, 2011
I have inherited an Adobe AIR application, and am attempting to debug it through Flash Builder 4.5. Within Flash Builder, when I look at one of the MXML files, I see warnings for each use of the [Bindable] tag:[code]And there are no missing semi-colons on the lines preceding each warning as per the suggestion in this blog post.The project is configured to use Flex SDK 3.6.Additionally the file will not load in the designer, with this warning:Design mode: Error during component layout. Choose Design > Refresh to refresh design mode.At runtime I am seeing a blank window - which I assume is the result of the bindings not being triggered. Is this tag not available in Flex SDK 3.6?
View 1 Replies
Apr 1, 2012
I have the following code:
<fx:Script>
<![CDATA[
import shared.GlobalsManager;
[code].....
View 1 Replies
Jun 14, 2011
Is it possible to use the Bindable compiler setting when using mxml?
I've got a string that I want to make bindable:
<mx:String id="myString">My Text</mx:String>
I could make it bindable in Actionscript, like this:
[Code]...
But it threw a lot of warnings-- other classes were already marked bindable in my App.
View 1 Replies
Jul 21, 2010
I have wrapped text in a box I'd like to do a "zoom-in" effect on. It is 3 lines long in the box. I don't want to make the font size bigger and bigger because that will change the way it wraps. Do I have to "break apart" the layer until it's outlined? I'd rather leave the text editable.
View 3 Replies
Mar 4, 2010
If I create an object like so:
class Foo {
[Bindable] public var property: String;
}
The class Foo has an implicit event dispatcher to handle property change events. How can I access that without making Foo explicitly extend EventDispatcher?
View 1 Replies
Mar 14, 2011
I have a small question. I am probably misunderstanding something, but when I do :
[Code]....
View 1 Replies
Feb 5, 2010
I'm trying to use XML to convert the code that a Flex RTE creates to valid HTML. No problems on other HTML elements, but difficulty with unordered lists. I created a solution for moving consecutive LIs into a UL node. After trial and error, I came up with the following solution. My question is - surely there's a better way to do this?
for each (listXML:XML in xml..li) {
if (listXML.children().length() == 0) {
// list item is empty - make it an empty paragraph instead
[code].....
View 1 Replies
Jul 16, 2009
How can the text in a Label control (or a similar control) be wrapped in Flex 4 beta? In Flex 3 I could use the Text control but this is no longer available in Flex 4.
View 1 Replies
Jan 28, 2011
My Combobox is not alway updating when I update the ArrayCollection.[code]...
the first time it updates the combobox fine and sometimes it works the 2nd, 3rd, etc time is might update the combo box. After it stops updating the combobox, it never does until I restart the app. I have verified that the ArrayCollection is updated via the debug data, it is just the combobox is not updating the display.
View 1 Replies
May 26, 2011
I have a Number variable, named isConflict, whose value is passed in from a parent. I would like to put a ChangeWatcher on this item so that a function named changeBGColor will run whenever the value is changed. Within my creationComplete function of init, i have the following:
var isConflictWatch:ChangeWatcher = BindingUtils.bindSetter(changeBGColor, this, "isConflictChain");
View 1 Replies
May 31, 2011
I am just just curious as to whether the [Bindable] metadata tag in ActionScript 3 can only be used within the Flex framework, or can it be used in "regular" ActionScript projects where Flex isn't used?
View 1 Replies
Sep 8, 2010
I've spend hours searching for a way to put one paragraph of text in one tree node in Adobe flex. How can I do it? I created a simple tree view but the text is cut after the right border.
So I tried to create a tree renderer. In the renderer I specified width=100 and the text wrapped. But the height of the nodes was not being calculated properly, so the text over consecutive nodes overlapped and got messed.
So how do i do wrapped text in a tree node?
View 1 Replies
Sep 5, 2010
ActionScript allows you to mark a variable as [Bindable], causing any changes to that variable to have immediate effect all over your application.How would you implement this feature in your favourite programming language?
View 1 Replies
May 27, 2011
I'm studying a demo code and it seems to me that an instance of a class is never instantiated, in particular I have this line:
[Code]....
View 1 Replies
Sep 7, 2010
I have a component where a Button is wrapped in BorderContainer. I'm passing a custom property to the component at run-time to change the label of the button but Flex is reporting the following error:
Cannot access a property or method of a null object reference
When the error occurs, Flex highlights the following code:
myButton.label = value;
Here's the app:
// MyApp.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
[code]....
View 1 Replies
Apr 20, 2011
I have a situation where I need to update a DropDownList's dataProvider and selectedItem in a specific order. See the following code ...
<s:DropDownList id="dropDownList"
dataProvider="{someDataProvider}"
selectedItem="{someSelectedItem}" />
In my case, some user interaction produces new values for the bindable variables "someDataProvider", and "someSelectedItem". However, when flex renders the DropDownList, the control's selected value is empty.
The reason for this is that the DropDownList's "selectedItem" property gets bound before the "dataProvider" property. The "dataProvider" needs to be bound first for "selectedItem" to be valid, this is because the new "selectedItem" points into the new "dataProvider".
what is the best practice for updating bindable properties in a specific order? I've come up with a few ways (e.g. using a valueCommit handler), but I wanted to see what the community had to say.
View 2 Replies
Dec 29, 2009
I'm trying to extend a class like panel so that I can fire click events only when the title area is clicked on. The title area is a protected uicomponent of Panel called titleBar. So I want to make that component public.It seems like I'm almost there but I'm getting a "TypeError: Error #1009: Cannot access a property or method of a null object reference." when it tries to add an event listener to the titlebar.
here is my extended panel
package custClass{
import mx.containers.Panel;
import mx.core.UIComponent;
public class ExtPanel extends Panel{
[code]....
And then this in the AS:
newPanel.getTitleBar().addEventListener(MouseEvent.ROLL_OVER,over);
Still getting the same error.
View 2 Replies
Oct 12, 2009
How do you make the childAllowsParent property of an SwfLoader go from false to true, that is, how as a parent application do you set up security to make the child app's events and other properties accessible to you. To read the flex docs on this, one would think nothing could be simpler:
"This property [childAllowsParent] is set to true if the child object has called the allowDomain() method to grant permission to the parent domain or if a URL policy is loaded at the child domain that grants permission to the parent domain. If child and parent are in the same domain, this property is set to true . [emphasis added]" So, I'm in a development environment and want to load an swf from my own system via an SWFLoader and then be able to monitor its events within the parent app.
[Code].....
View 1 Replies
Jan 7, 2010
I am developing an application with Flex for the GUI and Restlet for the webservices. I have a strange problem. I put my XML as a property on a generic object, and send it as part of a POST request. But in the Restlet webservice, this XML is irretrievable. How do I retrieve it? I tried initialising the received Representation object to a DomRepresentation, but thats not working. If I put the received Representation object into a Form object, then getFirstValue is returning that XML as a string! I noticed that the contentType of the HTTPService was application/www-form-encoded so I set it to application/xml and its not helping either. I use restlet 2.0m6 and here is the code snippet that I use -
[Code]...
View 1 Replies
Feb 8, 2012
I am unable to bind the selectedIndex public property of a spark DropDownList to it's original source in the view's presentation model.
For the purposes of replicating this issue with as few lines as possible I have two views, and one presentation model. The code follows.
Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code]...
Debugging the application I find that selectedIndex in the presentation model always remains at the default value assigned regardless of which item I selected from the DropDownList. For the sample code above this is -1.How can I bind the selectedIndex in the presentation model such that it is updated appropriately when the selected item DropDownList changes?
View 1 Replies
Jul 8, 2010
I have a class called which is called ChartInfo,and it has a getter and setter methods as:
[Code]....
It will always give error like: 1195: Attempted access of inaccessible method isShowingPower through a reference with static type components.charting:ChartInfo.
View 2 Replies
Jul 26, 2011
Setting the text property of a flex DateField makes the selectedDate property of that DateField go to null.I need to set the text property so that I can use a particular format (DD-MMM-YYYY).
View 2 Replies
Jan 9, 2011
Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).
So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?
View 3 Replies
Sep 20, 2011
Can we put [Bindable] on functions/methods? I know that bindable is used to change the value of the source property to destination property. But not sure if we can use that for methods. why we cannot put/ if we can then what will be the outcome?
View 1 Replies
Jul 4, 2009
I'm trying to position some MCs in rows in the stage (MCs created dinamically) in a manner that when they reach a max width they jump to a row bellow, like words wrapped in a page with left alignment or, to better explain, like the image scheme attached. Each MC has a different width.
I've tryed a lot with no success. But I guess that I'm almost there. At this moment I'm using an array that retrieves each MCs width and another that retrieves the widths sum. Here's my code, important parts in red:
[Code]...
View 5 Replies
Sep 5, 2009
I am having an issue with Mochiads. I have one of my Flash games on Facebook. Everything works just fine when the SWF is hosted by me. However, when I give it to Mochiads, they create a wrapper for the file, and the facebook transactions don't work. I suspect it's because of this code:
[Code]....
Facebook passes in some parameters when it loads the SWF, such as session ID and user ID. However, when the SWF looks at this.root.loaderInfo it is only looking at the Mochiads wrapper, not the Facebook canvas that loaded it. I am going to contact Mochiads and see what they recommend. I suspect it might be worth trying this:
View 5 Replies