Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Two things:</p> <p>1) The reason your event is not firing is because you are adding the listener after you set <code>_xlist</code>.</p> <p>2) You should not be adding an event listener within your setter anyways. You should add it on the initialize or creationComplete events of your VBox component.</p> <p><strong>EDIT</strong></p> <p>Alright, after looking at your code again I can see the problem... so just a few more things.</p> <p>3) Why are you naming a method <code>init</code>, when it gets called on <code>creationComplete</code>? You should get into the habit of naming methods appropriately. For example, the method that gets called on <code>creationComplete</code> should be named: <code>onCreationComplete</code>, or <code>handleCreationComplete</code> That way, you will know what your code is doing 6 months down the road.</p> <p>4) This is your main problem: You are using the getters / setters in appropriately. If you have a setter, you should also implement a getter (unless you have a write-only field). More importantly, you should <em>use</em> the getter to access your data. In your <code>xListChanged</code> method you are not using the setter you have defined, thus nothing is getting told the <code>_xlist</code> actually changed. As such, you should change your code to:</p> <pre><code>private var _xlist:XMLListCollection; [Bindable] public function get xlist():XMLListCollection { return this._xlist; } public function set xlist(value:XMLListCollection):void { this._xlist = value; } </code></pre> <p>Whenever you want to access <code>_xlist</code>, use the GETTER. For example, change the dataProvider of your <code>List</code> component to be <code>{xlist}</code>. And the <code>xListChanged</code> method should be using the getter: <code>xlist</code> instead of directly accessing the member <code>_xlist</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload