From e100ef4faf6d40168936e0d6316c769306470ac1 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 9 May 2006 23:03:47 +0000 Subject: [PATCH] Updated to match API changes in Beta3. InvocationRegistration had a constructor called Registration. I wonder if that was causing the compile error with beta2. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4104 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/ArrayMask.as | 2 +- .../com/threerings/io/FrameAvailableEvent.as | 2 +- src/as/com/threerings/io/FrameReader.as | 4 +-- src/as/com/threerings/io/ObjectInputStream.as | 8 ++--- .../com/threerings/io/ObjectOutputStream.as | 6 ++-- src/as/com/threerings/io/Streamer.as | 6 ++-- .../io/streamers/ByteArrayStreamer.as | 2 +- .../com/threerings/media/image/ImageUtil.as | 29 ++++++++++++++++--- .../com/threerings/presents/client/Client.as | 6 ++-- .../presents/client/ClientDObjectMgr.as | 2 +- .../presents/client/Communicator.as | 6 ++-- .../presents/client/InvocationDirector.as | 6 ++-- .../presents/client/InvocationRegistration.as | 3 +- .../threerings/presents/client/TestClient.as | 2 +- .../presents/dobj/AttributeChangedEvent.as | 4 +-- .../threerings/presents/dobj/CompoundEvent.as | 3 +- src/as/com/threerings/presents/dobj/DEvent.as | 3 +- .../com/threerings/presents/dobj/DObject.as | 5 ++-- src/as/com/threerings/presents/dobj/DSet.as | 5 ++-- .../presents/dobj/ElementUpdatedEvent.as | 3 +- .../presents/dobj/EntryAddedEvent.as | 4 +-- .../presents/dobj/EntryRemovedEvent.as | 3 +- .../presents/dobj/EntryUpdatedEvent.as | 4 +-- .../dobj/InvocationNotificationEvent.as | 4 +-- .../presents/dobj/InvocationRequestEvent.as | 4 +-- .../presents/dobj/InvocationResponseEvent.as | 4 +-- .../threerings/presents/dobj/MessageEvent.as | 4 +-- .../threerings/presents/dobj/NamedEvent.as | 2 +- .../presents/dobj/ObjectAddedEvent.as | 4 +-- .../presents/dobj/ObjectDestroyedEvent.as | 2 +- .../presents/dobj/ObjectRemovedEvent.as | 2 +- .../com/threerings/presents/dobj/OidList.as | 4 +-- .../threerings/presents/net/Credentials.as | 3 +- .../threerings/presents/net/PingRequest.as | 4 ++- .../threerings/presents/net/PongResponse.as | 4 ++- .../presents/net/UsernamePasswordCreds.as | 3 +- src/as/com/threerings/util/ClassUtil.as | 17 ++++++----- src/as/com/threerings/util/MessageBundle.as | 2 -- src/as/com/threerings/util/Util.as | 5 ++-- 39 files changed, 101 insertions(+), 85 deletions(-) diff --git a/src/as/com/threerings/io/ArrayMask.as b/src/as/com/threerings/io/ArrayMask.as index f777f659c..4e1ea74d6 100644 --- a/src/as/com/threerings/io/ArrayMask.as +++ b/src/as/com/threerings/io/ArrayMask.as @@ -1,6 +1,6 @@ package com.threerings.io { -import flash.util.ByteArray; +import flash.utils.ByteArray; public class ArrayMask { diff --git a/src/as/com/threerings/io/FrameAvailableEvent.as b/src/as/com/threerings/io/FrameAvailableEvent.as index ff19efa49..848a04c20 100644 --- a/src/as/com/threerings/io/FrameAvailableEvent.as +++ b/src/as/com/threerings/io/FrameAvailableEvent.as @@ -2,7 +2,7 @@ package com.threerings.io { import flash.events.Event; -import flash.util.ByteArray; +import flash.utils.ByteArray; public class FrameAvailableEvent extends Event { diff --git a/src/as/com/threerings/io/FrameReader.as b/src/as/com/threerings/io/FrameReader.as index 7e7773185..ac7a69adb 100644 --- a/src/as/com/threerings/io/FrameReader.as +++ b/src/as/com/threerings/io/FrameReader.as @@ -5,8 +5,8 @@ import flash.events.ProgressEvent; import flash.net.Socket; -import flash.util.ByteArray; -import flash.util.Endian; +import flash.utils.ByteArray; +import flash.utils.Endian; import com.threerings.presents.Log; diff --git a/src/as/com/threerings/io/ObjectInputStream.as b/src/as/com/threerings/io/ObjectInputStream.as index d42b0f028..88e5dd136 100644 --- a/src/as/com/threerings/io/ObjectInputStream.as +++ b/src/as/com/threerings/io/ObjectInputStream.as @@ -2,13 +2,13 @@ package com.threerings.io { import flash.errors.IOError; -import flash.util.ByteArray; -import flash.util.IDataInput; +import flash.utils.ByteArray; +import flash.utils.IDataInput; import com.threerings.util.ClassUtil; import com.threerings.util.SimpleMap; -import com.threerings.presents.Log; +//import com.threerings.presents.Log; public class ObjectInputStream { @@ -74,7 +74,7 @@ public class ObjectInputStream Log.debug("Creating object sleeve..."); var target :Object; if (cmap.streamer === null) { - var clazz :Class = flash.util.getClassByName(cmap.classname); + var clazz :Class = ClassUtil.getClassByName(cmap.classname); target = new clazz(); } else { diff --git a/src/as/com/threerings/io/ObjectOutputStream.as b/src/as/com/threerings/io/ObjectOutputStream.as index 3eb63cec3..ed6f60347 100644 --- a/src/as/com/threerings/io/ObjectOutputStream.as +++ b/src/as/com/threerings/io/ObjectOutputStream.as @@ -1,9 +1,7 @@ package com.threerings.io { -import flash.util.trace; - -import flash.util.ByteArray; -import flash.util.IDataOutput; +import flash.utils.ByteArray; +import flash.utils.IDataOutput; import com.threerings.util.ClassUtil; import com.threerings.util.SimpleMap; diff --git a/src/as/com/threerings/io/Streamer.as b/src/as/com/threerings/io/Streamer.as index 6f7cd798a..5b03ffa89 100644 --- a/src/as/com/threerings/io/Streamer.as +++ b/src/as/com/threerings/io/Streamer.as @@ -1,14 +1,12 @@ package com.threerings.io { -import flash.util.trace; - -import flash.util.ByteArray; +import flash.utils.ByteArray; import com.threerings.util.ClassUtil; import com.threerings.util.SimpleMap; import com.threerings.io.streamers.ArrayStreamer; -import com.threerings.io.streamers.ByteyStreamer; +import com.threerings.io.streamers.ByteStreamer; import com.threerings.io.streamers.ByteArrayStreamer; import com.threerings.io.streamers.FloatStreamer; import com.threerings.io.streamers.IntegerStreamer; diff --git a/src/as/com/threerings/io/streamers/ByteArrayStreamer.as b/src/as/com/threerings/io/streamers/ByteArrayStreamer.as index 71dcef72e..a783c8174 100644 --- a/src/as/com/threerings/io/streamers/ByteArrayStreamer.as +++ b/src/as/com/threerings/io/streamers/ByteArrayStreamer.as @@ -1,6 +1,6 @@ package com.threerings.io.streamers { -import flash.util.ByteArray; +import flash.utils.ByteArray; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/media/image/ImageUtil.as b/src/as/com/threerings/media/image/ImageUtil.as index 87d0097bf..b6c1a8edb 100644 --- a/src/as/com/threerings/media/image/ImageUtil.as +++ b/src/as/com/threerings/media/image/ImageUtil.as @@ -1,10 +1,14 @@ package com.threerings.media.image { +import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.DisplayObject; import flash.display.Shape; -import flash.display.TextField; +import flash.geom.Point; +import flash.geom.Rectangle; + +import flash.text.TextField; import flash.text.TextLineMetrics; /** @@ -13,16 +17,33 @@ import flash.text.TextLineMetrics; public class ImageUtil { /** - * Create a Shape that will display an error message of the specified - * dimensions. + * Create a DisplayObject that will display an error message + * of the specified dimensions. */ - public static function createErrorImage (width :int, height :int) :Shape + public static function createErrorImage (width :int, height :int) + :DisplayObject { var shape :Shape = new Shape(); shape.graphics.beginBitmapFill(createErrorBitmap()); shape.graphics.drawRect(0, 0, width, height); shape.graphics.endFill(); return shape; + + /* + // Alternate implementation that creates an actual Bitmap object + var src :BitmapData = createErrorBitmap(); + var data :BitmapData = new BitmapData(width, height, false); + data.draw(src); + var rect :Rectangle = new Rectangle(0, 0, src.width, src.height); + for (var xx :int = 0; xx < width; xx += src.width) { + for (var yy :int = 0; yy < height; yy += src.height) { + if (xx != 0 || yy != 0) { + data.copyPixels(data, rect, new Point(xx, yy)); + } + } + } + return new Bitmap(data); + */ } /** diff --git a/src/as/com/threerings/presents/client/Client.as b/src/as/com/threerings/presents/client/Client.as index 3cbc6dcbf..3e6e6b649 100644 --- a/src/as/com/threerings/presents/client/Client.as +++ b/src/as/com/threerings/presents/client/Client.as @@ -5,7 +5,7 @@ import flash.display.Stage; import flash.events.EventDispatcher; import flash.events.TimerEvent; -import flash.util.Timer; +import flash.utils.Timer; import com.threerings.util.ObserverList; @@ -123,7 +123,7 @@ public class Client extends EventDispatcher return _version; } - public function setVersion (version :String) + public function setVersion (version :String) :void { _version = version; } @@ -270,7 +270,7 @@ public class Client extends EventDispatcher return; } - var now :uint = flash.util.getTimer(); + var now :uint = flash.utils.getTimer(); if (now - _comm.getLastWrite() > PingRequest.PING_INTERVAL) { _comm.postMessage(new PingRequest()); } diff --git a/src/as/com/threerings/presents/client/ClientDObjectMgr.as b/src/as/com/threerings/presents/client/ClientDObjectMgr.as index 9a336ede7..11f673913 100644 --- a/src/as/com/threerings/presents/client/ClientDObjectMgr.as +++ b/src/as/com/threerings/presents/client/ClientDObjectMgr.as @@ -23,7 +23,7 @@ package com.threerings.presents.client { import flash.events.Event; import flash.events.TimerEvent; -import flash.util.Timer; +import flash.utils.Timer; import mx.collections.IList; diff --git a/src/as/com/threerings/presents/client/Communicator.as b/src/as/com/threerings/presents/client/Communicator.as index a33ac90fc..622c81ed7 100644 --- a/src/as/com/threerings/presents/client/Communicator.as +++ b/src/as/com/threerings/presents/client/Communicator.as @@ -5,8 +5,8 @@ import flash.events.IOErrorEvent; import flash.net.Socket; -import flash.util.ByteArray; -import flash.util.Endian; +import flash.utils.ByteArray; +import flash.utils.Endian; import com.threerings.util.Util; @@ -135,7 +135,7 @@ public class Communicator */ internal function updateWriteStamp () :void { - _lastWrite = flash.util.getTimer(); + _lastWrite = flash.utils.getTimer(); } /** diff --git a/src/as/com/threerings/presents/client/InvocationDirector.as b/src/as/com/threerings/presents/client/InvocationDirector.as index 0f4c4990c..a5c0fa10f 100644 --- a/src/as/com/threerings/presents/client/InvocationDirector.as +++ b/src/as/com/threerings/presents/client/InvocationDirector.as @@ -70,7 +70,8 @@ public class InvocationDirector public function unregisterReceiver (receiverCode :String) :void { // remove the receiver from the list - for (var iter :IViewCursor = _reclist.getCursor(); iter.moveNext(); ) { + for (var iter :IViewCursor = _reclist.createCursor(); + iter.moveNext(); ) { var decoder :InvocationDecoder = (iter.current as InvocationDecoder); if (decoder.getReceiverCode() === receiverCode) { @@ -115,7 +116,8 @@ public class InvocationDirector { _clobj.startTransaction(); try { - for (var itr :IViewCursor = _reclist.getCursor(); itr.moveNext(); ) { + for (var itr :IViewCursor = _reclist.createCursor(); + itr.moveNext(); ) { var decoder :InvocationDecoder = (itr.current as InvocationDecoder); assignReceiverId(decoder); diff --git a/src/as/com/threerings/presents/client/InvocationRegistration.as b/src/as/com/threerings/presents/client/InvocationRegistration.as index dc8527691..061c34400 100644 --- a/src/as/com/threerings/presents/client/InvocationRegistration.as +++ b/src/as/com/threerings/presents/client/InvocationRegistration.as @@ -24,7 +24,8 @@ public class InvocationRegistration public var receiverId :int; /** Creates and initializes a registration instance. */ - public function Registration (receiverCode :String, receiverId :int) + public function InvocationRegistration ( + receiverCode :String, receiverId :int) { this.receiverCode = receiverCode; this.receiverId = receiverId; diff --git a/src/as/com/threerings/presents/client/TestClient.as b/src/as/com/threerings/presents/client/TestClient.as index 6eaacca27..3a2ed80c6 100644 --- a/src/as/com/threerings/presents/client/TestClient.as +++ b/src/as/com/threerings/presents/client/TestClient.as @@ -1,6 +1,6 @@ package com.threerings.presents.client { -import flash.util.describeType; +import flash.utils.describeType; import mx.collections.ArrayCollection; diff --git a/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as b/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as index 53e3c06fd..bc4ede5b0 100644 --- a/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as +++ b/src/as/com/threerings/presents/dobj/AttributeChangedEvent.as @@ -1,10 +1,10 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * An attribute changed event is dispatched when a single attribute of a * distributed object has changed. It can also be constructed to request diff --git a/src/as/com/threerings/presents/dobj/CompoundEvent.as b/src/as/com/threerings/presents/dobj/CompoundEvent.as index 4e72bfb5c..0f85e7e0e 100644 --- a/src/as/com/threerings/presents/dobj/CompoundEvent.as +++ b/src/as/com/threerings/presents/dobj/CompoundEvent.as @@ -21,14 +21,13 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import mx.collections.IList; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.util.StreamableArrayList; +import com.threerings.util.StringBuilder; /** * Used to manage and submit groups of events on a collection of diff --git a/src/as/com/threerings/presents/dobj/DEvent.as b/src/as/com/threerings/presents/dobj/DEvent.as index 3bf7ee934..e68bb61b2 100644 --- a/src/as/com/threerings/presents/dobj/DEvent.as +++ b/src/as/com/threerings/presents/dobj/DEvent.as @@ -1,12 +1,11 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; import com.threerings.util.Comparable; +import com.threerings.util.StringBuilder; import com.threerings.presents.Log; diff --git a/src/as/com/threerings/presents/dobj/DObject.as b/src/as/com/threerings/presents/dobj/DObject.as index 2eac09f7b..15ee47033 100644 --- a/src/as/com/threerings/presents/dobj/DObject.as +++ b/src/as/com/threerings/presents/dobj/DObject.as @@ -2,11 +2,10 @@ package com.threerings.presents.dobj { import flash.events.EventDispatcher; -import flash.util.StringBuilder; - import mx.collections.ArrayCollection; import com.threerings.util.ClassUtil; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; @@ -258,7 +257,7 @@ public class DObject // extends EventDispatcher /** * Calls by derived instances when a set updater method was called. */ - protected function requestEntryUpdate (name :String, entry :DSetEntry) + protected function requestEntryUpdate (name :String, entry :DSetEntry) :void { // dispatch an entry updated event postEvent(new EntryUpdatedEvent(_oid, name, entry, null)); diff --git a/src/as/com/threerings/presents/dobj/DSet.as b/src/as/com/threerings/presents/dobj/DSet.as index b7767b68f..7787e700e 100644 --- a/src/as/com/threerings/presents/dobj/DSet.as +++ b/src/as/com/threerings/presents/dobj/DSet.as @@ -1,12 +1,11 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import mx.utils.ObjectUtil; +import com.threerings.util.ArrayIterator; import com.threerings.util.Equalable; import com.threerings.util.Iterator; -import com.threerings.util.ArrayIterator; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as b/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as index fb769f961..d3bddc8cf 100644 --- a/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as +++ b/src/as/com/threerings/presents/dobj/ElementUpdatedEvent.as @@ -1,10 +1,9 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; /** * An element updated event is dispatched when an element of an array diff --git a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as index d3ba227e4..d78dab39f 100644 --- a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as @@ -1,10 +1,10 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + import com.threerings.presents.Log; /** diff --git a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as index 27cf95831..3986aba2f 100644 --- a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as @@ -1,10 +1,9 @@ package com.threerings.presents.dobj { - -import flash.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; import com.threerings.presents.Log; diff --git a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as index be6974794..d469a4810 100644 --- a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as @@ -1,10 +1,10 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + import com.threerings.presents.Log; /** diff --git a/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as b/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as index 08fddc936..01bbf6785 100644 --- a/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationNotificationEvent.as @@ -21,11 +21,11 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * Used to dispatch an invocation notification from the server to a * client. diff --git a/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as b/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as index 9c9eaa6ff..b47946952 100644 --- a/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationRequestEvent.as @@ -21,11 +21,11 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * Used to dispatch an invocation request from the client to the server. * diff --git a/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as b/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as index 869204da7..7fe2e9910 100644 --- a/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as +++ b/src/as/com/threerings/presents/dobj/InvocationResponseEvent.as @@ -21,11 +21,11 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * Used to dispatch an invocation response from the server to the client. * diff --git a/src/as/com/threerings/presents/dobj/MessageEvent.as b/src/as/com/threerings/presents/dobj/MessageEvent.as index b66071f0d..8a325a749 100644 --- a/src/as/com/threerings/presents/dobj/MessageEvent.as +++ b/src/as/com/threerings/presents/dobj/MessageEvent.as @@ -1,10 +1,10 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * A message event is used to dispatch a message to all subscribers of a * distributed object without actually changing any of the fields of the diff --git a/src/as/com/threerings/presents/dobj/NamedEvent.as b/src/as/com/threerings/presents/dobj/NamedEvent.as index aca8a9b42..fcd444894 100644 --- a/src/as/com/threerings/presents/dobj/NamedEvent.as +++ b/src/as/com/threerings/presents/dobj/NamedEvent.as @@ -1,6 +1,6 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as b/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as index 36f02728a..2d3c8a88d 100644 --- a/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as +++ b/src/as/com/threerings/presents/dobj/ObjectAddedEvent.as @@ -1,10 +1,10 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + /** * An object added event is dispatched when an object is added to an * OidList attribute of a distributed object. It can also be diff --git a/src/as/com/threerings/presents/dobj/ObjectDestroyedEvent.as b/src/as/com/threerings/presents/dobj/ObjectDestroyedEvent.as index bbc3b8825..1c5024bf5 100644 --- a/src/as/com/threerings/presents/dobj/ObjectDestroyedEvent.as +++ b/src/as/com/threerings/presents/dobj/ObjectDestroyedEvent.as @@ -21,7 +21,7 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; +import com.threerings.util.StringBuilder; /** * An object destroyed event is dispatched when an object has been removed diff --git a/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as b/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as index 3a20343b2..3767286e7 100644 --- a/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as +++ b/src/as/com/threerings/presents/dobj/ObjectRemovedEvent.as @@ -21,7 +21,7 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/presents/dobj/OidList.as b/src/as/com/threerings/presents/dobj/OidList.as index 0296d2336..e420547c3 100644 --- a/src/as/com/threerings/presents/dobj/OidList.as +++ b/src/as/com/threerings/presents/dobj/OidList.as @@ -1,12 +1,12 @@ package com.threerings.presents.dobj { -import flash.util.StringBuilder; - import com.threerings.io.Streamable; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.StringBuilder; + import com.threerings.presents.Log; /** diff --git a/src/as/com/threerings/presents/net/Credentials.as b/src/as/com/threerings/presents/net/Credentials.as index 6c705dc1e..3628051ef 100644 --- a/src/as/com/threerings/presents/net/Credentials.as +++ b/src/as/com/threerings/presents/net/Credentials.as @@ -1,8 +1,7 @@ package com.threerings.presents.net { -import flash.util.StringBuilder; - import com.threerings.util.Name; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/presents/net/PingRequest.as b/src/as/com/threerings/presents/net/PingRequest.as index 89f92b8bd..68c6fc3d6 100644 --- a/src/as/com/threerings/presents/net/PingRequest.as +++ b/src/as/com/threerings/presents/net/PingRequest.as @@ -1,5 +1,7 @@ package com.threerings.presents.net { +import flash.utils.getTimer; + import com.threerings.io.ObjectOutputStream; public class PingRequest extends UpstreamMessage @@ -22,7 +24,7 @@ public class PingRequest extends UpstreamMessage // documentation inherited public override function writeObject (out :ObjectOutputStream) :void { - _packStamp = flash.util.getTimer(); + _packStamp = getTimer(); super.writeObject(out); } diff --git a/src/as/com/threerings/presents/net/PongResponse.as b/src/as/com/threerings/presents/net/PongResponse.as index e72350b00..b96966174 100644 --- a/src/as/com/threerings/presents/net/PongResponse.as +++ b/src/as/com/threerings/presents/net/PongResponse.as @@ -1,5 +1,7 @@ package com.threerings.presents.net { +import flash.utils.getTimer; + import com.threerings.util.Long; import com.threerings.io.ObjectInputStream; @@ -30,7 +32,7 @@ public class PongResponse extends DownstreamMessage public override function readObject (ins :ObjectInputStream) :void { - _unpackStamp = flash.util.getTimer(); + _unpackStamp = getTimer(); super.readObject(ins); // TODO: Figure out how we're really going to cope with longs diff --git a/src/as/com/threerings/presents/net/UsernamePasswordCreds.as b/src/as/com/threerings/presents/net/UsernamePasswordCreds.as index e1a1b6768..5f707744a 100644 --- a/src/as/com/threerings/presents/net/UsernamePasswordCreds.as +++ b/src/as/com/threerings/presents/net/UsernamePasswordCreds.as @@ -21,9 +21,8 @@ package com.threerings.presents.net { -import flash.util.StringBuilder; - import com.threerings.util.Name; +import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/util/ClassUtil.as b/src/as/com/threerings/util/ClassUtil.as index 944135351..0e6f8bb0c 100644 --- a/src/as/com/threerings/util/ClassUtil.as +++ b/src/as/com/threerings/util/ClassUtil.as @@ -1,17 +1,19 @@ package com.threerings.util { -import flash.util.*; +import flash.utils.describeType; +import flash.utils.getQualifiedClassName; +import flash.utils.getDefinitionByName; public class ClassUtil { public static function getClassName (obj :Object) :String { - return flash.util.getQualifiedClassName(obj).replace("::", "."); + return getQualifiedClassName(obj).replace("::", "."); } public static function shortClassName (obj :Object) :String { - var s :String = flash.util.getQualifiedClassName(obj); + var s :String = getQualifiedClassName(obj); var dex :int = s.lastIndexOf("."); if (dex != -1) { s = s.substring(dex); @@ -21,13 +23,13 @@ public class ClassUtil public static function getClass (obj :Object) :Class { - return flash.util.getClassByName(getClassName(obj)); + return getClassByName(getClassName(obj)); } public static function getClassByName (cname :String) :Class { // see also ApplicationDomain.currentDomain.getClass(cname) - return flash.util.getClassByName(cname.replace("::", ".")); + return (getDefinitionByName(cname.replace("::", ".")) as Class); } public static function isFinal (type :Class) :Boolean @@ -37,7 +39,7 @@ public class ClassUtil } // TODO: there's currently no way to determine final from the class - //var attrs :XMLList = flash.util.describeType(type).elements("type"); + //var attrs :XMLList = flash.utils.describeType(type).elements("type"); return false; } @@ -62,8 +64,7 @@ public class ClassUtil } // ok, let's introspect on the class and see what we've got. - var typeInfo :XMLList = - flash.util.describeType(srcClass).child("factory"); + var typeInfo :XMLList = describeType(srcClass).child("factory"); // See which classes we extend. var exts :XMLList = typeInfo.child("extends").attribute("type"); diff --git a/src/as/com/threerings/util/MessageBundle.as b/src/as/com/threerings/util/MessageBundle.as index 1ad385e1e..36a8a4f1a 100644 --- a/src/as/com/threerings/util/MessageBundle.as +++ b/src/as/com/threerings/util/MessageBundle.as @@ -21,8 +21,6 @@ package com.threerings.util { -import flash.util.StringBuilder; - /** * A message bundle provides an easy mechanism by which to obtain * translated message strings from a resource bundle. It uses the {@link diff --git a/src/as/com/threerings/util/Util.as b/src/as/com/threerings/util/Util.as index e9d40e07d..48d8f1e7c 100644 --- a/src/as/com/threerings/util/Util.as +++ b/src/as/com/threerings/util/Util.as @@ -1,7 +1,8 @@ package com.threerings.util { -import flash.util.ByteArray; -import flash.util.StringBuilder; +import flash.utils.ByteArray; + +import com.threerings.util.StringBuilder; public class Util {