2

I'm building a custom Datagrid component, and I had three parameter properties:

[Collection] _columns
[Inspectable] _headerHeight
[Inspectable] _rowHeight

This all compiled fine, but I needed to change things about the _columns variable, and it made sense to instead create _columnData to store data from a DataProvider.

Now it throws a ReferenceError every time I try to Test Movie, saying that the property columnData can't be created, despite listing it in the parameter list in the Flash Professional IDE.

The only thing I can imagine is that Flash is somehow caching an earlier version of my class, but that the Flash IDE is correctly updating itself according to my metadata when I rebuild the component. I've cleared out all the stuff from ~/Library/Application Support/Adobe/Flash CS5/CodeModel, restarted Flash, deleted ASO files, I've moved all the files to a new machine, and even built the component from scratch (using the same class) in a new FLA - nothing has worked.

The code causing errors is copied below:

private var _columnData:Object;
private var _headerHeight:Number = 40;
private var _rowHeight:Number = 40;

[Collection(collectionClass="musicone.components.data.DataCollection", collectionItem="musicone.components.controls.datagrid.DatagridColumn", identifier="item")]
public function get columnData():Object {
    return _columnData;
}
public function set columnData(value:Object):void {
    _columnData = value;

    var _forceClass:DataCollection = value as DataCollection;
    //updateColumns();
    draw();
}

[Inspectable(type="Number", defaultValue=40)]
public function get headerHeight():Number {
    return _headerHeight;
}
public function set headerHeight(value:Number):void {
    _headerHeight = value;
    draw();
}

[Inspectable(type="Number", defaultValue=40)]
public function get rowHeight():Number {
    return _rowHeight;
}
public function set rowHeight(value:Number):void {
    _rowHeight = value;
    draw();
}

EDIT: One of the main reasons I'm thinking my code is getting cached somewhere is that changes in the draw() function aren't being shown anywhere - in other words, the only place I can guarantee my changes are having an effect is in the Flash IDE. That said, the fact that the same error occurs on a different machine leads me to believe it's something intrinsic...

Tim
  • 1,018
  • 1
  • 8
  • 12
  • Could you paste the entire error? – Florent Sep 18 '12 at 16:03
  • ReferenceError: Error #1056: Cannot create property columnData on musicone.components.controls.Datagrid. at Datagrid_fla::MainTimeline/__setProp___id0__Scene1_Layer1_0()[Datagrid_fla.MainTimeline::__setProp___id0__Scene1_Layer1_0:7] at Datagrid_fla::MainTimeline() – Tim Sep 18 '12 at 16:43
  • does musicone.components.controls.Datagrid already have a columnData property? Is the class set as final? What class are you extending? MORE INFO MORE INFO MORE INFO – The_asMan Sep 19 '12 at 14:56
  • This is part of the Datagrid class. However, as it turns out, it's something similar to [this](http://stackoverflow.com/questions/2193953/flash-cs4-refuses-to-let-go), where the class itself was being cached behind the scenes, and absolutely nothing I did would change that. I ended up renaming the class and the file from Datagrid to DataGrid (as well as all files it was including... horrible), and everything is working fine. I suspect it might be a problem with using FlashBuilder 4.6 and Flash Professional CS5 together, or something... – Tim Sep 25 '12 at 02:00

0 Answers0