forked from as3/as3-utils
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcombine.as
More file actions
28 lines (25 loc) · 657 Bytes
/
combine.as
File metadata and controls
28 lines (25 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package utils.object
{
/**
* Combines all of the properties from two objects into a single objects. Note that
* duplicate properties will be overwritten by the values on the second parameter object.
*
* @param defaultVars
* @param additionalVars
* @return
*/
public function combine(defaultVars:Object, additionalVars:Object):Object
{
var combinedObject:Object = {};
var property:String;
for (property in defaultVars)
{
combinedObject[property] = defaultVars[property];
}
for (property in additionalVars)
{
combinedObject[property] = additionalVars[property];
}
return combinedObject;
}
}