I have been writing some base classes in AS that handle a lot of the basic functinality across some common components. I have come across this error "1114: The public attribute can only be used inside a package." I will post snippits of the code that I think a causing the problem but I still don't understand what the problem is, most of the documentation I have found doesn't seem relivent.
Code:
<?xml version="1.0" encoding="utf-8"?>
<EditorBase xmlns="com.my.components.*" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Panel title="My Panel">
<!-- Lots of MXML here -->
<mx:ControlBar>
<mx:Button label="Save" activate="dispatchSave()"/>
<mx:Button label="Close" activate="dispatchClose()"/>
</mx:ControlBar>
</mx:Panel>
</EditorBase>
The error happens on both the button's activate event. Both dispatchSave() and dispatchClose() methods are defined on the EditorBase class which looks like this:
ActionScript Code:
package com.my.components
{
import com.my.events.SaveEvent;
import mx.containers.Canvas;
import mx.events.CloseEvent;
[Event(name="save",type="com.my.events.SaveEvent")]
[Event(name="close",type="mx.events.CloseEvent")]
public class EditorBase extends Canvas {
public function EditorBase() {
super();
}
// Lots more AS here
public function dispatchSave():void {
dispatchEvent(new SaveEvent(SaveEvent.SAVE, false, false, _dataProvider));
}
public function dispatchClose():void {
dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
}
}
}
Can anyone make any sergestions as to what might be wrong?
Thanks