Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Adobe Flex SDK 3.0 (Release)
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows XP
Browser: Firefox 2.x
Language Found: English
Description
Steps to reproduce:
1. Download this Flex Project Archive and run it in debug mode (Code is below)
2. Notice the output of the trace( ObjectUtil.toString( _myAssociativeArray ) );
Actual Results:
The console output for the above trace statement shows:
(flash.utils::Dictionary)#0
(x=100, y=100) = (null)
(x=100, y=200) = (null)
Expected Results:
The console output should be showing something like:
(flash.utils::Dictionary)#0
(x=100, y=100) = "hello"
(x=100, y=200) = "world"
Workaround (if any):
Either trace out every key/value individually or examine the Dictionary in the variables or expressions view of Flex Builder. Notice the attached screenshot showing that Flex Builder expressions view is showing the Dictionary contents correctly.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="_onCreationComplete( event )">
<mx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
private var _point1:Point;
private var _point2:Point;
private var _myAssociativeArray:Dictionary;
private function _onCreationComplete( p_evt:Event ):void
{ // Instantiate our points _point1 = new Point( 100, 100 ); _point2 = new Point( 100, 200 ); // Instantiate the Dictionary (with weak keys) _myAssociativeArray = new Dictionary( true ); // Create a couple dynamic properties using object keys _myAssociativeArray[ _point1 ] = "hello"; _myAssociativeArray[ _point2 ] = "world"; // examine the object trace( ObjectUtil.toString( _myAssociativeArray ) ); // examine the properties trace( _myAssociativeArray[ _point1 ] ); trace( _myAssociativeArray[ _point2 ] ); } ]]
>
</mx:Script>
</mx:Application>