In an effort to make DObject updates easier to react to in actionscript, gendobj now generates
signals for each field that can be listened to individually.
From the old:
barrel.addListener(new AttributeChangeAdapter(function (event :AttributeChangedEvent) :void {
if (event.getName() == BarrelObject.MONKEY_COUNT) {
// ... cast event.getValue() and use it
}
}));
to the new:
barrel.onMonkeyCountChanged.add(function (newValue :int, oldValue :int) :void {
// ...
});
Only AttributeChangedEvent have been signalified, but I'm planning to continue with the other
ChangeListeners shortly.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6328 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
+10
@@ -17,6 +17,10 @@
|
||||
<id>as3corelib-repo</id>
|
||||
<url>https://github.com/samskivert/as3corelib/raw/master/repository</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>as3-signals-repo</id>
|
||||
<url>https://github.com/groves/as3-signals/raw/master/repository</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@@ -34,5 +38,11 @@
|
||||
<scope>compile</scope>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osflash</groupId>
|
||||
<artifactId>signals</artifactId>
|
||||
<version>0.8</version>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user