Ask a Question related to Adobe Indesign Windows, Design and Development.
-
Discover@adobeforums.com #1
Dictionary
Do you know how to set Russian dictionary. It does not hyphenate words.
Thanks!
Discover@adobeforums.com Guest
-
Using C# Dictionary in Webpage
I am trying to use a stringDictionary on a web page that gets populated by clicking buttons on a page. Each time a button is clicked the... -
I can't get the dictionary to open
When I try to use my dictionary in contribute 4, by the way I am running a new mac My mac is running contribute 4 --so to get to the point The... -
Dictionary fo Indesign
Hi to all, have indesign 2.0.2 with win xp. I Have a text with different languages, even spanish, and i need to menage it but when i create a Style... -
Importing .txt into dictionary
In article <BB78F6B4.83F9%whaletx5@bigpond.net.au>, brad anderson <whaletx5@bigpond.net.au> wrote: I don't have that set up so I can't try and... -
Password Dictionary
I have been asked to install, or make available a password dictionary for AIX 4.3.3, and 5.2 Where can I find such a beast? Thanks -
Steve_Werner@adobeforums.com #2
Re: Dictionary
To work with Russian with a dictionary, spell-checking, etc. you need InDesign CE.
Go to [url]www.winsoft.fr[/url].
Steve_Werner@adobeforums.com Guest
-
007none #3
Dictionary
Hey is anybody knows about Dictionary class , what is use of this Dictionary in
Flex . Is anybody has any example on Dictionary , please do not reply me links
of adobe help nothing is there.....................
I have seen Flex store application but not clear .......... Please help me and
give some more specific and technical talk about Dictionary
007none Guest
-
Greg Lafrance #4
Re: Dictionary
This LiveDocs article gives info on using the Dictionary class:
[url]http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?co[/url]
ntext=LiveDocs_Book_Parts&file=10_Lists_of_data_16 6_3.html
-----------------------------------------------------------------------
Associative arrays with object keys
You can use the Dictionary class to create an associative array that uses
objects for keys rather than strings. Such arrays are sometimes called
dictionaries, hashes, or maps. For example, consider an application that
determines the location of a Sprite object based on its association with a
specific container. You can use a Dictionary object to map each Sprite object
to a container.
The following code creates three instances of the Sprite class that serve as
keys for the Dictionary object. Each key is assigned a value of either GroupA
or GroupB. The values can be of any data type, but in this example both GroupA
and GroupB are instances of the Object class. Subsequently, you can access the
value associated with each key with the property access ([]) operator, as shown
in the following code:
import flash.display.Sprite;
import flash.utils.Dictionary;
var groupMap:Dictionary = new Dictionary();
// objects to use as keys
var spr1:Sprite = new Sprite();
var spr2:Sprite = new Sprite();
var spr3:Sprite = new Sprite();
// objects to use as values
var groupA:Object = new Object();
var groupB:Object = new Object();
// Create new key-value pairs in dictionary.
groupMap[spr1] = groupA;
groupMap[spr2] = groupB;
groupMap[spr3] = groupB;
if (groupMap[spr1] == groupA)
{
trace("spr1 is in groupA");
}
if (groupMap[spr2] == groupB)
{
trace("spr2 is in groupB");
}
if (groupMap[spr3] == groupB)
{
trace("spr3 is in groupB");
}
Iterating with object keys
You can iterate through the contents of a Dictionary object with either a
for..in loop or a for each..in loop. A for..in loop allows you to iterate based
on the keys, whereas a for each..in loop allows you to iterate based on the
values associated with each key.
Use the for..in loop for direct access to the object keys of a Dictionary
object. You can also access the values of the Dictionary object with the
property access ([]) operator. The following code uses the previous example of
the groupMap dictionary to show how to iterate through a Dictionary object with
the for..in loop:
for (var key:Object in groupMap)
{
trace(key, groupMap[key]);
}
/* output:
[object Sprite] [object Object]
[object Sprite] [object Object]
[object Sprite] [object Object]
*/
Use the for each..in loop for direct access to the values of a Dictionary
object. The following code also uses the groupMap dictionary to show how to
iterate through a Dictionary object with the for each..in loop:
for each (var item:Object in groupMap)
{
trace(item);
}
/* output:
[object Object]
[object Object]
[object Object]
*/
Object keys and memory management
Flash Player uses a garbage collection system to recover memory that is no
longer used. When an object has no references pointing to it, the object
becomes eligible for garbage collection, and the memory is recovered the next
time the garbage collection system executes. For example, the following code
creates a new object and assigns a reference to the object to the variable
myObject:
var myObject:Object = new Object();
As long as any reference to the object exists, the garbage collection system
will not recover the memory that the object occupies. If the value of myObject
is changed such that it points to a different object or is set to the value
null, the memory occupied by the original object becomes eligible for garbage
collection, but only if there are no other references to the original object.
If you use myObject as a key in a Dictionary object, you are creating another
reference to the original object. For example, the following code creates two
references to an object--the myObject variable, and the key in the myMap object:
import flash.utils.Dictionary;
var myObject:Object = new Object();
var myMap:Dictionary = new Dictionary();
myMap[myObject] = "foo";
To make the object referenced by myObject eligible for garbage collection, you
must remove all references to it. In this case, you must change the value of
myObject and delete the myObject key from myMap, as shown in the following code:
myObject = null;
delete myMap[myObject];
Alternatively, you can use the useWeakReference parameter of the Dictionary
constructor to make all of the dictionary keys weak references. The garbage
collection system ignores weak references, which means that an object that has
only weak references is eligible for garbage collection. For example, in the
following code, you do not need to delete the myObject key from myMap in order
to make the object eligible for garbage collection:
import flash.utils.Dictionary;
var myObject:Object = new Object();
var myMap:Dictionary = new Dictionary(true);
myMap[myObject] = "foo";
myObject = null; // Make object eligible for garbage collection.
Greg Lafrance Guest
-
007none #5
Re: Dictionary
Thanks but
I have written that i do not need adobe help lecture on this . I need a live
implementation on the Dictionary Class . I need a example where and how do we
use this class .okay , If you have implemented in your code then you must reply
..................
007none Guest



Reply With Quote

