diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..53a93bf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.classpath
+.project
+.settings
+target
+.DS_Store
\ No newline at end of file
diff --git a/.metadata/.lock b/.metadata/.lock
new file mode 100644
index 0000000..e69de29
diff --git a/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf b/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf
new file mode 100644
index 0000000..25090bb
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf
new file mode 100644
index 0000000..73a07fa
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png
new file mode 100644
index 0000000..0a23649
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png
new file mode 100644
index 0000000..7e39ddd
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf
new file mode 100644
index 0000000..3180998
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf
new file mode 100644
index 0000000..e8f64ec
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache
new file mode 100644
index 0000000..e85a4df
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as
new file mode 100644
index 0000000..6b77c4f
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as
@@ -0,0 +1,9337 @@
+/****************************************************************************
+*
+* ADOBE CONFIDENTIAL
+* ___________________
+*
+* Copyright [2002] - [2006] Adobe Macromedia Software LLC and its licensors
+* All Rights Reserved.
+*
+* NOTICE: All information contained herein is, and remains the property
+* of Adobe Macromedia Software LLC and its licensors, if any.
+* The intellectual and technical concepts contained herein are proprietary
+* to Adobe Macromedia Software LLC and its licensors and may be covered by
+* U.S. and Foreign Patents, patents in process, and are protected by trade
+* secret or copyright law. Dissemination of this information or reproduction
+* of this material is strictly forbidden unless prior written permission is
+* obtained from Adobe Macromedia Software LLC and its licensors.
+****************************************************************************/
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// ArgumentError object
+//****************************************************************************
+/**
+ * The ArgumentError class represents an error that occurs when the arguments
+ * supplied in a function do not match the arguments defined for
+ * that function. Possible sources of this error include a function being called with
+ * the wrong number of arguments, an argument of the incorrect type, or an argument that is
+ * invalid.
+ *
+ * @tiptext An ArgumentError is thrown when the parameter values supplied during a
+ * function call do not match the parameters defined for that function.
+ *
+ * @includeExample examples\ArgumentErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+public dynamic class ArgumentError extends Error
+{
+ /**
+ * Creates an ArgumentError object.
+ * @param message A string associated with the error.
+ */
+ public native function ArgumentError(message:String = "");
+}
+
+}
+package {
+/**
+ * An arguments object is used to store and access a function's arguments.
+ * While inside the function's body it can be accessed with the local arguments
+ * variable.
+ *
+ * The arguments are stored as array elements, the first is accessed as
+ * arguments[0], the second as arguments[1], etc. The
+ * arguments.length property indicates the number of arguments passed to
+ * the function. Note that there may be a different number of arguments passed in than
+ * the function declares.
+ *
+ *
+ * ActionScript 3.0 has no arguments.caller property, which did exist in previous versions of
+ * ActionScript. To get a reference to the function
+ * that called the current function, you must pass a reference to that function as an
+ * argument. An example of this technique can be found in the example for arguments.callee.
+ *
+ *
ActionScript 3.0 supports a new ...(rest) statement that is recommended instead of the
+ * arguments class.
+ *
+ * @tiptext An arguments object is used to store and access a function's arguments.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ *
+ * @includeExample examples\ArgumentsExample.as -noswf
+ * @see statements.html#..._(rest)_parameter ...(rest) statement
+ * @see Function
+ */
+public class arguments {
+ /**
+ * A reference to the currently executing function.
+ *
+ * @includeExample examples\arguments.callee.1.as -noswf
+ * @tiptext A reference to the currently executing function.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ */
+ public var callee:Function;
+
+
+ /**
+ * The number of arguments passed to the function. This may be more or less
+ * than the function declares.
+ *
+ * @tiptext The number of parameters passed to the function.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ */
+ public var length:Number;
+}
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Array object
+//****************************************************************************
+
+/**
+ * The Array class lets you access and manipulate arrays. Array indices are zero-based, which means that the first element in the array is [0], the second element is [1], and so on. To create an Array object, you use the new Array() constructor . Array() can also be
+ * invoked as a function. And, you can use the array access ([]) operator to initialize an array or access the elements of an array.
+ *
You can store a wide variety of data types in an array element, including numbers, strings, objects, and even other arrays. You can create a multidimensional array by creating an indexed array and assigning to each of its elements a different indexed array. Such an array is considered multidimensional because it can be used to represent data in a table.
+ *
Arrays are sparse arrays meaning there may be an element at index 0 and another at index 5, but nothing in the index positions between those two elements. In such a case, the elements in positions 1 through 4 are undefined, which indicates the absence of an element, not necessarily the presence of an element with the value undefined.
+ *
+ *
Array assignment is by reference rather than by value. When you assign one array variable to another array variable, both refer to the same array:
+ *
+ * var oneArray:Array = new Array("a", "b", "c");
+ * var twoArray:Array = oneArray; // Both array variables refer to the same array.
+ * twoArray[0] = "z";
+ * trace(oneArray); // Output: z,b,c.
+ *
+ *
The Array class should not be used to create associative arrays, which are different data structures that contain named elements instead of numbered elements. You should use the Object class to create associative arrays (also called hashes). Although ActionScript permits you to create associative arrays using the Array class, you cannot use any of the Array class methods or properties.
+ *
You can subclass Array and override or add methods. However, you must specify the subclass as dynamic
+ * or you will lose the ability to store data in an array.
+ *
+ * @tiptext Lets you access and manipulate indexed arrays.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\ArrayExample.as -noswf
+ *
+ * @oldexample In the following example, my_array contains four months of the year:
+ *
+ * @helpid x208A1
+ * @refpath Objects/Core/Array
+ * @keyword Array, Array object, built-in class
+ *
+ * @see operators.html#array_access [] (array access)
+ * @see Object Object class
+ */
+public dynamic class Array
+{
+
+ /**
+ * Specifies case-insensitive sorting for the Array class sorting methods. You can use this constant
+ * for the options parameter in the sort() or sortOn() method.
+ *
The value of this constant is 1.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F6
+ */
+ public static const CASEINSENSITIVE:uint = 1;
+ /**
+ * Specifies descending sorting for the Array class sorting methods.
+ * You can use this constant for the options parameter in the sort()
+ * or sortOn() method.
+ *
The value of this constant is 2.
+ *
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F7
+ */
+ public static const DESCENDING:uint = 2;
+ /**
+ * Specifies numeric (instead of character-string) sorting for the Array class sorting methods.
+ * Including this constant in the options
+ * parameter causes the sort() and sortOn() methods
+ * to sort numbers as numeric values, not as strings of numeric characters.
+ * Without the NUMERIC constant, sorting treats each array element as a
+ * character string and produces the results in Unicode order.
+ *
+ *
For example, given the array of values [2005, 7, 35], if the NUMERIC
+ * constant is not included in the options parameter, the
+ * sorted array is [2005, 35, 7], but if the NUMERIC constant is included,
+ * the sorted array is [7, 35, 2005].
+ *
+ *
This constant applies only to numbers in the array; it does
+ * not apply to strings that contain numeric data such as ["23", "5"].
+ *
+ *
The value of this constant is 16.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F8
+ */
+ public static const NUMERIC:uint = 16;
+ /**
+ * Specifies that a sort returns an array that consists of array indices as a result of calling
+ * the sort() or sortOn() method. You can use this constant
+ * for the options parameter in the sort() or sortOn()
+ * method, so you have access to multiple views on the array elements while the original array is unmodified.
+ *
The value of this constant is 8.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F9
+ */
+ public static const RETURNINDEXEDARRAY:uint = 8;
+ /**
+ * Specifies the unique sorting requirement for the Array class sorting methods.
+ * You can use this constant for the options parameter in the sort() or sortOn()
+ * method. The unique sorting option terminates the sort if any two elements
+ * or fields being sorted have identical values.
+ *
The value of this constant is 4.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217FA
+ */
+ public static const UNIQUESORT:uint = 4;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * A non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1.
+ *
Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\Array.length.1.as -noswf
+ *
+ * @helpid x2089F
+ * @refpath Objects/Core/Array/Properties/length
+ * @keyword array.length, length
+ */
+ public native function get length():uint;
+ public native function set length(newLength:uint);
+
+
+ /**
+ * Lets you create an array of the specified length.
+ * If you don't specify any parameters, an array with a length of 0 is created.
+ * If you specify a length, an array is created with length number of elements.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param numElements An integer that specifies the number of elements in the array.
+ *
+ * @throws RangeError If the sole argument is a number that is not an integer greater than or equal to zero.
+ * @includeExample examples\Array.1.as -noswf
+ * @includeExample examples\Array.2.as -noswf
+ *
+ * @see operators.html#array_access [] array access
+ * @see #length Array.length
+ *
+ */
+ public native function Array(numElements:int = 0);
+
+ /**
+ * Lets you create an array containing the specified elements.
+ * The values specified can be of any type.
+ * The first element in an array always has an index or position of 0.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ * @param ...values A comma-separated list of one or more arbitrary values.
+ *
Note: If only a single numeric parameter is passed to the Array constructor,
+ * it is assumed to specify the array's length property.
+ * @throws RangeError If the sole argument is a number that is not an integer greater than or equal to zero.
+ * @includeExample examples\Array.3.as -noswf
+ * @see operators.html#array_access [] array access
+ * @see #length Array.length
+ */
+ public native function Array(...values);
+
+ /**
+ * Concatenates the elements specified in the parameters with the elements in an array and creates a new array. If the parameters specify an array, the elements of that array are concatenated.
+ *
+ * @tiptext Concatenates the elements specified in the parameters.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args A value of any data type (such as numbers, elements, or strings) to be concatenated in a new array. If you don't
+ * pass any values, the new array is a duplicate of the original array.
+ *
+ * @return An array that contains the elements from this array followed by elements from
+ * the parameters.
+ *
+ * @includeExample examples\Array.concat.1.as -noswf
+ *
+ * @helpid x2089D
+ * @refpath Objects/Core/Array/Methods/concat
+ * @keyword array.concat, concat, concatenate
+ */
+ public native function concat(...args):Array;
+
+ /**
+ * Executes a test function on each item in the array until an item is reached that returns false for the specified function. You use this method to find out if all items in an array meet a certain criterion; for example, they all have values less than some number).
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example, item < 20) or a more complex operation, and it can be invoked with three arguments: the value of
+ * an item, the index of an item, and the Array object as in (item, index, array).
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A Boolean value; true if all items in the array return true for the specified function, otherwise false.
+ *
+ * @includeExample examples\Array.every.as -noswf
+ * @see #some() Array.some()
+ */
+ public native function every(callback:Function, thisObject=null):Boolean;
+
+ /**
+ * Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function. If an item returns false, it is not included in the new array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example, item < 20) or a more complex operation and will be invoked with three arguments, including the
+ * value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A new array containing all items from the original array that returned true.
+ *
+ * @includeExample examples\Array.filter.as -noswf
+ * @see #map() Array.map()
+ */
+ public native function filter(callback:Function, thisObject=null):Array;
+
+ /**
+ * Executes a function on each item in the array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple command
+ * (for example, a trace() statement) or a more complex operation and it can be invoked with three arguments,
+ * including the value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ *
+ * @includeExample examples\Array.forEach.as -noswf
+ * @includeExample examples\Array.forEach.2.as -noswf
+ */
+ public native function forEach(callback:Function, thisObject=null):void;
+
+ /**
+ * Searches for an item in an array using strict equality (===) and returns the index
+ * position of the item.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param searchElement The item to find in the array.
+ *
+ * @param fromIndex The location in the array from which to start searching for the item.
+ * @return A zero-based index position of the item in the array. If the searchElement argument
+ * is not found the return value will be -1.
+ *
+ * @includeExample examples\Array.indexOf.as -noswf
+ * @see #lastIndexOf() Array.lastIndexOf()
+ * @see operators.html#strict_equality === (strict equality)
+ */
+ public native function indexOf(searchElement, fromIndex:int=0):int;
+
+ /**
+ * Converts the elements in an array to strings, inserts the specified separator between the
+ * elements, concatenates them, and returns the resulting string. A nested array is always
+ * separated by a comma (,), not by the separator passed to the join() method.
+ *
+ * @tiptext Converts the elements in an array to strings.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param sep A character or string that separates array elements in
+ * the returned string. If you omit this parameter, a comma is used as the default
+ * separator.
+ *
+ * @return A string consisting of the elements of an array
+ * converted to strings and separated by the specified parameter.
+ *
+ * @includeExample examples\Array.join.1.as -noswf
+ * @includeExample examples\Array.join.2.as -noswf
+ *
+ * @oldsee mx.String#split mx.String.split()
+ * @see String#split()
+ *
+ * @helpid x2089E
+ * @refpath Objects/Core/Array/Methods/join
+ * @keyword array.join, join
+ */
+ public native function join(sep=void 0):String;
+
+ /**
+ * Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===).
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param searchElement The item to find in the array.
+ *
+ * @param fromIndex The location in the array from which to start searching for the item. The default is the maximum
+ * value allowed for an index. If fromIndex is not specified, the search starts at the last item
+ * in the array.
+ * @return A zero-based index position of the item in the array. If the searchElement argument is
+ * not found the return value will be -1.
+ *
+ * @includeExample examples\Array.lastIndexOf.as -noswf
+ * @see #indexOf() Array.indexOf()
+ * @see operators.html#strict_equality === (strict equality)
+ */
+ public native function lastIndexOf(searchElement, fromIndex:int=0x7fffffff):int;
+
+ /**
+ * Executes a function on each item in an array, and constructs a new array of items corresponding to the results of the function on each item in the original array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple command (such as changing the case of an array of strings) or a more complex operation and will be invoked with three arguments,
+ * including the value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A new array containing the results of the function on each item in the original array.
+ *
+ * @includeExample examples\Array.map.as -noswf
+ * @see #filter() Array.filter()
+ */
+ public native function map(callback:Function, thisObject=null):Array
+
+ /**
+ * Removes the last element from an array and returns the value of that element.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The value of the last element (of any data type) in the specified array.
+ *
+ * @includeExample examples\Array.pop.1.as -noswf
+ *
+ * @see #push() Array.push()
+ * @see #shift() Array.shift()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A2
+ * @refpath Objects/Core/Array/Methods/pop
+ * @keyword array.pop, pop
+ */
+ public native function pop():Object;
+
+ /**
+ * Adds one or more elements to the end of an array and returns the new length of the array.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args One or more values to append to the array.
+ * @return An integer representing the length of the new array.
+ *
+ * @includeExample examples\Array.push.1.as -noswf
+ * @includeExample examples\Array.push.2.as -noswf
+ *
+ * @see #pop() Array.pop()
+ * @see #shift() Array.shift()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A3
+ * @refpath Objects/Core/Array/Methods/push
+ * @keyword array.push, push
+ */
+ public native function push( ...args):uint;
+
+ /**
+ * Reverses the array in place.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\Array.reverse.1.as -noswf
+ *
+ * @return The new array.
+ * @helpid x2099E
+ * @refpath Objects/Core/Array/Methods/reverse
+ * @keyword array.reverse, reverse
+ */
+ public native function reverse():Array;
+
+ /**
+ * Removes the first element from an array and returns that element. The remaining elements in the array are moved
+ * from their original position, i, to i-1.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The first element (of any data type) in an array.
+ *
+ * @includeExample examples\Array.shift.1.as -noswf
+ *
+ * @see #pop() Array.pop()
+ * @see #push() Array.push()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A4
+ * @refpath Objects/Core/Array/Methods/shift
+ * @keyword array.shift, shift
+ */
+ public native function shift():Object;
+
+ /**
+ * Returns a new array that consists of a range of elements from the original array, without modifying the original array. The returned array includes the startIndex element and all elements up to, but not including, the endIndex element.
+ *
If you don't pass any parameters, a duplicate of the original array is created.
+ *
+ * @tiptext Returns a new array that consists of a range of elements from the original array.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param startIndex A number specifying the index of the starting point
+ * for the slice. If start is a negative number, the starting
+ * point begins at the end of the array, where -1 is the last element.
+ *
+ * @param endIndex A number specifying the index of the ending point for
+ * the slice. If you omit this parameter, the slice includes all elements from the
+ * starting point to the end of the array. If end is a negative
+ * number, the ending point is specified from the end of the array, where -1 is the
+ * last element.
+ *
+ * @return An array that consists of a range of elements from the original array.
+ *
+ * @includeExample examples\Array.slice.1.as -noswf
+ * @includeExample examples\Array.slice.2.as -noswf
+ * @includeExample examples\Array.slice.3.as -noswf
+ *
+ * @helpid x208A5
+ * @refpath Objects/Core/Array/Methods/slice
+ * @keyword array.slice, slice
+ */
+ public native function slice(startIndex:int=0, endIndex:int=-1):Array;
+
+ /**
+ * Executes a test function on each item in the array until an item is reached that returns true for the specified function. Use this method to find out if any items in an array meet a certain criterion, such as having a value less than some number.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example
+ * item < 20) or a more complex operation and it is invoked with three arguments, including the
+ * value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A Boolean value; true if any items in the array return true for the specified function, otherwise false.
+ *
+ * @includeExample examples\Array.some.as -noswf
+ * @see #every() Array.every()
+ */
+ public native function some(callback:Function, thisObject=null):Boolean;
+
+
+ /**
+ * Sorts the elements in an array. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.)
+ *
By default, Array.sort() works in the following way:
+ *
+ *
Sorting is case-sensitive (Z precedes a).
+ *
Sorting is ascending (a precedes b).
+ *
The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.
+ *
All elements, whatever the data type, are sorted as if they were strings, so 100 precedes 99, because "1" is a lower string value than "9".
+ *
+ *
+ * To sort an array by using settings that deviate from the default settings,
+ * you can either use one of the sorting options described in the ...args parameter entry
+ * for the sortOptions argument or you can create your own custom function to do the sorting.
+ * If you create a custom function, you can use it by calling the sort() method, using the name
+ * of your custom function as the first argument (compareFunction)
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args The arguments specifying a comparison function and one or more values that determine the behavior of the sort.
+ *
This method uses the syntax and argument order Array.sort(compareFunction, sortOptions) with the arguments defined as:
+ *
compareFunction - A comparison function used to determine the sorting order of elements in an array. This argument is optional. A function should take two arguments to compare. Given the elements A and B, the result of compareFunction can have one of the following three values:
+ *
+ *
-1, if A should appear before B in the sorted sequence
+ *
0, if A equals B
+ *
1, if A should appear after B in the sorted sequence
+ *
+ *
+ *
sortOptions - One or more numbers or names of defined constants, separated by the |(bitwise OR) operator, that change the behavior of the sort from the default. This argument is optional. The following values are acceptable for sortOptions:
+ *
+ *
1 or Array.CASEINSENSITIVE
+ *
2 or Array.DESCENDING
+ *
4 or Array.UNIQUESORT
+ *
8 or Array.RETURNINDEXEDARRAY
+ *
16 or Array.NUMERIC
+ *
+ * For more information, see the Array.sortOn() method.
+ *
+ *
Note: The Array.sort() method is defined in the ECMAScript (ECMA-262) edition 3
+ * language specification, but the
+ * array sorting options introduced in Flash Player 7 are Flash-specific extensions to
+ * ECMA-262.
+ *
+ * @return The return value depends on whether you pass any arguments, as described in
+ * the following list:
+ *
+ *
If you specify a value of 4 or Array.UNIQUESORT for the sortOptions argument
+ * of the ...args parameter and two or more elements being sorted have identical sort fields,
+ * Flash returns a value of 0 and does not modify the array.
+ *
If you specify a value of 8 or Array.RETURNINDEXEDARRAY for
+ * the sortOptions argument of the ...args parameter, Flash returns a sorted numeric
+ * array of the indices that reflects the results of the sort and does not modify the array.
+ *
Otherwise, Flash returns nothing and modifies the array to reflect the sort order.
+ *
+ *
+ * @includeExample examples\Array.sort.1.as -noswf
+ * @includeExample examples\Array.sort.2.as -noswf
+ * @includeExample examples\Array.sort.3.as -noswf
+ * @includeExample examples\Array.sort.4.as -noswf
+ * @includeExample examples\Array.sort.5.as -noswf
+ *
+ * @see operators.html#bitwise_OR | (bitwise OR)
+ * @see #sortOn() Array.sortOn()
+ *
+ * @helpid x209AF
+ * @refpath
+ * @keyword array.sort, sort
+ */
+ public native function sort(...args):Array;
+
+ /**
+ * Sorts the elements in an array according to one or more fields in the array.
+ * The array should have the following characteristics:
+ *
+ *
The array is an indexed array, not an associative array.
+ *
Each element of the array holds an object with one or more properties.
+ *
All of the objects have at least one property in common, the values of which can be used
+ * to sort the array. Such a property is called a field.
+ *
+ *
If you pass multiple fieldName parameters, the first field represents the primary sort field, the second represents the next sort field, and so on. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.) If either of the elements being compared does not contain the field that is specified in the fieldName parameter, the field is assumed to be set to undefined, and the elements are placed consecutively in the sorted array in no particular order.
+ *
By default, Array.sortOn() works in the following way:
+ *
+ *
Sorting is case-sensitive (Z precedes a).
+ *
Sorting is ascending (a precedes b).
+ *
The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.
+ *
Numeric fields are sorted as if they were strings, so 100 precedes 99, because "1" is a lower string value than "9".
+ *
+ *
Flash Player 7 added the options parameter, which you can use to override the default sort behavior. To sort a simple array (for example, an array with only one field), or to specify a sort order that the options parameter doesn't support, use Array.sort().
+ *
To pass multiple flags, separate them with the bitwise OR (|) operator:
Flash Player 8 added the ability to specify a different sorting option for each field when you sort by more than one field. In Flash Player 8, the options parameter accepts an array of sort options such that each sort option corresponds to a sort field in the fieldName parameter. The following example sorts the primary sort field, a, using a descending sort; the secondary sort field, b, using a numeric sort; and the tertiary sort field, c, using a case-insensitive sort:
Note: The fieldName and options arrays must have the same number of elements; otherwise, the options array is ignored. Also, the Array.UNIQUESORT and Array.RETURNINDEXEDARRAY options can be used only as the first element in the array; otherwise, they are ignored.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param fieldName A string that identifies a field to be used as the sort value, or an
+ * array in which the first element represents the primary sort field, the second represents
+ * the secondary sort field, and so on.
+ *
+ * @param options One or more numbers or names of defined constants, separated by the bitwise OR (|) operator, that change the sorting behavior. The following values are acceptable for the options parameter:
+ *
Code hinting is enabled if you use the string form of the flag (for example, DESCENDING) rather than the numeric form (2).
+ *
+ *
+ * @return The return value depends on whether you pass any parameters:
+ *
+ *
If you specify a value of 4 or Array.UNIQUESORT for the options parameter, and two or more elements being sorted have identical sort fields, a value of 0 is returned and the array is not modified.
+ *
If you specify a value of 8 or Array.RETURNINDEXEDARRAY for the options parameter, an array is returned that reflects the results of the sort and the array is not modified.
+ *
Otherwise, nothing is returned and the array is modified to reflect the sort order.
+ *
+ *
+ * @includeExample examples\Array.sortOn.1.as -noswf
+ * @includeExample examples\Array.sortOn.2.as -noswf
+ * @includeExample examples\Array.sortOn.3.as -noswf
+ *
+ * @see operators.html#bitwise_OR | (bitwise OR)
+ * @see #sort() Array.sort()
+ *
+ * @helpid x2058F
+ * @refpath Objects/Core/Array/Methods/sortOn
+ * @keyword array.sortOn, sortOn
+ */
+ public native function sortOn(fieldName:Object, options:Object = null):Array; // 'key' is a String, or an Array of String. 'options' is optional.
+
+ /**
+ * Adds elements to and removes elements from an array. This method modifies the array without
+ * making a copy.
+ *
Note: To override this method in a subclass of Array, use ...args for the parameters.
+ * For example:
+ *
+ * public override function splice(...args) {
+ * // your statements here
+ * }
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param startIndex An integer that specifies the index of the element in the array where the insertion or
+ * deletion begins. You can specify a negative integer to specify a position relative to the end of the array
+ * (for example, -1 is the last element of the array).
+ * @param deleteCount An integer that specifies the number of elements to be deleted. This number includes the
+ * element specified in the startIndex parameter. If no value is specified for the
+ * deleteCount parameter, the method deletes all of the values from the startIndex
+ * element to the last element in the array. If the value is 0, no elements are deleted.
+ * @param values An optional list of one or more comma-separated values, or an array,
+ * to insert into the array at the insertion point specified in the startIndex parameter.
+ *
+ * @return An array containing the elements that were removed from the original array.
+ *
+ * @includeExample examples\Array.splice.1.as -noswf
+ *
+ * @helpid x208A6
+ * @refpath Objects/Core/Array/Methods/splice
+ * @keyword array.splice, splice
+ */
+ public native function splice(startIndex:int, deleteCount:uint, ... values):Array;
+
+ /**
+ * Returns a string value representing the elements in the specified Array object. Every element in the array, starting with index 0 and ending with the highest index, is converted to a concatenated string and separated by commas. To specify a custom separator, use the Array.join() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string.
+ *
+ * @includeExample examples\Array.toString.1.as -noswf
+ *
+ *
This example outputs 1,2,3,4,5 as a result of the trace statement.
+ *
This example writes 1,2,3,4,5 to the log file.
+ *
+ * @see String#split() String.split()
+ * @see #join() Array.join()
+ *
+ * @helpid x20A11
+ * @refpath Objects/Core/Array/Methods/toString
+ * @keyword array.toString, toString
+ */
+ public native function toString():String;
+
+ /**
+ * Returns a string value representing the elements in the specified array object. Every element in the array, starting with index 0 and ending with the highest index, is converted to a concatenated string and separated by commas. In the ActionScript 3.0 implementation, this method returns the same value as the Array.toString() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string.
+ * @see #toString() Array.toString()
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Adds one or more elements to the beginning of an array and returns the new length of the array. The other
+ * elements in the array are moved from their original position, i, to i+1.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args One or more numbers, elements, or variables to be inserted at the beginning of the array.
+ *
+ * @return An integer representing the new length of the array.
+ *
+ * @includeExample examples\Array.unshift.1.as -noswf
+ *
+ * @see Array#pop()
+ * @see Array#push()
+ * @see Array#shift()
+ * @helpid x208A7
+ * @refpath Objects/Core/Array/Methods/unshift
+ * @keyword array.unshift, unshift
+ */
+ public native function unshift( ...args):uint;
+
+ /**
+ * The default number of arguments for the constructor. You can specify 0, 1, or any number of arguments. For details, see the Array() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Array()
+ */
+ public static const length:int = 1;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Boolean object
+//****************************************************************************
+/**
+* A data type that can have one of two values, either true or false.
+* Used for logical operations. Use the Boolean
+* class to retrieve the primitive data type or string representation of a Boolean object.
+*
+*
It makes no difference whether you use the constructor, the global function, or simply assign
+* a literal value. The fact that all three ways of creating a Boolean are equivalent is new in ActionScript 3.0,
+* and different from a Boolean in JavaScript where a Boolean object is distinct from the Boolean primitive type.
+*
+*
The following lines of code are equivalent:
+*
+* var flag:Boolean = true;
+* var flag:Boolean = new Boolean(true);
+* var flag:Boolean = Boolean(true);
+*
+*
+ * @includeExample examples\BooleanExample.as -noswf
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid x208C1
+* @keyword boolean, built-in class
+* @refpath Objects/Core/Boolean/
+*/
+public final class Boolean
+{
+
+/**
+ * Creates a Boolean object with the specified value. If you omit the expression
+ * parameter, the Boolean object is initialized with a value of false. If you
+ * specify a value for the expression parameter, the method evaluates it and returns the result
+ * as a Boolean value according to the rules in the global Boolean() function.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param expression Any expression.
+ *
+ * @return A reference to a Boolean object.
+ *
+ * @example The following code creates a new Boolean object, initialized to a value of false called myBoolean:
+ *
+ * var myBoolean:Boolean = new Boolean();
+ *
+ *
+ * @see package.html#Boolean() Boolean()
+ * @helpid x208C0
+ * @refpath Objects/Core/Boolean/new Boolean
+ * @keyword new boolean, constructor
+ */
+ public native function Boolean(expression:Object = false);
+
+
+ /**
+ * The default number of arguments for the constructor. For details, see the Boolean() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Boolean()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Returns the string representation ("true" or
+ * "false") of the Boolean object. The output is not localized, and will be "true" or
+ * "false" regardless of the system language.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string; "true" or "false".
+ *
+ * @example This example creates a variable of type Boolean and then uses the toString() method
+ * to convert the value to a string for use in an array of strings:
+ *
+ * var myStringArray:Array = new Array("yes", "could be");
+ * var myBool:Boolean = 0;
+ * myBool.toString();
+ * myStringArray.push(myBool);
+ *
+ *
+ *
+ * @helpid x208C2
+ * @refpath Objects/Core/Boolean/Methods/toString
+ * @keyword boolean.toString, toString
+ */
+ public native function toString():String;
+
+ /**
+ * Returns true if the value of the specified Boolean
+ * object is true; false otherwise.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A Boolean value.
+ *
+ * @example The following example shows how this method works, and also shows that the
+ * value of a new Boolean object is false:
+ *
+ * var myBool:Boolean = new Boolean();
+ * trace(myBool.valueOf()); // false
+ * myBool = (6==3+3);
+ * trace(myBool.valueOf()); // true
+ *
+ *
+ *
+ * @helpid x208C3
+ * @refpath Objects/Core/Boolean/Methods/valueOf
+ * @keyword boolean.valueOf, valueOf
+ */
+ public native function valueOf():Boolean;
+}
+}
+
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Class object
+//****************************************************************************
+/**
+ * A class object is created for each class definition in a program. Every class object is an instance
+ * of the Class class. The class object contains the static properties and methods of the class. The
+ * class object creates instances of the class when invoked using the new operator.
+ *
+ *
Some methods return an object of type Class, such as flash.net.getClassByAlias().
+ * Other methods may have a parameter of type Class, such as flash.net.registerClassAlias().
+ *
The Class name is the reference to the class object.
+ *
For example:
+ *
+ * class Foo {
+ * }
+ *
+ *
class Foo{} is the class definition that creates a class object Foo. Additionally, the statement
+ * new Foo() will create a new instance of class Foo, and the result will be of type Foo.
+ *
Use the class statement to declare your classes. Class objects are useful for advanced
+ * techniques, such as the runtime assignment of classes to an existing instance object, as shown in the "Class Examples"
+ * section below.
+ *
Any static properties and methods of a class live on the class's Class object. Class, itself, declares
+ * prototype.
+ *
+ *
Generally, you do not need to declare or create variables of type Class manually. However, in the following
+ * code, a class is assigned as a public Class property circleClass, and you can refer to this Class property
+ * as a property of the main Library class:
+ *
+ * package {
+ * import flash.display.Sprite;
+ * public class Library extends Sprite {
+ *
+ * public var circleClass:Class = Circle;
+ * public function Library() {
+ * }
+ * }
+ * }
+ *
+ * import flash.display.Shape;
+ * class Circle extends Shape {
+ * public function Circle(color:uint = 0xFFCC00, radius:Number = 10) {
+ * graphics.beginFill(color);
+ * graphics.drawCircle(radius, radius, radius);
+ * }
+ * }
+ *
+ *
+ *
Another SWF file can load the resulting Library.swf file and then instantiate objects of type Circle. The
+ * following is one way, not the only way, to get access to a child SWF file's assets (other techniques include using
+ * flash.utils.getDefnitionByName() or importing stub definitions of the child SWF file):
+ *
+ *
+ * package {
+ * import flash.display.Sprite;
+ * import flash.display.Shape;
+ * import flash.display.Loader;
+ * import flash.net.URLRequest;
+ * import flash.events.Event;
+ * public class LibaryLoader extends Sprite {
+ * public function LibaryLoader() {
+ * var ldr:Loader = new Loader();
+ * var urlReq:URLRequest = new URLRequest("Library.swf");
+ * ldr.load(urlReq);
+ * ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
+ * }
+ * private function loaded(event:Event):void {
+ * var library:Object = event.target.content;
+ * var circle:Shape = new library.circleClass();
+ * addChild(circle);
+ * }
+ * }
+ * }
+ *
+ *
In ActionScript 3.0, you can create embedded classes for external assets (such as images, sounds, or fonts) that are
+ * compiled into SWF files. In earlier versions of ActionScript, you associated those assets using a linkage ID with the
+ * MovieClip.attachMovie() method. In ActionScript 3.0, each embedded asset is represented by a unique embedded
+ * asset class. So, you can use the new operator to instantiate the asset's associated class and call methods and properties
+ * on that asset.
+ *
For example, if you are using an MXML compiler to generate SWF files, you would create an embedded
+ * class as follows:
+ *
+ * [Embed(source="bratwurst.jpg")]
+ * public var imgClass:Class;
+ *
+ *
And, to instantiate it, you write the following:
+ *
+ * var myImg:Bitmap = new imgClass();
+ *
+ *
+ *
+ * @includeExample examples\Class.1.as -noswf
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Class
+ * @see Object#prototype
+ * @see operators.html#new new operator
+ */
+public dynamic class Class
+{
+}
+}
+
+package {
+// Top Level Constants
+
+/**
+ * A special value representing positive Infinity. The value of this constant is the same as Number.POSITIVE_Infinity.
+ * @includeExample examples\Constants.Infinity.1.as -noswf
+ * @see Number#POSITIVE_Infinity
+ */
+public const Infinity:Number;
+
+
+/**
+ * A special value representing negative Infinity. The value of this constant is the same as Number.NEGATIVE_Infinity.
+ * @includeExample examples\Constants.NegInfinity.1.as -noswf
+ * @see Number#NEGATIVE_Infinity
+ */
+public const Infinity:Number;
+
+/**
+ * A special member of the Number data type that represents a value that is "not a number" (NaN).
+ * When a mathematical expression results in a value that cannot be expressed as a number, the result is NaN.
+ * The following list describes common expressions that result in NaN.
+ *
+ *
Division by 0 results in NaN only if the divisor is also 0. If the divisor is greater than 0, division by 0 results in Infinity. If the divisor is less than 0, division by 0 results in -Infinity;
+ *
Square root of a negative number;
+ *
The arcsine of a number outside the valid range of 0 to 1;
+ *
Infinity subtracted from Infinity;
+ *
Infinity or -Infinity divided by Infinity or -Infinity;
+ *
Infinity or -Infinity multiplied by 0;
+ *
+ *
The NaN value is not a member of the int or uint data types.
+ *
The NaN value is not considered equal to any other value, including NaN, which makes it impossible to use the equality operator to test whether an expression is NaN. To determine whether a number is the NaN function, use isNaN().
+ *
+ * @see global#isNaN()
+ * @see Number#NaN
+ */
+public const NaN:Number;
+
+
+/**
+ * A special value that applies to untyped variables that have not been initialized or dynamic object properties that are not initialized.
+ * In ActionScript 3.0, only variables that are untyped can hold the value undefined,
+ * which is not true in ActionScript 1.0 and ActionScript 2.0.
+ * For example, both of the following variables are undefined because they are untyped and unitialized:
+ *
+ *
var foo;
+ *
var bar:~~;
+ *
+ *
The undefined value also applies to uninitialized or undefined properties of dynamic objects.
+ * For example, if an object is an instance of the Object class,
+ * the value of any dynamically added property is undefined until a value is assigned to that property.
+ *
+ *
Results vary when undefined is used with various functions:
+ *
+ *
The value returned by String(undefined) is "undefined" (undefined is
+ * converted to a string).
+ *
The value returned by Number(undefined) is NaN.
+ *
The value returned by int(undefined) and uint(undefined) is 0.
+ *
The value returned by Object(undefined) is a new Object instance.
+ *
When the value undefined is assigned to a typed variable,
+ * the value is converted to the default value of the data type.
+ *
+ *
Do not confuse undefined with null.
+ * When null and undefined are compared with the equality
+ * (==) operator, they compare as equal. However, when null and undefined are
+ * compared with the strict equality (===) operator, they compare
+ * as not equal.
+ * @includeExample examples\Constants.undefined.1.as -noswf
+ * @includeExample examples\Constants.undefined.2.as -noswf
+ * @see global#null
+ */
+public const undefined;
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Date object
+//****************************************************************************
+
+
+/**
+ * The Date class represents date and time information. An instance of the Date class represents a particular point in time for which the properties such as month, day, hours and seconds can be queried or modified. The Date class lets you retrieve date and time values relative to universal time (Greenwich mean time, now called universal time or UTC) or relative to local time, which is determined by the local time zone setting on the operating system running Flash Player. The methods of the Date class are not static but apply only to the individual Date object specified when the method is called. The Date.UTC() and Date.parse() methods are exceptions; they are static methods.
+ *
The Date class handles daylight saving time differently, depending on the operating system and Flash Player version. Flash Player 6 and later versions handle daylight saving time on the following operating systems in these ways:
+ *
Windows - the Date object automatically adjusts its output for daylight saving time. The Date object detects whether daylight saving time is employed in the current locale, and if so, it detects the standard-to-daylight saving time transition date and times. However, the transition dates currently in effect are applied to dates in the past and the future, so the daylight saving time bias might calculate incorrectly for dates in the past when the locale had different transition dates.
+ *
Mac OS X - the Date object automatically adjusts its output for daylight saving time. The time zone information database in Mac OS X is used to determine whether any date or time in the present or past should have a daylight saving time bias applied.
+ *
Mac OS 9 - the operating system provides only enough information to determine whether the current date and time should have a daylight saving time bias applied. Accordingly, the date object assumes that the current daylight saving time bias applies to all dates and times in the past or future.
+ *
Flash Player 5 handles daylight saving time on the following operating systems as follows:
+ *
Windows - the U.S. rules for daylight saving time are always applied, which leads to incorrect transitions in Europe and other areas that employ daylight saving time but have different transition times than the U.S. Flash correctly detects whether daylight saving time is used in the current locale.
+ *
To use the Date class, construct a Date instance using the new operator.
+ *
ActionScript 3.0 adds several new accessor properties that can be used in place of many Date class methods that access or modify Date instances. ActionScript 3.0 also includes several new variations of the toString() method that are included for ECMA-262 3rd Edition compliance, including: Date.toLocaleString(), Date.toTimeString(), Date.toLocaleTimeString(), Date.toDateString(), Date.toLocaleDateString().
+ *
To compute relative time or time elapsed, see the getTimer() method in the flash.utils package.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\DateExample.as -noswf
+ * @see flash.utils#getTimer() flash.utils.getTimer()
+ *
+ * @helpid x208E9
+ * @refpath Objects/Core/Date
+ * @keyword Date object, built-in class, date
+ */
+public final dynamic class Date
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 0, 1, or any number of arguments
+ * up to a maximum of 7. For details, see the Date() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Date()
+ */
+ public static const length:int = 7;
+
+ /**
+ * The full year (a four-digit number, such as 2000) of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getFullYear()
+ * @see #setFullYear()
+ */
+ public function get fullYear():Number { return getFullYear(); }
+ public function set fullYear(value:Number):void { setFullYear(value); }
+
+ /**
+ * The month (0 for January, 1 for February, and so on) portion of a
+ * Date object according to local time. Local time is determined by the operating system
+ * on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMonth()
+ * @see #setMonth()
+ */
+ public function get month():Number { return getMonth(); }
+ public function set month(value:Number):void { setMonth(value); }
+
+ /**
+ * The day of the month (an integer from 1 to 31) specified by a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getDate()
+ * @see #setDate()
+ */
+ public function get date():Number { return getDate(); }
+ public function set date(value:Number):void { setDate(value); }
+
+ /**
+ * The hour (an integer from 0 to 23) of the day portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getHours()
+ * @see #setHours()
+ */
+ public function get hours():Number { return getHours(); }
+ public function set hours(value:Number):void { setHours(value); }
+
+ /**
+ * The minutes (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMinutes()
+ * @see #setMinutes()
+ */
+ public function get minutes():Number { return getMinutes(); }
+ public function set minutes(value:Number):void { setMinutes(value); }
+
+ /**
+ * The seconds (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getSeconds()
+ * @see #setSeconds()
+ */
+ public function get seconds():Number { return getSeconds(); }
+ public function set seconds(value:Number):void { setSeconds(value); }
+
+ /**
+ * The milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMilliseconds()
+ * @see #setMilliseconds()
+ */
+ public function get milliseconds():Number { return getMilliseconds(); }
+ public function set milliseconds(value:Number):void { setMilliseconds(value); }
+
+ /**
+ * The four-digit year of a Date object according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCFullYear()
+ * @see #setUTCFullYear()
+ */
+ public function get fullYearUTC():Number { return getUTCFullYear(); }
+ public function set fullYearUTC(value:Number):void { setUTCFullYear(value); }
+
+ /**
+ * The month (0 [January] to 11 [December]) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMonth()
+ * @see #setUTCMonth()
+ */
+ public function get monthUTC():Number { return getUTCMonth(); }
+ public function set monthUTC(value:Number):void { setUTCMonth(value); }
+
+ /**
+ * The day of the month (an integer from 1 to 31) of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCDate()
+ * @see #setUTCDate()
+ */
+ public function get dateUTC():Number { return getUTCDate(); }
+ public function set dateUTC(value:Number):void { setUTCDate(value); }
+
+ /**
+ * The hour (an integer from 0 to 23) of the day of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCHours()
+ * @see #setUTCHours()
+ */
+ public function get hoursUTC():Number { return getUTCHours(); }
+ public function set hoursUTC(value:Number):void { setUTCHours(value); }
+
+ /**
+ * The minutes (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMinutes()
+ * @see #setUTCMinutes()
+ */
+ public function get minutesUTC():Number { return getUTCMinutes(); }
+ public function set minutesUTC(value:Number):void { setUTCMinutes(value); }
+
+ /**
+ * The seconds (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCSeconds()
+ * @see #setUTCSeconds()
+ */
+ public function get secondsUTC():Number { return getUTCSeconds(); }
+ public function set secondsUTC(value:Number):void { setUTCSeconds(value); }
+
+ /**
+ * The milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMilliseconds()
+ * @see #setUTCMilliseconds()
+ */
+ public function get millisecondsUTC():Number { return getUTCMilliseconds(); }
+ public function set millisecondsUTC(value:Number):void { setUTCMilliseconds(value); }
+
+ /**
+ * The number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object. Use this method to represent a specific instant in time
+ * when comparing two or more Date objects.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getTime()
+ * @see #setTime()
+ */
+ public function get time():Number { return getTime(); }
+ public function set time(value:Number):void { setTime(value); }
+
+ /**
+ * The difference, in minutes, between the computer's local time and universal
+ * time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getTimezoneOffset()
+ */
+ public function get timezoneOffset():Number { return getTimezoneOffset(); }
+
+ /**
+ * The day of the week (0 for Sunday, 1 for Monday, and so on) specified by this
+ * Date according to local time. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getDay()
+ */
+ public function get day():Number { return getDay(); }
+
+ /**
+ * The day of the week (0 for Sunday, 1 for Monday, and so on) of this Date
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCDay()
+ */
+ public function get dayUTC():Number { return getUTCDay(); }
+
+ /**
+ * Returns the number of milliseconds between midnight on January 1, 1970, universal time,
+ * and the time specified in the parameters. This method uses universal time, whereas the
+ * Date constructor uses local time.
+ *
This method is useful if you want to pass a UTC date to the Date class constructor.
+ * Because the Date class constructor accepts the millisecond offset as an argument, you
+ * can use the Date.UTC() method to convert your UTC date into the corresponding millisecond
+ * offset, and send that offset as an argument to the Date class constructor:
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A four-digit integer that represents the year (for example, 2000).
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param date An integer from 1 to 31.
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The number of milliseconds since January 1, 1970 and the specified date and time.
+ *
+ * @includeExample examples\Date.UTC.1.as -noswf
+ *
+ * @helpid x2090F
+ * @refpath Objects/Core/Date/Methods/UTC
+ * @keyword date.utc, utc, date
+ */
+ public native static function UTC(year:Number,month:Number,date:Number = 1,
+ hour:Number = 0,minute:Number = 0,second:Number = 0,millisecond:Number = 0):Number;
+
+ /**
+ * Constructs a new Date object that holds the specified date and time.
+ *
+ *
The Date() constructor takes up to seven parameters (year, month,
+ * ..., millisecond) to specify a date and time to the millisecond. The date that
+ * the newly constructed Date object contains depends on the number, and data type, of arguments passed.
+ *
+ *
If you pass no arguments, the Date object is assigned the current date and time.
+ *
If you pass one argument of data type Number, the Date object is assigned a time value based on the number of milliseconds since January 1, 1970 0:00:000 GMT, as specified by the lone argument.
+ *
If you pass one argument of data type String, and the string contains a valid date, the Date object contains a time value based on that date.
+ *
If you pass two or more arguments, the Date object is assigned a time value based on the argument values passed, which represent the date's year, month, date, hour, minute, second and milliseconds.
+ *
+ *
If you pass a string to the Date class constructor, the date can be in a variety of formats, but must at least include the month, date and year. For example, Feb 1 2005 is valid, but Feb 2005 is not. The following list indicates some of the valid formats:
+ *
+ *
Day Month Date Hours:Minutes:Seconds GMT Year (for instance, "Tue Feb 1 00:00:00 GMT-0800 2005", which matches toString())
+ *
Day Month Date Year Hours:Minutes:Seconds AM/PM (for instance, "Tue Feb 1 2005 12:00:00 AM", which matches toLocaleString())
+ *
Day Month Date Year (for instance, "Tue Feb 1 2005", which matches toDateString())
+ *
Month/Day/Year (for instance, "02/01/2005")
+ *
Month/Year (for instance, "02/2005")
+ *
+ * @param yearOrTimevalue If other parameters are specified, this number represents a
+ * year (such as 1965); otherwise, it represents a time value. If the number represents a year, a
+ * value of 0 to 99 indicates 1900 through 1999; otherwise all four digits of the year must be
+ * specified. If the number represents a time value (no other parameters are specified), it is the
+ * number of milliseconds before or after 0:00:00 GMT January 1, 1970; a negative values represents
+ * a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param date An integer from 1 to 31.
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999 of milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMonth()
+ * @see #getDate()
+ * @see #getFullYear()
+ * @helpid x208FD
+ * @refpath Objects/Core/Date/new Date
+ * @keyword new Date, constructor, date
+ */
+ public native function Date(yearOrTimevalue:Object,month:Number,date:Number = 1,hour:Number = 0,minute:Number = 0,second:Number = 0,millisecond:Number = 0);
+
+
+ /**
+ * Returns the day of the month (an integer from 1 to 31) specified by a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The day of the month (1 - 31) a Date object represents.
+ *
+ * @includeExample examples\Date.getDate.1.as -noswf
+ *
+ * @see #getMonth()
+ * @see #getFullYear()
+ * @helpid x208EA
+ * @refpath Objects/Core/Date/Methods/getDate
+ * @keyword date.getdate, getdate, date
+ */
+ public native function getDate():Number;
+
+ /**
+ * Returns the day of the week (0 for Sunday, 1 for Monday, and so on) specified by this
+ * Date according to local time. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A numeric version of the day of the week (0 - 6) a Date object
+ * represents.
+ *
+ * @includeExample examples\Date.getDay.1.as -noswf
+ *
+ * @helpid x208EB
+ * @refpath Objects/Core/Date/Methods/getDay
+ * @keyword date.getday, getday, date
+ */
+ public native function getDay():Number;
+
+ /**
+ * Returns the full year (a four-digit number, such as 2000) of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The full year a Date object represents.
+ *
+ * @includeExample examples\Date.getFullYear.1.as -noswf
+ *
+ * @helpid x208EC
+ * @refpath Objects/Core/Date/Methods/getFullYear
+ * @keyword date.getfullyear, getfullyear, date
+ */
+ public native function getFullYear():Number;
+
+ /**
+ * Returns the hour (an integer from 0 to 23) of the day portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The hour (0 - 23) of the day a Date object represents.
+ *
+ * @includeExample examples\Date.getHours.1.as -noswf
+ *
+ * @helpid x208ED
+ * @refpath Objects/Core/Date/Methods/getHours
+ * @keyword date.gethours, gethours, date
+ */
+ public native function getHours():Number;
+
+ /**
+ * Returns the milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The milliseconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getMilliseconds.1.as -noswf
+ *
+ * @helpid x208EE
+ * @refpath Objects/Core/Date/Methods/getMilliseconds
+ * @keyword date.getmilliseconds, getmilliseconds, date
+ */
+ public native function getMilliseconds():Number;
+
+ /**
+ * Returns the minutes (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The minutes portion of a Date object.
+ *
+ * @includeExample examples\Date.getMinutes.1.as -noswf
+ *
+ * @helpid x208EF
+ * @refpath Objects/Core/Date/Methods/getMinutes
+ * @keyword date.getminutes, getminutes, date
+ */
+ public native function getMinutes():Number;
+
+ /**
+ * Returns the month (0 for January, 1 for February, and so on) portion of this
+ * Date according to local time. Local time is determined by the operating system
+ * on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The month (0 - 11) portion of a Date object.
+ *
+ * @includeExample examples\Date.getMonth.1.as -noswf
+ *
+ * @helpid x208F0
+ * @refpath Objects/Core/Date/Methods/getMonth
+ * @keyword date.getmonth, getmonth, date
+ */
+ public native function getMonth():Number;
+
+ /**
+ * Returns the seconds (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The seconds (0 to 59) portion of a Date object.
+ *
+ * @includeExample examples\Date.getSeconds.1.as -noswf
+ *
+ * @helpid x208F1
+ * @refpath Objects/Core/Date/Methods/getSeconds
+ * @keyword date.getseconds, getseconds, date
+ */
+ public native function getSeconds():Number;
+
+ /**
+ * Returns the number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object. Use this method to represent a specific instant in time
+ * when comparing two or more Date objects.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The number of milliseconds since Jan 1, 1970 that a Date object represents.
+ *
+ * @includeExample examples\Date.getTime.1.as -noswf
+ * @includeExample examples\Date.getTime.2.as -noswf
+ *
+ * @helpid x208F2
+ * @refpath Objects/Core/Date/Methods/getTime
+ * @keyword date.gettime, gettime, date
+ */
+ public native function getTime():Number;
+
+ /**
+ * Returns the difference, in minutes, between the computer's local time and universal
+ * time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return Difference, in minutes, of local time and universal time (UTC).
+ *
+ * @includeExample examples\Date.getTimezoneOffset.1.as -noswf
+ *
+ * @helpid x208F3
+ * @refpath Objects/Core/Date/Methods/getTimezoneOffset
+ * @keyword date.gettimezoneoffset, gettimezoneoffset, date
+ */
+ public native function getTimezoneOffset():Number;
+
+ /**
+ * Returns the day of the month (an integer from 1 to 31) of a Date object,
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC day of the month (1 to 31) that a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCDate.1.as -noswf
+ *
+ * @see #getDate()
+ * @helpid x208F4
+ * @refpath Objects/Core/Date/Methods/getUTCDate
+ * @keyword date.getutcdate, getutcdate, date
+ */
+ public native function getUTCDate():Number;
+
+ /**
+ * Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of this Date
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC day of the week (0 to 6) that a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCDay.1.as -noswf
+ *
+ * @see #getDay()
+ * @helpid x208F5
+ * @refpath Objects/Core/Date/Methods/getUTCDay
+ * @keyword date.getutcday, getutcday, date
+ */
+ public native function getUTCDay():Number;
+
+ /**
+ * Returns the four-digit year of a Date object according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC four-digit year a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCFullYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208F6
+ * @refpath Objects/Core/Date/Methods/getUTCFullYear
+ * @keyword date.getutcfullyear, getutcfullyear, date
+ */
+ public native function getUTCFullYear():Number;
+
+ /**
+ * Returns the hour (an integer from 0 to 23) of the day of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC hour of the day (0 to 23) a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCHours.1.as -noswf
+ *
+ * @see #getHours()
+ * @helpid x208F7
+ * @refpath Objects/Core/Date/Methods/getUTCHours
+ * @keyword date.getutchours, getutchours, date
+ */
+ public native function getUTCHours():Number;
+
+ /**
+ * Returns the milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC milliseconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMilliseconds.1.as -noswf
+ *
+ * @helpid x208F8
+ * @refpath Objects/Core/Date/Methods/getUTCMilliseconds
+ * @keyword date.getutcmilliseconds, getutcmilliseconds, date
+ */
+ public native function getUTCMilliseconds():Number;
+
+ /**
+ * Returns the minutes (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC minutes portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMinutes.1.as -noswf
+ *
+ * @helpid x208F9
+ * @refpath Objects/Core/Date/Methods/getUTCMinutes
+ * @keyword date.getutcminutes, getutcminutes, date
+ */
+ public native function getUTCMinutes():Number;
+
+ /**
+ * Returns the month (0 [January] to 11 [December]) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC month portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMonth.1.as -noswf
+ *
+ * @see #getMonth()
+ * @helpid x208FA
+ * @refpath Objects/Core/Date/Methods/getUTCMonth
+ * @keyword date.getutcmonth, getutcmonth, date
+ */
+ public native function getUTCMonth():Number;
+
+ /**
+ * Returns the seconds (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC seconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCSeconds.1.as -noswf
+ *
+ * @helpid x208FB
+ * @refpath Objects/Core/Date/Methods/getUTCSeconds
+ * @keyword date.getutcseconds, getutcseconds, date
+ */
+
+ public native function getUTCSeconds():Number;
+
+ /**
+ * Returns the year of a Date object according to universal time (UTC). The year
+ * is the full year minus 1900. For example, the year 2000 is represented as 100.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC year a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208F6
+ * @refpath Objects/Core/Date/Methods/getUTCFullYear
+ * @keyword date.getutcfullyear, getutcfullyear, date
+ */
+ public native function getUTCYear():Number;
+
+ /**
+ * Returns the year of a Date object according to local time. Local time is
+ * determined by the operating system on which Flash Player is running. The year is the
+ * full year minus 1900. For example, the year 2000 is represented as 100.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return An integer.
+ *
+ * @includeExample examples\Date.getYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208FC
+ * @refpath Objects/Core/Date/Methods/getYear
+ * @keyword date.getyear, getyear, date
+ */
+ public native function getYear():Number;
+
+ /**
+ * Converts a string representing a date into a number equaling the number of milliseconds
+ * elapsed since January 1, 1970, UTC.
+ *
+ * @param date A string representation of a date, which conforms to the format for the output of
+ * Date.toString(). The date format for the output of Date.toString() is:
+ *
+ * Day Mon Date HH:MM:SS TZD YYYY
+ *
+ *
For example:
+ *
+ * Wed Apr 12 15:30:17 GMT-0700 2006
+ *
+ *
Other supported formats include (and you can include partial representations of these, meaning
+ * just the month, day, and year):
+ *
+ * @return A number representing the milliseconds elapsed since January 1, 1970, UTC.
+ *
+ * @includeExample examples\Date.parse.1.as -noswf
+ * @see #toString() Date.toString()
+ */
+ public native static function parse(date:String):Number;
+
+ /**
+ * Sets the day of the month, according to local time, and returns the new time in
+ * milliseconds. Local time is determined by the operating system on which Flash Player
+ * is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setDate.1.as -noswf
+ *
+ * @helpid x208FE
+ * @refpath Objects/Core/Date/Methods/setDate
+ * @keyword date.setdate, setdate, date
+ */
+ public native function setDate(day:Number):Number;
+
+ /**
+ * Sets the year, according to local time, and returns the new time in milliseconds. If
+ * the month and day parameters are specified,
+ * they are set to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * Calling this method does not modify the other fields of the Date but
+ * Date.getUTCDay() and Date.getDay() can report a new value
+ * if the day of the week changes as a result of calling this method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A four-digit number specifying a year. Two-digit numbers do not represent
+ * four-digit years; for example, 99 is not the year 1999, but the year 99.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day A number from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setFullYear.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x208FF
+ * @refpath Objects/Core/Date/Methods/setFullYear
+ * @keyword date.setfullyear, setfullyear, date
+ */
+ public native function setFullYear(year:Number, month:Number, day:Number):Number;
+
+ /**
+ * Sets the hour, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ * @param minute An integer from 0 to 59.
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setHours.1.as -noswf
+ *
+ * @helpid x20900
+ * @refpath Objects/Core/Date/Methods/setHours
+ * @keyword date.sethours, sethours, date
+ */
+ public native function setHours(hour:Number, minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the milliseconds, according to local time, and returns the new time in
+ * milliseconds. Local time is determined by the operating system on which Flash Player
+ * is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMilliseconds.1.as -noswf
+ *
+ * @helpid x20901
+ * @refpath Objects/Core/Date/Methods/setMilliseconds
+ * @keyword date.setmilliseconds, setmilliseconds, date
+ */
+ public native function setMilliseconds(millisecond:Number):Number;
+
+ /**
+ * Sets the minutes, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param minute An integer from 0 to 59.
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMinutes.1.as -noswf
+ *
+ * @helpid x20902
+ * @refpath Objects/Core/Date/Methods/setMinutes
+ * @keyword date.setminutes, setminutes, date
+ */
+ public native function setMinutes(minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the month and optionally the day of the month, according to local time, and
+ * returns the new time in milliseconds. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMonth.1.as -noswf
+ *
+ * @helpid x20903
+ * @refpath Objects/Core/Date/Methods/setMonth
+ * @keyword date.setmonth, setmonth, date
+ */
+ public native function setMonth(month:Number, day:Number):Number;
+
+ /**
+ * Sets the seconds, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setSeconds.1.as -noswf
+ *
+ * @helpid x20904
+ * @refpath Objects/Core/Date/Methods/setSeconds
+ * @keyword date.setseconds, setseconds, date
+ */
+ public native function setSeconds(second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the date in milliseconds since midnight on January 1, 1970, and returns the new
+ * time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer value where 0 is midnight on January 1, universal time (UTC).
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setTime.1.as -noswf
+ *
+ * @helpid x20905
+ * @refpath Objects/Core/Date/Methods/setTime
+ * @keyword date.settime, settime, date
+ */
+ public native function setTime(millisecond:Number):Number;
+
+ /**
+ * Sets the day of the month, in universal time (UTC), and returns the new time in
+ * milliseconds. Calling this method does not modify the other fields of a Date
+ * object, but the Date.getUTCDay() and Date.getDay() methods can report
+ * a new value if the day of the week changes as a result of calling this method.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param day A number; an integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCDate.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x20906
+ * @refpath Objects/Core/Date/Methods/setUTCDate
+ * @keyword date.setutcdate, setutcdate, date
+ */
+ public native function setUTCDate(day:Number):Number;
+
+ /**
+ * Sets the year, in universal time (UTC), and returns the new time in milliseconds.
+ *
+ * Optionally, this method can also set the month and day of the month. Calling
+ * this method does not modify the other fields, but the Date.getUTCDay() and
+ * Date.getDay() methods can report a new value if the day of the week changes as a
+ * result of calling this method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year An integer that represents the year specified as a full four-digit year,
+ * such as 2000.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return An integer.
+ *
+ * @includeExample examples\Date.setUTCFullYear.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x20907
+ * @refpath Objects/Core/Date/Methods/setUTCFullYear
+ * @keyword date.setutcfullyear, setutcfullyear, date
+ */
+ public native function setUTCFullYear(year:Number, month:Number, day:Number):Number;
+
+ /**
+ * Sets the hour, in universal time (UTC), and returns the new time in milliseconds.
+ * Optionally, the minutes, seconds and milliseconds can be specified.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCHours.1.as -noswf
+ *
+ * @helpid x20908
+ * @refpath Objects/Core/Date/Methods/setUTCHours
+ * @keyword date.setutchours, setutchours, date
+ */
+ public native function setUTCHours(hour:Number, minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the milliseconds, in universal time (UTC), and returns the new time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMilliseconds.1.as -noswf
+ *
+ * @helpid x20909
+ * @refpath Objects/Core/Date/Methods/setUTCMilliseconds
+ * @keyword date.setutcmilliseconds, setutcmilliseconds, date
+ */
+ public native function setUTCMilliseconds(millisecond:Number):Number;
+
+ /**
+ * Sets the minutes, in universal time (UTC), and returns the new time in milliseconds.
+ * Optionally, you can specify the seconds and milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMinutes.1.as -noswf
+ *
+ * @helpid x2090A
+ * @refpath Objects/Core/Date/Methods/setUTCMinutes
+ * @keyword date.setutcminutes, setutcminutes, date
+ */
+ public native function setUTCMinutes(minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the month, and optionally the day, in universal time(UTC) and returns the new
+ * time in milliseconds. Calling this method does not modify the other fields, but the
+ * Date.getUTCDay() and Date.getDay() methods might report a new
+ * value if the day of the week changes as a result of calling this method.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMonth.1.as -noswf
+ *
+ * @see #getDay()
+ * @helpid x2090B
+ * @refpath Objects/Core/Date/Methods/setUTCMonth
+ * @keyword date.setutcmonth, setutcmonth, date
+ */
+ public native function setUTCMonth(month:Number, day:Number):Number;
+
+ /**
+ * Sets the seconds, and optionally the milliseconds, in universal time (UTC) and
+ * returns the new time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCSeconds.1.as -noswf
+ *
+ * @helpid x2090C
+ * @refpath Objects/Core/Date/Methods/setUTCSeconds
+ * @keyword date.setutcseconds, setutcseconds, date
+ */
+ public native function setUTCSeconds(second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the year, in local time, and returns the new time in milliseconds. Local time is
+ * determined by the operating system on which Flash Player is running.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A number that represents the year. If year is an
+ * integer between 0 and 99, setYear sets the year at 1900 +
+ * year; otherwise, the year is the value of the year
+ * parameter.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setYear.1.as -noswf
+ *
+ * @helpid x2090D
+ * @refpath Objects/Core/Date/Methods/setYear
+ * @keyword date.setyear, setyear, date
+ */
+ public native function setYear(year:Number):Number;
+
+
+ /**
+ * Returns a string representation of the day and date only, and does not include the time or timezone.
+ * Contrast with the following methods:
+ *
+ *
Date.toTimeString(), which returns only the time and timezone
+ *
Date.toString(), which returns not only the day and date, but also the time and timezone.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of day and date only.
+ *
+ * @includeExample examples\Date.toDateString.1.as -noswf
+ *
+ * @see #toString()
+ */
+ public native function toDateString():String;
+
+ /**
+ * Returns a String representation of the time and timezone only, and does not include the day and date.
+ * Contrast with the Date.toDateString() method, which returns only the day and date.
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of time and timezone only.
+ *
+ * @see #toDateString()
+ */
+ public native function toTimeString():String;
+
+ /**
+ * Returns a String representation of the day, date, time, given in local time.
+ * Contrast with the Date.toString() method, which returns the same information (plus the timezone)
+ * with the year listed at the end of the string.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string representation of a Date object in the local timezone.
+ *
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Returns a String representation of the day and date only, and does not include the time or timezone.
+ * This method returns the same value as Date.toDateString.
+ * Contrast with the following methods:
+ *
+ *
Date.toTimeString(), which returns only the time and timezone
+ *
Date.toString(), which returns not only the day and date, but also the
+ * time and timezone.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The String representation of day and date only.
+ *
+ * @see #toDateString()
+ * @see #toTimeString()
+ * @see #toString()
+ */
+ public native function toLocaleDateString():String;
+
+ /**
+ * Returns a String representation of the time only, and does not include the day, date, year or timezone.
+ * Contrast with the Date.toTimeString() method, which returns the time and timezone.
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of time and timezone only.
+ *
+ * @see #toTimeString()
+ */
+ public native function toLocaleTimeString():String;
+
+ /**
+ * Returns a String representation of the day, date, and time in universal time (UTC).
+ * For example, the date February 1, 2005 is returned as Tue Feb 1 00:00:00 2005 UTC.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The string representation of a Date object in UTC time.
+ *
+ * @see #toString()
+ */
+ public native function toUTCString():String;
+
+
+ /**
+ * Returns a String representation of the day, date, time, and timezone.
+ * The date format for the output is:
+ *
+ * Day Mon Date HH:MM:SS TZD YYYY
+ *
+ *
For example:
+ *
+ * Wed Apr 12 15:30:17 GMT-0700 2006
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The string representation of a Date object.
+ *
+ * @includeExample examples\Date.toString.1.as -noswf
+ *
+ * @helpid x2090E
+ * @refpath Objects/Core/Date/Methods/toString
+ * @keyword date.tostring, tostring, date
+ */
+ public native function toString():String;
+
+ /**
+ * Returns the number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The number of milliseconds since January 1, 1970 that a Date object represents.
+ *
+ * @includeExample examples\Date.valueOf.1.as -noswf
+ *
+ * @helpid
+ * @refpath Objects/Core/Date/Methods/valueOf
+ * @keyword date.valueof, valueof, date
+ */
+ public native function valueOf():Number;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// DefinitionError object
+//****************************************************************************
+/**
+ * The DefinitionError class represents an error that occurs whenever user code
+ * attempts to define an identifier that is already defined. Common cases
+ * where this error occurs include redefining classes, interfaces,
+ * or functions.
+ *
+ * @tiptext An DefinitionError is thrown when code attempts to redefine a class,
+ * interface, or function.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ */
+public dynamic class DefinitionError extends Error
+{
+ /**
+ * Creates a new DefinitionError object.
+ */
+ public native function DefinitionError(message:String = "");
+}
+
+
+}
+package flash.errors
+{
+ /**
+ * An EOFError exception is thrown when you attempt to read past the end of the available data. For example, an
+ * EOFError is thrown when one of the read methods in the IDataInput interface is
+ * called and there is insufficient data to satisfy the read request.
+ *
+ * @includeExample examples\EOFErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see flash.utils.ByteArray
+ * @see flash.utils.IDataInput
+ * @see flash.net.Socket
+ * @see flash.net.URLStream
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class EOFError extends IOError {
+ /**
+ * Creates a new EOFError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function EOFError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Error object
+//****************************************************************************
+/**
+ * Contains information about an error that occurred in a script. While developing ActionScript 3.0 applications,
+ * you can run your compiled code and Flash Player will display exceptions of type Error, or of a subclass,
+ * in a dialog box at runtime to help you troubleshoot the code.
+ * You create an Error object using the Error constructor function.
+ * Typically, you throw a new Error object from within a try
+ * code block that is then caught by a catch or finally code block.
+ *
You can also create a subclass of the Error class and throw instances of that subclass.
+ *
+ * @includeExample examples\ErrorExample.as -noswf
+ *
+ * @tiptext An Error is thrown when an error occurs in a script.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+public dynamic class Error extends Object
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Error() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Error()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Contains the reference number associated with the specific error message. For a custom Error object
+ * this number is the value from the id parameter supplied in the constructor.
+ * @return The error code number for a specific error message.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Contains the error number.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.errorID, errorID
+ */
+ public native function get errorID():int;
+
+ /**
+ * Contains the message associated with the Error object. By default, the value of this property
+ * is "Error". You can specify a message property when you create an
+ * Error object by passing the error string to the Error constructor function.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Contains the error message associated with the Error instance.
+ *
+ * @oldexample In the following example, a method throws errors based on the
+ * parameters passed to it. If either of the parameters is unspecified an instance of
+ * the Error class with an appropriate message is thrown. If the second parameter is
+ * zero an error with a different message gets thrown:
+ *
+ * function divideNum(num1:Number, num2:Number):Number {
+ * if (isNaN(num1) || isNaN(num2)) {
+ * throw new Error("divideNum function requires two numeric parameters.");
+ * } else if (num2 == 0) {
+ * throw new Error("cannot divide by zero.");
+ * }
+ * return num1/num2;
+ * }
+ * try {
+ * var theNum:Number = divideNum(1, 0);
+ * trace("SUCCESS! "+theNum);
+ * } catch (e_err:Error) {
+ * trace("ERROR! "+e_err.message);
+ * trace("\t"+e_err.name);
+ * }
+ *
+ * If you test this ActionScript with the specified parameters, an error message
+ * displays indicating that you are attempting to divide by 0.
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.message, message
+ */
+ public var message:String;
+
+ /**
+ * Contains the name of the Error object. By default, the value of this property is "Error".
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The name of the Error instance.
+ *
+ * @oldexample In the following example, a function throws a specified error depending on the two numbers that you try to divide. Add the following ActionScript to Frame 1 of the Timeline:
+ *
+ * function divideNumber(numerator:Number, denominator:Number):Number {
+ * if (isNaN(numerator) || isNaN(denominator)) {
+ * throw new Error("divideNum function requires two numeric parameters.");
+ * } else if (denominator == 0) {
+ * throw new DivideByZeroError();
+ * }
+ * return numerator/denominator;
+ * }
+ * try {
+ * var theNum:Number = divideNumber(1, 0);
+ * trace("SUCCESS! "+theNum);
+ * // output: DivideByZeroError -> Unable to divide by zero.
+ * } catch (e_err:DivideByZeroError) {
+ * // divide by zero error occurred
+ * trace(e_err.name+" -> "+e_err.toString());
+ * } catch (e_err:Error) {
+ * // generic error occurred
+ * trace(e_err.name+" -> "+e_err.toString());
+ * }
+ *
+ *
In the following example, we define a custom Error class called
+ * DivideByZeroError:
+ *
+ * class DivideByZeroError extends Error {
+ * public DivideByZeroError() {
+ * super ("Unable to divide by zero.");
+ * name = "DivideByZeroError";
+ * }
+ * }
+ *
+ *
The following method then throws the custom error when it detects the
+ * appropriate error conditions:
+ *
+ * function divideNumbers(num1:Number, num2:Number) { etc.
+ *
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.name, name
+ */
+ public var name:String;
+
+ /**
+ * Creates a new Error object. If message is specified, its value is assigned
+ * to the object's Error.message property.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Creates a new Error instance with the specified error message.
+ *
+ * @param message A string associated with the Error object; this parameter
+ * is optional.
+ * @param id A reference number to associate with the specific error message.
+ *
+ * @return A reference to an Error object.
+ *
+ * @includeExample examples\Error.1.as -noswf
+ *
+ * @oldexample In the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical:
+ *
+ * function compareStrings(str1_str:String, str2_str:String):void {
+ * if (str1_str != str2_str) {
+ * throw new Error("Strings do not match.");
+ * }
+ * }
+ * try {
+ * compareStrings("Dog", "dog");
+ * // output: Strings do not match.
+ * } catch (e_err:Error) {
+ * trace(e_err.toString());
+ * }
+ *
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error, constructor
+ */
+ public native function Error(message:String = "", id:int = 0);
+
+ /**
+ * For debugger versions of the Flash Player, only; this method returns the call stack for an error
+ * as a string at the time of the error's construction. The first line of the return value is the
+ * string representation of the exception object, followed by the strack trace elements. For example:
+ *
+ * TypeError: null cannot be converted to an object
+ * at com.xyz.OrderEntry.retrieveData(OrderEntry.as:995)
+ * at com.xyz.OrderEntry.init(OrderEntry.as:200)
+ * at com.xyz.OrderEntry.$construct(OrderEntry.as:148)
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the call stack for an error in a readable form.
+ *
+ *
+ * @return A string representation of the call stack.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error, call stack
+ */
+ public native function getStackTrace():String
+
+ /**
+ *
+ * Returns the string "Error" by default or the value contained in Error.message, if defined.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the error message, or the word "Error" if the message is
+ * undefined.
+ *
+ * @return The error message.
+ *
+ * @includeExample examples\Error.toString.1.as -noswf
+ *
+ * @oldexample In the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical:
+ *
+ * function compareStrings(str1_str:String, str2_str:String):void {
+ * if (str1_str != str2_str) {
+ * throw new Error("Strings do not match.");
+ * }
+ * }
+ * try {
+ * compareStrings("Dog", "dog");
+ * // output: Strings do not match.
+ * } catch (e_err:Error) {
+ * trace(e_err.toString());
+ * }
+ *
+ *
+ * @see #message Error.message
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.toString, toString
+ */
+ override native public function toString():String;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// EvalError object
+//****************************************************************************
+/**
+ * The EvalError class represents an error that occurs whenever user code
+ * calls the eval() function or attempts to use the new
+ * operator with a Function object. Neither calling eval() nor
+ * calling new with a Function object is supported.
+ *
+ * @tiptext An EvalError is thrown when code attempts to call eval() or use new with
+ * a Function object.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ */
+public dynamic class EvalError extends Error
+{
+ /**
+ * Creates a new EvalError object.
+ */
+ public native function EvalError(message:String = "");
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Function object
+//****************************************************************************
+
+
+/**
+ * A Function is the basic unit of code that can be invoked in ActionScript.
+ * Both user-defined and built-in functions in ActionScript are represented by Function objects,
+ * which are instances of the Function class.
+ *
Methods of a class are slightly different than Function objects. Unlike an ordinary function object, a method is tightly linked to its associated class object. So, a method or property has a definition that is shared among all instances of the same class. Methods can be extracted from an instance and treated as "bound methods" (retaining the link to the original instance). For a bound method, the this keyword points to the original object that implemented the method. For a function, this points to the associated object at the time the function is invoked.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\FunctionExample.as -noswf
+ *
+ * @tiptext The Function class is used to represent a built-in or user-defined function.
+ *
+ * @helpid
+ * @refpath
+ * @keyword Function, Function object, built-in class
+ */
+dynamic public class Function
+{
+ /**
+ */
+ public var prototype:Object;
+
+ /**
+ * Specifies the value of thisObject to be used within any function that ActionScript calls.
+ * This method also specifies the parameters to be passed to any called function. Because apply()
+ * is a method of the Function class, it is also a method of every Function object in ActionScript.
+ *
The parameters are specified as an Array object, unlike Function.call(), which specifies
+ * parameters as a comma-delimited list. This is often useful when the number of parameters to be passed is not
+ * known until the script actually executes.
+ *
Returns the value that the called function specifies as the return value.
+
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the object instance on which the Function is called.
+ *
+ * @param thisObject The object to which myFunction is applied.
+ *
+ * @param argArray An array whose elements are passed to myFunction as parameters.
+ *
+ * @return Any value that the called function specifies.
+ *
+ *
+ * @oldexample The following function invocations are equivalent:
+ *
The following simple example shows how apply() passes an array of parameters:
+ *
+ * function theFunction() {
+ * trace(arguments);
+ * }
+ *
+ * // create a new array to pass as a parameter to apply()
+ * var firstArray:Array = new Array(1,2,3);
+ * theFunction.apply(null,firstArray);
+ * // outputs: 1,2,3
+ *
+ * // create a second array to pass as a parameter to apply()
+ * var secondArray:Array = new Array("a", "b", "c");
+ * theFunction.apply(null,secondArray);
+ * // outputs a,b,c
+ *
+ *
The following example shows how apply() passes an array of parameters and specifies the value of this:
+ *
+ * // define a function
+ * function theFunction() {
+ * trace("this == myObj? " + (this == myObj));
+ * trace("arguments: " + arguments);
+ * }
+ *
+ * // instantiate an object
+ * var myObj:Object = new Object();
+ *
+ * // create arrays to pass as a parameter to apply()
+ * var firstArray:Array = new Array(1,2,3);
+ * var secondArray:Array = new Array("a", "b", "c");
+ *
+ * // use apply() to set the value of this to be myObj and send firstArray
+ * theFunction.apply(myObj,firstArray);
+ * // output:
+ * // this == myObj? true
+ * // arguments: 1,2,3
+ *
+ * // use apply() to set the value of this to be myObj and send secondArray
+ * theFunction.apply(myObj,secondArray);
+ * // output:
+ * // this == myObj? true
+ * // arguments: a,b,c
+ *
+ *
+ * @see #call() Function.call()
+ * @helpid
+ * @refpath
+ * @keyword Function, Function.apply, apply
+ */
+ public native function apply(thisObject:Object,argArray:Array = null): void;
+
+ /**
+ * Invokes the function represented by a Function object. Every function in ActionScript
+ * is represented by a Function object, so all functions support this method.
+ *
In almost all cases, the function call (()) operator can be used instead of this method.
+ * The function call operator produces code that is concise and readable. This method is primarily useful
+ * when the thisObject parameter of the function invocation needs to be explicitly controlled.
+ * Normally, if a function is invoked as a method of an object, within the body of the function, thisObject
+ * is set to myObject, as shown in the following example:
+ *
+ * myObject.myMethod(1, 2, 3);
+ *
+ *
In some situations, you might want thisObject to point somewhere else;
+ * for example, if a function must be invoked as a method of an object, but is not actually stored as a method
+ * of that object:
You can pass the value null for the thisObject parameter to invoke a function as a
+ * regular function and not as a method of an object. For example, the following function invocations are equivalent:
Returns the value that the called function specifies as the return value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Invokes this Function.
+ *
+ * @param thisObject An object that specifies the value of thisObject within the function body.
+ *
+ * @param parameter1 A parameter to be passed to the myFunction. You can specify zero or more parameters.
+ *
+ * @oldexample The following example uses Function.call() to make a function behave as a method of another object, without storing the function in the object:
+ *
+ * function myObject() {
+ * }
+ * function myMethod(obj) {
+ * trace("this == obj? " + (this == obj));
+ * }
+ * var obj:Object = new myObject();
+ * myMethod.call(obj, obj);
+ *
+ *
The trace() statement displays:
+ *
The trace() statement sends the following code to the log file:
+ *
+ * this == obj? true
+ *
+ *
+ * @see #apply() Function.apply()
+ * @helpid
+ * @refpath
+ * @keyword Function, Function.call, call
+ */
+ public native function call(thisObject:Object, parameter1:String = null): void;
+ /**
+ */
+ public native function toString():String;
+}
+
+
+}
+package {
+// Top Level functions
+
+
+ /**
+ * Creates a new array. The array can be of length zero or more, or an array populated by a list of
+ * specified elements, possibly of different data types. The number and data type of
+ * the arguments you use determine the contents of the returned array.
+ *
+ *
Calling Array() with no arguments returns an empty array.
+ *
Calling Array() with a single integer argument returns an array of the specified length, but whose elements have undefined values.
+ *
Calling Array() with a list of specific values returns an array with elements that contain each of the specified values.
+ *
+ * Using the Array() function is similar to creating an array with the Array class constructor.
+ *
Use the as operator for explicit type conversion, or type casting,
+ * when the argument is not a primitive value. For more information, see the Example
+ * section of this entry.
+ * @includeExample examples\Array.func.4.as -noswf
+ * @includeExample examples\Array.func.5.as -noswf
+ * @param args You can pass no arguments for an empty array, a single integer argument for an array of a specific length, or a series of comma-separated values of various types for an array populated with those values.
+ * @return An array of length zero or more.
+ * @see Array Array class
+ * @see operators.html#as as operator
+ */
+ public native function Array(...args):Array
+
+ /**
+ * Converts the expression parameter to a Boolean value and returns the value.
+ *
The return value depends on the data type and value of the argument, as described in the following table:
+ *
+ *
+ *
+ *
Input Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
0
+ *
0
+ *
false
+ *
+ *
+ *
NaN
+ *
NaN
+ *
false
+ *
+ *
+ *
Number (not 0 or NaN)
+ *
4
+ *
true
+ *
+ *
+ *
Empty string
+ *
""
+ *
false
+ *
+ *
+ *
Non-empty string
+ *
"6"
+ *
true
+ *
+ *
+ *
null
+ *
null
+ *
false
+ *
+ *
+ *
undefined
+ *
undefined
+ *
false
+ *
+ *
+ *
instance of Object class
+ *
var obj:Object = new Object(); Boolean(obj)
+ *
true
+ *
+ *
+ *
No argument
+ *
Boolean()
+ *
false
+ *
+ *
+ *
Unlike previous versions of ActionScript, the Boolean() function returns the same results as does the Boolean class constructor.
+ * @param expression An expression or object to convert to Boolean.
+ * @return The result of the conversion to Boolean.
+ */
+ public native function Boolean(expression:Object):Boolean
+
+ /**
+ * Decodes an encoded URI into a string. Returns a string in which all characters previously encoded
+ * by the encodeURI function are restored to their unencoded representation.
+ *
The following table shows the set of escape sequences that are not decoded to characters by the decodeURI function. Use decodeURIComponent() to decode the escape sequences in this table.
+ *
+ *
+ *
Escape sequences not decoded
+ *
Character equivalents
+ *
+ *
+ *
%23
+ *
#
+ *
+ *
+ *
%24
+ *
$
+ *
+ *
+ *
%26
+ *
&
+ *
+ *
+ *
%2B
+ *
+
+ *
+ *
+ *
%2C
+ *
,
+ *
+ *
+ *
%2F
+ *
/
+ *
+ *
+ *
%3A
+ *
:
+ *
+ *
+ *
%3B
+ *
;
+ *
+ *
+ *
%3D
+ *
=
+ *
+ *
+ *
%3F
+ *
?
+ *
+ *
+ *
%40
+ *
@
+ *
+ *
+
+ * @param uri A string encoded with the encodeURI function.
+ * @return A string in which all characters previously escaped by the encodeURI function are
+ * restored to their unescaped representation.
+ * @includeExample examples\DecodeURIExample.as -noswf
+
+ * @see global#decodeURIComponent()
+ * @see global#encodeURI()
+ * @see global#encodeURIComponent()
+ */
+ public native function decodeURI(uri:String):String
+
+ /**
+ * Decodes an encoded URI component into a string. Returns a string in which
+ * all characters previously escaped by the encodeURIComponent
+ * function are restored to their uncoded representation.
+ *
This function differs from the decodeURI() function in that it is intended for use only with a part of a URI string, called a URI component.
+ * A URI component is any text that appears between special characters called component separators ( ":", "/", ";" and "?" ).
+ * Common examples of a URI component are "http" and "www.adobe.com".
+ *
Another important difference between this function and decodeURI() is that because this function
+ * assumes that it is processing a URI component it treats the escape sequences that represent special separator characters (; / ? : @ & = + $ , #) as regular
+ * text that should be decoded.
+ * @param uri A string encoded with the encodeURIComponent function.
+ * @return A string in which all characters previously escaped by the encodeURIComponent function are
+ * restored to their unescaped representation.
+ * @see global#decodeURI()
+ * @see global#encodeURI()
+ * @see global#encodeURIComponent()
+ */
+ public native function decodeURIComponent(uri:String):String
+
+ /**
+ * Encodes a string into a valid URI (Uniform Resource Identifier).
+ * Converts a complete URI into a string in which all characters are encoded
+ * as UTF-8 escape sequences unless a character belongs to a small group of basic characters.
+ *
The following table shows the entire set of basic characters that are not converted to UTF-8 escape sequences by the encodeURI function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
; / ? : @ & = + $ , #
+ *
+ *
+ *
- _ . ! ~ ~~ ' ( )
+ *
+ *
+ * @param uri A string representing a complete URI.
+ * @return A string with certain characters encoded as UTF-8 escape sequences.
+ * @includeExample examples\EncodeURIExample.as -noswf
+ * @see global#decodeURI()
+ * @see global#decodeURIComponent()
+ * @see global#encodeURIComponent()
+ */
+ public native function encodeURI(uri:String):String
+
+ /**
+ * Encodes a string into a valid URI component. Converts a substring of a URI into a
+ * string in which all characters are encoded as UTF-8 escape sequences unless a character
+ * belongs to a very small group of basic characters.
+ *
The encodeURIComponent() function differs from the encodeURI() function in that it is intended for use only with a part of a URI string, called a URI component.
+ * A URI component is any text that appears between special characters called component separators ( ":", "/", ";" and "?" ).
+ * Common examples of a URI component are "http" and "www.adobe.com".
+ *
Another important difference between this function and encodeURI() is that because this function
+ * assumes that it is processing a URI component it treats the special separator characters (; / ? : @ & = + $ , #) as regular
+ * text that should be encoded.
+ *
The following table shows all characters that are not converted to UTF-8 escape sequences by the encodeURIComponent function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
- _ . ! ~ ~~ ' ( )
+ *
+ *
+ * @see global#decodeURI()
+ * @see global#decodeURIComponent()
+ * @see global#encodeURI()
+ */
+ public native function encodeURIComponent(uri:String):String
+
+ /**
+ * Converts the parameter to a string and encodes it in a URL-encoded format,
+ * where most nonalphanumeric characters are replaced with % hexadecimal sequences.
+ * When used in a URL-encoded string, the percentage symbol (%) is used to introduce
+ * escape characters, and is not equivalent to the modulo operator (%).
+ *
The following table shows all characters that are not converted to escape sequences by the escape() function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
@ - _ . ~~ + /
+ *
+ *
+
+ * @param str The expression to convert into a string and encode in a URL-encoded format.
+ * @return A URL-encoded string.
+ * @see global#unescape()
+ */
+ public native function escape(str:String):String
+
+ /**
+ * Converts a given numeric value to an integer value. Decimal values are truncated at the decimal point.
+ * @param value A value to be converted to an integer.
+ * @return The converted integer value.
+ * @see global#uint()
+ */
+ public native function int(value:Number):int
+
+ /**
+ * Returns true if the value is a finite number,
+ * or false if the value is Infinity or -Infinity.
+ * The presence of Infinity or -Infinity indicates a mathematical
+ * error condition such as division by 0.
+ * @param num A number to evaluate as finite or infinite.
+ * @return Returns true if it is a finite number
+ * or false if it is infinity or negative infinity.
+ */
+ public native function isFinite(num:Number):Boolean
+
+
+ /**
+ * Returns true if the value is NaN(not a number). The isNaN() function is useful for checking whether a mathematical expression evaluates successfully to a number. The NaN value is a special member of the Number data type that represents a value that is "not a number."
+ *
Note: The NaN value is not a member of the int or uint data types.
+ *
The following table describes the return value of isNaN() on various input types and values.
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
0 divided by 0
+ *
isNaN(0/0)
+ *
true
+ *
+ *
+ *
Non-zero number divided by 0
+ *
isNaN(5/0)
+ *
false
+ *
+ *
+ *
Square root of a negative number
+ *
isNaN(Math.sqrt(-1))
+ *
true
+ *
+ *
+ *
Arcsine of number greater than 1 or less than 0
+ *
isNaN(Math.asin(2))
+ *
true
+ *
+ *
+ *
String that can be converted to Number
+ *
isNaN("5")
+ *
false
+ *
+ *
+ *
String that cannot be converted to Number
+ *
isNaN("5a")
+ *
true
+ *
+ *
+ * @param num A numeric value or mathematical expression to evaluate.
+ * @return Returns true if the value is NaN(not a number) and false otherwise.
+ */
+ public native function isNaN(num:Number):Boolean
+
+ /**
+ * Determines whether the specified string is a valid name for an XML element or attribute.
+ * @param str A string to evaluate.
+ * @return Returns true if the str argument is a valid XML name; false otherwise.
+ */
+ public native function isXMLName(str:String):Boolean
+
+ /**
+ * Converts a given value to a Number value. The following table shows the result of various input types:
+ *
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
Number(undefined)
+ *
NaN
+ *
+ *
+ *
null
+ *
Number(null)
+ *
0
+ *
+ *
+ *
true
+ *
Number(true)
+ *
1
+ *
+ *
+ *
false
+ *
Number(false)
+ *
0
+ *
+ *
+ *
NaN
+ *
Number(NaN)
+ *
NaN
+ *
+ *
+ *
Empty string
+ *
Number("")
+ *
0
+ *
+ *
+ *
String that converts to Number
+ *
Number("5")
+ *
The number (e.g. 5)
+ *
+ *
+ *
String that does not convert to Number
+ *
Number("5a")
+ *
NaN
+ *
+ *
+ * @param value A value to be converted to a number.
+ * @return The converted number value.
+ */
+ public native function Number(expression:Object):Number
+
+ /**
+ * Every value in ActionScript 3.0 is an object, which means that calling Object() on a value returns that value.
+ * @param value An object or a number, string, or Boolean value to convert.
+ * @return The value specified by the value parameter.
+ */
+ public native function Object(value:Object):Object
+
+ /**
+ * Converts a string to an integer. If the specified string in the parameters cannot be converted to a number, the function returns NaN. Strings beginning with 0x are interpreted as hexadecimal numbers. Unlike in previous versions of ActionScript, integers beginning with 0 are not interpreted as octal numbers. You must specify a radix of 8 for octal numbers. White space and zeroes preceding valid integers is ignored, as are trailing nonnumeric characters.
+ * @param str A string to convert to an integer.
+ * @param radix An integer representing the radix (base) of the number to parse. Legal values are from 2 to 36.
+ * @return A number or NaN (not a number).
+ */
+ public native function parseInt(str:String, radix:uint=0):Number
+
+ /**
+ * Converts a string to a floating-point number. The function reads, or parses, and returns the numbers in a string until it reaches a character that is not a part of the initial number. If the string does not begin with a number that can be parsed, parseFloat() returns NaN. White space preceding valid integers is ignored, as are trailing nonnumeric characters.
+ * @param str The string to read and convert to a floating-point number.
+ * @return A number or NaN (not a number).
+ */
+ public native function parseFloat(str:String):Number
+
+ /**
+ * Returns a string representation of the specified parameter.
+ *
The following table shows the result of various input types:
+ *
+ *
+ *
Input Type/Value
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
undefined
+ *
+ *
+ *
null
+ *
"null"
+ *
+ *
+ *
true
+ *
"true"
+ *
+ *
+ *
false
+ *
"false"
+ *
+ *
+ *
NaN
+ *
"NaN"
+ *
+ *
+ *
String
+ *
String
+ *
+ *
+ *
Object
+ *
Object.toString()
+ *
+ *
+ *
Number
+ *
String representation of the number
+ *
+ *
+ * @param expression An expression to convert to a string.
+ * @return A string representation of the value passed for the expression parameter.
+ */
+ public native function String(expression:Object):String
+
+ /**
+ * Evaluates the parameter str as a string, decodes the string from URL-encoded format
+ * (converting all hexadecimal sequences to ASCII characters), and returns the string.
+ * @param str A string with hexadecimal sequences to escape.
+ * @return A string decoded from a URL-encoded parameter.
+ */
+ public native function unescape(str:String):String
+
+ /**
+ * Converts a given numeric value to an unsigned integer value. Decimal values are truncated at the decimal point.
+ *
The following table describes the return value of uint() on various input types and values.
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
uint(undefined)
+ *
0
+ *
+ *
+ *
null
+ *
uint(null)
+ *
0
+ *
+ *
+ *
0
+ *
uint(0)
+ *
0
+ *
+ *
+ *
NaN
+ *
uint(NaN)
+ *
0
+ *
+ *
+ *
Positive floating point number
+ *
uint(5.31)
+ *
Truncated unsigned integer (e.g. 5)
+ *
+ *
+ *
Negative floating point number
+ *
uint(-5.78)
+ *
Truncates to integer then applies rule for negative integers
+ *
+ *
+ *
Negative integer
+ *
uint(-5)
+ *
Sum of uint.MAX_VALUE and the negative integer (e.g. uint.MAX_VALUE + (-5))
+ *
+ *
+ *
true
+ *
uint(true)
+ *
1
+ *
+ *
+ *
false
+ *
uint(false)
+ *
0
+ *
+ *
+ *
Empty String
+ *
uint("")
+ *
0
+ *
+ *
+ *
String that converts to Number
+ *
uint("5")
+ *
See rules for Numbers in this table
+ *
+ *
+ *
String that does not convert to Number
+ *
uint("5a")
+ *
0
+ *
+ *
+
+ * @param value A value to be converted to an integer.
+ * @return The converted integer value.
+ * @see global#int()
+ */
+ public native function uint(value:Number):uint
+
+ /**
+ * Converts an object to an XML object.
+ *
The following table describes return values for various input types.
+ *
+ *
+ *
Parameter Type
+ *
Return Value
+ *
+ *
+ *
Boolean
+ *
Value is first converted to a string, then converted to an XML object.
+ *
+ *
+ *
Null
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
Number
+ *
Value is first converted to a string, then converted to an XML object.
+ *
+ *
+ *
Object
+ *
Converts to XML only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ *
String
+ *
Value is converted to XML.
+ *
+ *
+ *
Undefined
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
XML
+ *
Input value is returned unchanged.
+ *
+ *
+ *
XMLList
+ *
Returns an XML object only if the XMLList object contains only one property of type XML. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ * @param expression Object to be converted to XML.
+ * @return An XML object containing values held in the converted object.
+ * @see global#XMLList()
+ */
+ public native function XML(expression:Object):XML
+
+ /**
+ * Converts an object to an XMLList object, as described in the following table.
+ *
+ *
+ *
Parameter Type
+ *
Return Value
+ *
+ *
+ *
Boolean
+ *
Value is first converted to a string, then converted to an XMLList object.
+ *
+ *
+ *
Null
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
Number
+ *
Value is first converted to a string, then converted to an XMLList object.
+ *
+ *
+ *
Object
+ *
Converts to XMLList only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ *
String
+ *
Value is converted to an XMLList object.
+ *
+ *
+ *
Undefined
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
XML
+ *
Value is converted to an XMLList object.
+ *
+ *
+ *
XMLList
+ *
Input value is returned unchanged.
+ *
+ *
+ * @param expression Object to be converted into an XMLList object.
+ * @return An XMLList object containing values held in the converted object.
+ * @see global#XML()
+ */
+ public native function XMLList(expression:Object):XMLList
+
+
+}
+package flash.errors
+{
+ /**
+ * The IllegalOperationError exception is thrown when a method is not implemented or the
+ * implementation doesn't cover the current usage.
+ *
+ * Examples of illegal operation error exceptions include:
+ *
+ *
A base class, such as DisplayObjectContainer, provides more functionality than a Stage
+ * can support (such as masks)
+ *
Certain accessibility methods are called when Flash Player is compiled without accessibility
+ * support
+ *
The mms.cfg setting prohibits a FileReference action
+ *
ActionScript tries to run a FileReference.browse() call when a browse dialog box is already up
+ *
ActionScript tries to use an unsupported protocol for FileReference (such as FTP)
+ *
+ *
Authoring only features are invoked from a run-time player.
+ *
An attempt is made to set the name of a timeline-placed object.
+ *
+ *
+ *
+ *
+ *
+ * @includeExample examples\IllegalOperationErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class IllegalOperationError extends Error {
+ /**
+ * Creates a new IllegalOperationError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function IllegalOperationError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+/**
+ * A data type representing a 32-bit signed integer.
+ * The range of values represented by the int class is -2,147,483,648 (-2^31) to 2,147,483,647 (2^31-1).
+ *
The properties of the int class are static, which means you do not need an object to use them, so you do not need to use the constructor. The methods, however, are not static, which means that you do need an object to use them. You can create an int object by using the int class constructor or by declaring a variable of type int and assigning the variable a literal value.
+ *
The int data type is useful for loop counters and other situations where a floating point number is not needed, and is similar to the int data type in Java and C++. The default value of a variable typed as int is 0
+ *
If you are working with numbers that exceed int.MAX_VALUE, consider using Number.
+ *
The following example calls the toString() method of the int class, which returns the string 1234:
+ *
+ *
+ * @helpid x20964
+ * @refpath Objects/Core/int/Constants/MAX_VALUE
+ * @keyword int, int.max_value, max_value, max value
+ */
+ public static const MAX_VALUE:int = 2147483647;
+
+ /**
+ * The smallest representable 32-bit signed integer, which is -2,147,483,648.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @example The following ActionScript displayswrites the largest and smallest representable ints to the Output panel to the log file:
+ *
+ *
+ *
+ * @helpid x2096B
+ * @refpath Objects/Core/int/Constants/MIN_VALUE
+ * @keyword int, int.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:int = -2147483648;
+
+ /**
+ * Constructor; creates a new int object. You must use the int constructor when using int.toString() and int.valueOf(). You do not use a constructor when using the properties of a int object. The new int constructor is primarily used as a placeholder. A int object is not the same as the int() function that converts a parameter to a primitive value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ *
+ * @param num The numeric value of the int object being created or a value to be converted to a number. The default value is 0 if value is not provided.
+ *
+ * @return A reference to a int object.
+ *
+ * @example The following code constructs new int objects:
+ *
+ * var n1:int = new int(3.4);
+ * var n2:int = new int(-10);
+ *
+ *
+ *
+ * @see int#toString()
+ * @see int#valueOf()
+ * @helpid x2097C
+ * @refpath Objects/Core/int/new int
+ * @keyword new number, constructor
+ */
+ public native function int(num:Object);
+
+ /**
+ * Returns the string representation of an int object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10.
+ *
+ * @return A string.
+ *
+ * @example The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9:
+ *
The following example results in a hexadecimal value.
+ *
+ * var r:int = new int(250);
+ * var g:int = new int(128);
+ * var b:int = new int(114);
+ * var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
+ * trace(rgb);
+ * // output: rgb:0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid x2097E
+ * @refpath Objects/Core/int/Methods/toString
+ * @keyword number, number.tostring, tostring
+ */
+ public native function toString(radix:uint):String;
+
+ /**
+ * Returns the primitive value of the specified int object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return An int value.
+ *
+ * @example The following example results in the primative value of the numSocks object.
+ *
+ * var numSocks = new int(2);
+ * trace(numSocks.valueOf()); // output: 2
+ *
+ *
+ * @helpid x20A24
+ * @refpath Objects/Core/int/Methods/valueOf
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():int;
+}
+}
+package flash.errors
+{
+ /**
+ * The IOError exception is thrown when some type of input or output failure occurs.
+ * For example, an IOError exception is thrown if a read/write operation is attempted on
+ * a socket that has not connected or that has become disconnected.
+ *
+ *
+ * @includeExample examples\IOErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class IOError extends Error {
+ /**
+ * Creates a new IOError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function IOError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Math object
+//****************************************************************************
+
+/**
+ * The Math class contains methods and constants that represent common mathematical
+ * functions and values.
+ *
Use the methods and properties of this class to access and manipulate mathematical constants and functions.
+ * All the properties and methods of the Math class are static and must be called using the syntax
+ * Math.method(parameter) or Math.constant.
+ * In ActionScript, constants are defined with the maximum precision of double-precision IEEE-754 floating-point numbers.
+ *
Several Math class methods use the measure of an angle in radians as a parameter. You can use the following equation
+ * to calculate radian values before calling the method and then provide the calculated value as the parameter, or you can
+ * provide the entire right side of the equation (with the angle's measure in degrees in place of degrees) as
+ * the radian parameter.
+ *
To calculate a radian value, use the following formula:
+ *
+ * radians = degrees ~~ Math.PI/180
+ *
+ *
To calculate degrees from radians, use the following formula:
+ *
+ * degrees = radians ~~ 180/Math.PI
+ *
+ *
The following is an example of passing the equation as a parameter to calculate the sine of a 45° angle:
+ *
Math.sin(45 ~~ Math.PI/180) is the same as Math.sin(.7854)
+ *
Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow, sin, and sqrt may
+ * result in slightly different values depending on the algorithms
+ * used by the CPU or operating system. Flash Player calls on the CPU (or operating system if the CPU doesn't support
+ * floating point calculations) when performing the calculations for the listed functions, and results have shown
+ * slight variations depending upon the CPU or operating system in use.
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The Math class is a top-level class consisting of static properties and
+ * methods that define common mathematical constants and functions.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math, math object, built-in class
+ */
+public final class Math
+{
+ /**
+ * A mathematical constant for the base of natural logarithms, expressed as e.
+ * The approximate value of eis 2.71828182845905.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base of natural logarithms, expressed as e.
+ *
+ * @oldexample This example shows how Math.E is used to compute
+ * continuously compounded interest for a simple case of 100 percent interest over
+ * a one-year period.
+ *
+ * var principal:Number = 100;
+ * var simpleInterest:Number = 100;
+ * var continuouslyCompoundedInterest:Number = (100 * Math.E) - principal;
+ *
+ * trace ("Beginning principal: $" + principal);
+ * trace ("Simple interest after one year: $" + simpleInterest);
+ * trace ("Continuously compounded interest after one year: $" + continuouslyCompoundedInterest);
+ *
+ * // Output:
+ * Beginning principal: $100
+ * Simple interest after one year: $100
+ * Continuously compounded interest after one year: $171.828182845905
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.e, e
+ */
+ public static const E:Number = 2.71828182845905;
+
+ /**
+ * A mathematical constant for the natural logarithm of 10, expressed as loge10,
+ * with an approximate value of 2.302585092994046.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the natural logarithm of 10, expressed
+ * as loge10, with an approximate value of 2.302585092994046.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ln10, ln10, logarithm
+ */
+ public static const LN10:Number = 2.302585092994046;
+
+ /**
+ * A mathematical constant for the natural logarithm of 2, expressed as loge2,
+ * with an approximate value of 0.6931471805599453.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the natural logarithm of 2, expressed
+ * as loge2, with an approximate value of 0.6931471805599453.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ln2, ln2, natural logarithm
+ */
+ public static const LN2:Number = 0.6931471805599453;
+
+ /**
+ * A mathematical constant for the base-10 logarithm of the constant e (Math.E),
+ * expressed as log10e, with an approximate value of 0.4342944819032518.
+ *
The Math.log() method computes the natural logarithm of a number. Multiply the
+ * result of Math.log() by Math.LOG10E obtain the base-10 logarithm.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base-10 logarithm of the constant
+ * e, expressed as log10e, with an approximate value of 0.4342944819032518.
+ *
+ * @oldexample This example shows how to obtain the base-10 logarithm of a number:
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log10e, log10e, logarithm
+ */
+ public static const LOG10E:Number = 0.4342944819032518;
+
+ /**
+ * A mathematical constant for the base-2 logarithm of the constant e, expressed
+ * as log2e, with an approximate value of 1.442695040888963387.
+ *
+ *
The Math.log method computes the natural logarithm of a number. Multiply the
+ * result of Math.log() by Math.LOG2E obtain the base-2 logarithm.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base-2 logarithm of the constant
+ * e, expressed as log2e, with an approximate value of 1.442695040888963387.
+ *
+ * @oldexample This example shows how to obtain the base-2 logarithm of a number:
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log2e, log2e, logarithm
+ */
+ public static const LOG2E:Number = 1.442695040888963387;
+
+ /**
+ * A mathematical constant for the ratio of the circumference of a circle to its diameter,
+ * expressed as pi, with a value of 3.141592653589793.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the ratio of the circumference of a
+ * circle to its diameter, expressed as pi, with a value of 3.141592653589793.
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi
+ * and the Drawing API.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.pi, pi
+ */
+ public static const PI:Number = 3.141592653589793;
+
+ /**
+ * A mathematical constant for the square root of one-half, with an approximate
+ * value of 0.7071067811865476.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the square root of one-half, with an
+ * approximate value of 0.7071067811865476.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt1_2, sqrt1_2, square root
+ */
+ public static const SQRT1_2:Number = 0.7071067811865476;
+
+ /**
+ * A mathematical constant for the square root of 2, with an approximate
+ * value of 1.4142135623730951.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the square root of 2, with an
+ * approximate value of 1.4142135623730951.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt2, sqrt2, square root
+ */
+ public static const SQRT2:Number = 1.4142135623730951;
+
+
+ /**
+ * Computes and returns an absolute value for the number specified by the
+ * parameter val.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the absolute value of the specified Number.
+ *
+ * @param val The Number whose absolute value is returned.
+ * @return The absolute value of the specified paramater.
+ *
+ * @oldexample The following example shows how Math.abs() returns
+ * the absolute value of a number and does not affect the value of the
+ * val
+ * parameter (called num in this example):
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.abs, abs, absolute
+ */
+ public native static function abs(val:Number):Number;
+
+ /**
+ * Computes and returns the arc cosine of the number specified in the
+ * parameter val, in radians.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the arc cosine, in radians, of the specified
+ * Number.
+ *
+ * @param val A number from -1.0 to 1.0.
+ *
+ * @return The arc cosine of the parameter val.
+ *
+ * @oldexample The following example displays the arc cosine for several values.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.acos, acos, arc cosine
+ */
+ public native static function acos(val:Number):Number;
+
+ /**
+ * Computes and returns the arc sine for the number specified in the
+ * parameter val, in radians.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value, in radians, of the arc sine of the specified
+ * Number parameter.
+ *
+ * @param val A Number from -1.0 to 1.0.
+ *
+ * @return A Number between negative pi divided by 2 and positive pi
+ * divided by 2.
+ *
+ * @oldexample The following example displays the arc sine for several values.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.asin, asin, arc sine
+ */
+ public native static function asin(val:Number):Number;
+
+ /**
+ * Computes and returns the value, in radians, of the angle whose tangent is
+ * specified in the parameter val. The return value is between
+ * negative pi divided by 2 and positive pi divided by 2.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the angle, in radians, whose tangent is specified by
+ * parameter val.
+ *
+ * @param val A Number that represents the tangent of an angle.
+ *
+ * @return A Number between negative pi divided by 2 and positive
+ * pi divided by 2.
+ *
+ * @oldexample The following example displays the angle value for several tangents.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.atan, atan, arc tangent
+ */
+ public native static function atan(val:Number):Number;
+
+ /**
+ * Computes and returns the angle of the point y/x in
+ * radians, when measured counterclockwise from a circle's x axis
+ * (where 0,0 represents the center of the circle). The return value is between
+ * positive pi and negative pi. Note that the first parameter to atan2 is always the y coordinate.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the angle of the point y/x in radians, when measured
+ * counterclockwise from a circle's x axis.
+ *
+ * @param y The y coordinate of the point.
+ * @param x The xcoordinate of the point.
+ *
+ * @return A number.
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#cos()
+ * @see Math#sin()
+ * @see Math#tan()
+ *
+ * @oldexample The following example returns the angle, in radians, of the point specified by the coordinates (0, 10), such that x = 0 and y = 10. Note that the first parameter to atan2 is always the y coordinate.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.atan2, atan2, arc tangent
+ */
+ public native static function atan2(y:Number,x:Number):Number;
+
+ /**
+ * Returns the ceiling of the specified number or expression. The ceiling of a
+ * number is the closest integer that is greater than or equal to the number.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the ceiling of the specified number or expression.
+ *
+ * @param val A number or expression.
+ * @return An integer that is both closest to, and greater than or equal to, parameter
+ * val.
+ *
+ * @see Math#floor()
+ * @see Math#round()
+ *
+ * @oldexample The following code returns a value of 13:
+ *
+ * Math.ceil(12.5);
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ceil, ceil, ceiling
+ */
+ public native static function ceil(val:Number):Number;
+
+ /**
+ * Computes and returns the cosine of the specified angle in radians. To
+ * calculate a radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the cosine of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return A number from -1.0 to 1.0.
+ *
+ * @oldexample The following example displays the cosine for several different angles.
+ *
Note: The cosine of a 90 degree angle is zero, but because of the inherent inaccuracy of decimal
+ * calculations using binary numbers, Flash Player will report a number extremely close to, but not exactly equal to, zero.
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#atan2()
+ * @see Math#sin()
+ * @see Math#tan()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.cos, cos, cosine
+ */
+ public native static function cos(angleRadians:Number):Number;
+
+ /**
+ * Returns the value of the base of the natural logarithm (e), to the
+ * power of the exponent specified in the parameter x. The
+ * constant Math.E can provide the value of e.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value of the base of the natural logarithm
+ * (e), to the power of the exponent specified in the parameter val.
+ *
+ * @param val The exponent; a number or expression.
+ * @return e to the power of parameter val.
+ *
+ * @see Math#E
+ * @helpid
+ * @refpath
+ * @keyword math.exp, exp, exponent
+ */
+ public native static function exp(val:Number):Number;
+
+ /**
+ * Returns the floor of the number or expression specified in the parameter
+ * val. The floor is the closest integer that is less than or equal
+ * to the specified number or expression.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the floor of the number or expression specified in the
+ * parameter val.
+ *
+ * @param val A number or expression.
+ * @return The integer that is both closest to, and less than or equal to, parameter
+ * val.
+ *
+ * @oldexample The following code returns a value of 12:
+ *
+ * Math.floor(12.5);
+ *
+ * The following code returns a value of -7:
+ * Math.floor(-6.5);
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.floor, floor
+ */
+ public native static function floor(val:Number):Number;
+
+ /**
+ * Returns the natural logarithm of parameter val.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the natural logarithm of parameter val.
+ *
+ * @param val A number or expression with a value greater than 0.
+ * @return The natural logarithm of parameter val.
+ *
+ * @oldexample The following example displays the logarithm for three numerical values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log, log, logarithm
+ */
+ public native static function log(val:Number):Number;
+
+ /**
+ * Evaluates val1 and val2 (or more values) and returns the largest value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Evaluates parameters val1 and val2 and
+ * returns the larger value.
+ *
+ * @param val1 A number or expression.
+ * @param val2 A number or expression.
+ * @param ... A number or expression. Math.max() can accept multiple arguments.
+ * @return The largest of the parameters val1 and val2 (or more values).
+ *
+ * @oldexample The following example displays Thu Dec 30 00:00:00 GMT-0700 2004, which is the larger of the evaluated expressions.
+ *
+ * var date1:Date = new Date(2004, 11, 25);
+ * var date2:Date = new Date(2004, 11, 30);
+ * var maxDate:Number = Math.max(date1.getTime(), date2.getTime());
+ * trace(new Date(maxDate).toString());
+ *
+ *
+ * @see Math#min()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.max, max, maximum
+ */
+ public native static function max(val1:Number,val2:Number, ...rest):Number;
+
+ /**
+ * Evaluates val1 and val2 (or more values) and returns the smallest value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Evaluates parameters val1 and val2 and returns the smaller value.
+ *
+ * @param val1 A number or expression.
+ * @param val2 A number or expression.
+ * @param ... A number or expression. Math.min() can accept multiple arguments.
+ * @return The smallest of the parameters val1 and val2 (or more values).
+ *
+ * @oldexample The following example displays Sat Dec 25 00:00:00 GMT-0700 2004, which is the smaller of the evaluated expressions.
+ *
+ * var date1:Date = new Date(2004, 11, 25);
+ * var date2:Date = new Date(2004, 11, 30);
+ * var minDate:Number = Math.min(date1.getTime(), date2.getTime());
+ * trace(new Date(minDate).toString());
+ *
+ *
+ * @see Math#max()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.min, min, minimum
+ */
+ public native static function min(val1:Number,val2:Number, ... rest):Number;
+
+ /**
+ * Computes and returns val1 to the power of val2.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns val1 to the power of val2.
+ *
+ * @param val1 A number to be raised by the power of parameter val2.
+ * @param val2 A number specifying the power the parameter val2 is raised by.
+ * @return The value of parameter val1 raised to the power of parameter
+ * val2.
+ *
+ * @oldexample The following example uses Math.pow and Math.sqrt to calculate the length of a line.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.pow, pow, power
+ */
+ public native static function pow(val1:Number,val2:Number):Number;
+
+ /**
+ * Returns a pseudo-random number n, where 0 <= n < 1. The number returned is calculated in an undisclosed manner, and "pseudo-random" because the calculation inevitably contains some element of "non-randomness".
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns a pseudo-random number n, where 0 <= n < 1.
+ *
+ * @return A pseudo-random number.
+ *
+ * @oldexample The following example outputs 100 random integers between 4 and 11
+ * (inclusively):
+ *
+ * function randRange(min:Number, max:Number):Number {
+ * var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
+ * return randomNum;
+ * }
+ * for (var i = 0; i < 100; i++) {
+ * var n:Number = randRange(4, 11)
+ * trace(n);
+ * }
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.random, random
+ */
+ public native static function random():Number;
+
+ /**
+ * Rounds the value of the parameter val up or down to the nearest
+ * integer and returns the value. If parameter val is equidistant
+ * from its two nearest integers (that is, the number ends in .5), the value
+ * is rounded up to the next higher integer.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value of parameter val rounded up or down to the
+ * nearest integer.
+ *
+ * @param val The number to round.
+ * @return Parameter val rounded to the nearest whole number.
+ *
+ * @oldexample The following example returns a random number between two specified integers.
+ *
+ * function randRange(min:Number, max:Number):Number {
+ * var randomNum:Number = Math.round(Math.random() * (max - min + 1) + (min - .5));
+ * return randomNum;
+ * }
+ * for (var i = 0; i<25; i++) {
+ * trace(randRange(4, 11));
+ * }
+ *
+ *
+ * @see Math#ceil()
+ * @see Math#floor()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.round, round
+ */
+ public native static function round(val:Number):Number;
+
+ /**
+ * Computes and returns the sine of the specified angle in radians. To
+ * calculate a radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the sine of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return A number; the sine of the specified angle (between -1.0 and 1.0).
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi, the sine of an angle, and the Drawing API.
+ *
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#atan2()
+ * @see Math#cos()
+ * @see Math#tan()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sin, sin, sine
+ */
+ public native static function sin(angleRadians:Number):Number;
+
+ /**
+ * Computes and returns the square root of the specified number.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the square root of the specified number.
+ *
+ * @param val A number or expression greater than or equal to 0.
+ * @return A number if parameter val is greater than or equal to zero; NaN (not a number) otherwise.
+ *
+ * @oldexample The following example uses Math.pow and Math.sqrt to calculate the length of a line.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt, sqrt, square root
+ */
+ public native static function sqrt(val:Number):Number;
+
+ /**
+ * Computes and returns the tangent of the specified angle. To calculate a
+ * radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the tangent of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return The tangent of parameter angleRadians.
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi, the tangent of an angle, and the Drawing API.
+ *
On a desktop machine, memory allocation failures are rare unless an allocation
+ * request is extremely large; a 32-bit Windows program can access only 2GB of
+ * address space, for example, so a request for 10 billion bytes is impossible.
+ *
+ *
By default, Flash Player does not impose a limit on how much memory an
+ * ActionScript program may allocate.
+ *
+ * @includeExample examples\MemoryErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class MemoryError extends Error {
+
+ /**
+ * Creates a new MemoryError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function MemoryError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//
+// Namespace
+//
+
+// Based on the ECMA E4X spec, 1st Edition
+
+/**
+*
+* The Namespace class contains methods and properties for defining and working with namespaces.
+* There are three use cases for using namespaces:
+*
+*
+*
Namespaces of XML objects Namespaces associate a namespace prefix with a Uniform Resource Identifier (URI)
+* that identifies the namespace. The prefix is a string used to reference the namespace within an
+* XML object. If the prefix is undefined, when the XML is converted to a string, a prefix is
+* automatically generated.
+*
+*
+*
Namespace to differentiate methods Namespaces can differentiate methods with the same name to perform different tasks.
+* If two methods have the same name but separate namespaces, they can perform different tasks.
+*
+*
+*
Namespaces for access control
+* Namespaces can be used to control access to a group of
+* properties and methods in a class. If you place the
+* group of properties and methods into a private
+* namespace, those properties and methods are
+* unreachable by any code that does not have access to
+* that namespace. You can grant access to the group of
+* properties and methods by passing the namespace to
+* other classes, methods or functions.
+*
+*
+*
+*
This class (along with the XML, XMLList, and QName classes) implements
+* powerful XML-handling standards defined in ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2).
+*
+* @includeExample examples\NamespaceExample.1.as -noswf
+* @includeExample examples\NamespaceExample.2.as -noswf
+*
+* @tiptext The Namespace class contains methods and properties for defining and
+* working with namespaces of XML objects.
+*
+* @see XML
+* @see XMLList
+* @see QName
+* @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2)
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid
+* @refpath
+* @keyword Namespace
+*/
+public final class Namespace
+{
+
+ /**
+ * Creates a Namespace object given the uriValue parameter.
+ * The values assigned to the uri and prefix properties
+ * of the new Namespace object depend on the type of value passed for the uriValue parameter:
+ *
+ *
If no argument is passed, the prefix and uri properties are set to the empty string.
+ *
If the argument is a Namespace object, a copy of the object is created.
+ *
If the argument is a QName object, the uri property is set to the uri property of the QName object.
+ *
Otherwise, the argument is converted into a string and assigned to the uri property.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @tiptext Creates a Namespace object, given the uriValue.
+ *
+ * @param uriValue The Uniform Resource Identifier (URI) of the namespace.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function Namespace(uriValue:*);
+
+ /**
+ * The default number of arguments for the constructor. You can specify prefix or uri or both arguments. For details, see the Namespace() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Namespace()
+ */
+ public static const length:int = 2;
+
+ /**
+ * Creates a Namespace object, given the prefixValue and uriValue parameters.
+ * This constructor requires both parameters.
+ *
The value of the prefixValue parameter is assigned to the prefix
+ * property in the following manner:
+ *
+ *
If undefined is passed, prefix is set to undefined.
+ *
If the argument is a valid XML name, as determined by the isXMLName() function, it is converted to a string and assigned to the prefix property.
+ *
If the argument is not a valid XML name, the prefix property is set to undefined.
+ *
+ *
+ *
The value of the uriValue parameter is assigned to the uri
+ * property in the following manner:
+ *
+ *
If a QName object is passed for the uriValue parameter, the uri property is set to the value of the uri property of the QName object.
+ *
Otherwise, the uriValue parameter is converted to a string and assigned to the uri property.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @tiptext Creates a Namespace object, given the prefixValue and uriValue.
+ *
+ * @param prefixValue The prefix to use for the namespace.
+ *
+ * @param uriValue The Uniform Resource Identifier (URI) of the namespace.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function Namespace(prefixValue:*, uriValue:*);
+
+
+ /**
+ * Equivalent to the Namespace.uri property.
+ *
+ * @tiptext Equivalent to the Namespace.uri property.
+ *
+ * @return The Uniform Resource Identifier (URI) of the namespace, as a string.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.toString, toString
+ **/
+ public native function toString():String;
+
+ /**
+ * The prefix of the namespace.
+ *
+ * @tiptext The prefix of the namespace.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.prefix, prefix
+ **/
+ public native function get prefix():String;
+ public native function set prefix(value:String):void;
+
+ /**
+ * The Uniform Resource Identifier (URI) of the namespace.
+ *
+ * @tiptext The Uniform Resource Identifier (URI) of the namespace.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.uri, uri
+ **/
+ public native function get uri():String;
+ public native function set uri(value:String):void;
+
+}
+
+}
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// Number object
+//****************************************************************************
+
+
+/**
+ * A data type representing an IEEE-754 double-precision floating-point number. You can manipulate primitive numeric
+ * values by using the methods and properties associated with the Number class. This class is identical to the
+ * JavaScript Number class.
+ *
The properties of the Number class are static, which means you do not need an object to use them, so you
+ * do not need to use the constructor.
+ *
The Number data type adheres to the double-precision IEEE-754 standard.
+ *
The Number data type is useful when you need to use floating-point values.
+ * Flash Player handles int and uint more efficiently than Number, but Number is
+ * useful in situations where the range of values required exceeds the valid range
+ * of the int and uint data types. The Number class can be used to
+ * represent integer values well beyond the valid range of the int and uint data types.
+ * The Number data type can use up to 53 bits to represent integer values, compared to
+ * the 32 bits available to int and uint. The default value of a variable typed as Number is NaN (Not a Number).
+ *
+ * @includeExample examples\NumberExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The Number class is a simple wrapper object for the Number
+ * data type.
+ *
+ * @see int.html int
+ * @see uint.html uint
+ * @helpid
+ * @refpath
+ * @keyword number object, number, built-in class
+ */
+public final class Number
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Number() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Number()
+ */
+ public static const length:int = 1;
+
+ /**
+ * The largest representable number (double-precision IEEE-754). This number is
+ * approximately 1.79e+308.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The largest representable number (double-precision IEEE-754).
+ *
+ * @oldexample The following ActionScript displayswrites the largest and smallest representable numbers to the Output panelto the log file.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.max_value, max_value, max value
+ */
+ public static const MAX_VALUE:Number;
+
+ /**
+ * The smallest representable non-negative, non-zero, number (double-precision IEEE-754). This number is
+ * approximately 5e-324. The smallest representable number overall is actually -Number.MAX_VALUE.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The smallest representable number (double-precision IEEE-754).
+ *
+ * @oldexample The following ActionScript displayswrites the largest and smallest representable numbers to the Output panel to the log file.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:Number;
+
+ /**
+ * The IEEE-754 value representing Not a Number (NaN).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The IEEE-754 value representing Not a Number (NaN).
+ *
+ * @see package.html#isNaN() isNaN()
+ * @helpid
+ * @refpath
+ * @keyword number, number.nan, nan, not a number
+ */
+ public static const NaN:Number;
+
+ /**
+ * Specifies the IEEE-754 value representing negative infinity. The value of this property
+ * is the same as that of the constant -Infinity.
+ *
+ * Negative infinity is a special numeric value that is returned when a mathematical
+ * operation or function returns a negative value larger than can be
+ * represented.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the IEEE-754 value representing negative infinity.
+ *
+ * @oldexample This example compares the result of dividing the following values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.negative_infinity, negative_infinity, negative infinity, infinity
+ */
+ public static const NEGATIVE_INFINITY:Number;
+
+ /**
+ * Specifies the IEEE-754 value representing positive infinity. The value of this property
+ * is the same as that of the constant Infinity.
+ *
+ * Positive infinity is a special numeric value that is returned when a mathematical
+ * operation or function returns a value larger than can be represented.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the IEEE-754 value representing positive infinity.
+ *
+ * @oldexample This example compares the result of dividing the following values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.positive_infinity, positive_infinity, positive infinity, infinity
+ */
+ public static const POSITIVE_INFINITY:Number;
+
+ /**
+ * Creates a Number with the specified value. This constructor has the same effect
+ * as the Number() public native function that converts an object of a different type
+ * to a primitive numeric value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Creates a Number with the specified value.
+ *
+ * @param num The numeric value of the Number instance being created or a value
+ * to be converted to a Number. The default value is 0 if num is
+ * not specified. Using the constructor without specifying a num parameter is not
+ * the same as declaring a variable of type Number with no value assigned (such as var myNumber:Number), which
+ * defaults to NaN. A number with no value assigned is undefined and the equivalent of new Number(undefined).
+ *
+ * @oldexample The following code constructs new Number objects:
+ *
+ * var n1:Number = new Number(3.4);
+ * var n2:Number = new Number(-10);
+ *
+ *
+ *
+ * @see #toString() Number.toString()
+ * @see #valueOf() Number.valueOf()
+ * @helpid
+ * @refpath
+ * @keyword new number, constructor
+ */
+ public native function Number(num:Object);
+
+
+/**
+ */
+private static native function _convert(n:Number, precision:int, mode:int):String
+
+
+/**
+ * Returns the string representation of the specified Number object (myNumber).
+ * If the value of the Number object is a decimal number without a leading zero (such as .4),
+ * Number.toString() adds a leading zero (0.4).
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the string representation of this Number using the specified
+ * radix parameter as the numeric base.
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the number-to-string
+ * conversion. If you do not specify the radix parameter, the default value
+ * is 10.
+ *
+ * @return The numeric representation of this Number as a string.
+ *
+ * @oldexample The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9:
+ *
+ * The following example results in a hexadecimal value.
+ *
+ * var r:Number = new Number(250);
+ * var g:Number = new Number(128);
+ * var b:Number = new Number(114);
+ * var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
+ * trace(rgb);
+ * // output: rgb:0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.tostring, tostring
+ */
+ public native function toString(radix:Number = 10):String;
+
+/**
+ * Returns the primitive value type of the specified Number object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the primitive value type of the specified Number object.
+ *
+ * @return The primitive type value of this Number.
+ *
+ * @oldexample The following example results in the primative value of the numSocks object.
+ *
+ * var numSocks = new Number(2);
+ * trace(numSocks.valueOf()); // output: 2
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():Number;
+
+ /**
+ * Returns a string representation of the number in fixed-point notation.
+ * Fixed-point notation means that the string will contain a specific number of digits
+ * after the decimal point, as specified in the fractionDigits parameter.
+ * The valid range for the fractionDigits parameter is from 0 to 20.
+ * Specifying a value outside this range throws an exception.
+ *
+ * @param fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places.
+ * @throws RangeError Throws an exception if the fractionDigits argument is outside the range 0 to 20.
+ * @includeExample examples\Number.toFixed.1.as -noswf
+ * @includeExample examples\Number.toFixed.2.as -noswf
+ */
+ public native function toFixed(fractionDigits:uint):String;
+
+ /**
+ * Returns a string representation of the number in exponential notation. The string contains
+ * one digit before the decimal point and up to 20 digits after the decimal point, as
+ * specified by the fractionDigits parameter.
+ * @param fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places.
+ * @throws RangeError Throws an exception if the fractionDigits argument is outside the range 0 to 20.
+ * @includeExample examples\Number.toExponential.1.as -noswf
+ */
+ public native function toExponential(fractionDigits:uint):String;
+
+ /**
+ * Returns a string representation of the number either in exponential notation or in
+ * fixed-point notation. The string will contain the number of digits specified in the
+ * precision parameter.
+ * @param precision An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string.
+ * @throws RangeError Throws an exception if the precision argument is outside the range 1 to 21.
+ * @includeExample examples\Number.toPrecision.1.as -noswf
+ * @includeExample examples\Number.toPrecision.2.as -noswf
+ */
+ public native function toPrecision(precision:uint):String;
+}
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Object object
+//****************************************************************************
+
+
+/**
+ * The Object class is at the root of the ActionScript class hierarchy. Objects are created by constructors using the
+ * new operator syntax, and can have properties assigned to them dynamically. Objects can also be created by
+ * assigning an object literal, as in:
+ * var obj:Object = {a:"foo", b:"bar"}
+ *
+ *
All classes that don't declare an explicit base class extend the built-in Object class.
+ *
You can use the Object class to create associative arrays. At its core, an associative array is an instance of the Object class, and each key-value pair is represented by a property and its value. Another reason to declare an associative array using the Object data type is that you can then use an object literal to populate your associative array (but only at the time you declare it). The following example creates an associative array using an object literal, accesses items using both the dot operator and the array access operator, and then adds a new key-value pair by creating a new property:
ActionScript 3.0 has two types of inheritance: "class inheritance" and "prototype inheritance":
+ *
Class inheritance - the primary inheritance mechanism, supports inheritance of fixed properties. A fixed property is a variable, constant or method declared as part of a class definition. Every class definition is now represented by a special class object that stores information about the class.
+ *
Prototype inheritance - the only inheritance mechanism in previous versions of ActionScript, serves as an alternate form of inheritance in ActionScript 3.0. Each class has an associated prototype object, and the properties of the prototype object are shared by all instances of the class. When a class instance is created, the new instance has a reference to its class's prototype object that serves as a link between an instance and its class's prototype object. At runtime, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate on up the hierarchy until Flash Player finds the property.
+ *
Both class inheritance and prototype inheritance can exist simultaneously, such as:
+ *
+ * class A {
+ * var x = 1
+ * prototype.px = 2
+ * }
+ * dynamic class B extends A {
+ * var y = 3
+ * prototype.py = 4
+ * }
+ *
+ * var b = new B()
+ * b.x // 1 via class inheritance
+ * b.px // 2 via prototype inheritance from A.prototype
+ * b.y // 3
+ * b.py // 4 via prototype inheritance from B.prototype
+ *
+ * B.prototype.px = 5
+ * b.px // now 5 because B.prototype hides A.prototype
+ *
+ * b.px = 6
+ * b.px // now 6 because b hides B.prototype
+ *
+ *
Using functions instead of classes, you can construct custom prototype inheritance trees. With classes, the prototype inheritance tree mirrors the class inheritance tree. However, since the prototype objects are dynamic, you can add and delete prototype-based properties at runtime.
+ *
+ * @playerversion Flash 9
+ *
+ * @includeExample examples\ObjectExample.as -noswf
+ *
+ * @helpid x20982
+ * @refpath Objects/Core/Object
+ * @keyword object, object object, built-in class
+ *
+ * @see #prototype
+ */
+public dynamic class Object
+{
+ /**
+ * A reference to the prototype object of a class or function object. The prototype property
+ * is automatically created and attached to any class or function object that you create. This property is
+ * static in that it is specific to the class or function that you create. For example, if you create a
+ * class, the value of the prototype property is shared by all instances of the class and is
+ * accessible only as a class property. Instances of your class cannot directly access
+ * the prototype property.
+ *
A class's prototype object is a special instance of that class that provides a mechanism for sharing state across all instances of a class. At runtime, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate on up the hierarchy until Flash Player finds the property.
+ *
Note: In ActionScript 3.0, prototype inheritance is not the primary mechanism for inheritance. Class inheritance, which drives the inheritance of fixed properties in class definitions, is the primary inheritance mechanism. For more information on class inheritance. Need XREF to Prog AS3
+ *
+ * @maelexample The following example creates a class named Shape and a subclass of Shape named Circle.
+ *
+ * // Shape class defined in external file named Shape.as
+ * class Shape {
+ * function Shape() {}
+ * }
+ *
+ * // Circle class defined in external file named Circle.as
+ * class Circle extends Shape{
+ * function Circle() {}
+ * }
+ *
+ * The Circle class can be used to create two instances of Circle:
+ *
+ * var oneCircle:Circle = new Circle();
+ * var twoCircle:Circle = new Circle();
+ *
+ * The following trace statement shows that the prototype property of the Circle class points to its superclass Shape. The identifier Shape refers to the constructor function of the Shape class.
+ *
+ * trace(Circle.prototype.constructor == Shape); // Output: true
+ *
+ * The following trace statement shows how you can use the prototype property and the __proto__ property together to move two levels up the inheritance hierarchy (or prototype chain). The Circle.prototype.__proto__ property contains a reference to the superclass of the Shape class.
+ *
+ * trace(Circle.prototype.__proto__ == Shape.prototype); // Output: true
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public static var prototype:Object;
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Object() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Object()
+ */
+ public static const length:int = 1;
+
+ /**
+ * A reference to the class object or constructor function for a given object instance.
+ * If an object is an instance of a class, the constructor
+ * property holds a reference to the class object.
+ * If an object is created with a constructor function, the constructor
+ * property holds a reference to the constructor function.
+ * Do not confuse a constructor function with a constructor method of a class.
+ * A constructor function is a Function object used to create objects, and is an
+ * alternative to using the class keyword for defining classes.
+ *
+ *
If you use the class keyword to define a class, the class's prototype object
+ * is assigned a property named constructor that holds a reference to the class object.
+ * An instance of the class inherits this property from the prototype object. For example,
+ * the following code creates a new class, A, and a class instance named myA:
+ *
+ * dynamic class A {}
+ * trace(A.prototype.constructor); // [class A]
+ * trace(A.prototype.constructor == A); // true
+ * var myA:A = new A();
+ * trace(myA.constructor == A); // true
+ *
+ *
Advanced users may choose to use the function keyword instead of the class
+ * keyword to define a Function object that can be used as a template for the creation of objects. Such a
+ * function is called a constructor function because you can use it in conjunction with the new
+ * operator to create new objects.
+ * If you use the function keyword to create a constructor function, its prototype object is assigned
+ * a property named constructor that holds a reference to the constructor function.
+ * If you then use the constructor function to create an new object, the object inherits the
+ * constructor property from the constructor function's prototype object. For example,
+ * the following code creates a new constructor function, f, and an object named myF:
+ *
+ * function f() {}
+ * trace(f.prototype.constructor); // function Function() {}
+ * trace(f.prototype.constructor == f); // true
+ * var myF = new f();
+ * trace(myF.constructor == f); // true
+ *
+ *
Note: The constructor property is writable, which means that user code can change
+ * its value with an assignment statement. Changing the value of the constructor property is not
+ * recommended, but if you write code that depends on the value of the constructor property, you should
+ * ensure that the value is not reset. The value can be changed only when the property is accessed through the prototype
+ * object (for example, className.prototype.constructor).
+ * @playerversion Flash 9
+ *
+ * @see Class
+ * @see Function
+ * @see #prototype
+ * @helpid
+ * @refpath
+ * @keyword Object, Object.constructor, constructor
+ */
+ var constructor:Object;
+
+
+ /**
+ * Creates an Object object and stores a reference to the object's constructor method in the object's constructor property.
+ *
+ * @version Flash Player 8.0
+ *
+ */
+ public native function Object();
+
+
+ /**
+ * Indicates whether an object has a specified property defined. This method returns true if the target object has
+ * a property that matches the string specified by the name parameter, and false otherwise.
+ * The following types of properties cause this method to return true for objects that are instances of a class (as opposed to class objects):
+ *
+ *
fixed instance properties—variables, constants, or methods defined by the object's class that are not static;
+ *
inherited fixed instance properties—variables, constants, or methods inherited by the object's class;
+ *
dynamic properties—properties added to an object after it is instantiated (outside of its class definition). To add dynamic properties, the object's defining class must be declared with the dynamic keyword.
+ *
+ *
The following types of properties cause this method to return false for objects that are instances of a class:
+ *
+ *
static properties—variables, constants, or methods defined with the static keyword in an object's defining class or any of its superclasses;
+ *
prototype properties—properties defined on a prototype object that is part of the object's prototype chain. In ActionScript 3.0, the prototype chain is not used for class inheritance, but still exists as an alternative form of inheritance. For example, an instance of the Array class can access the valueOf() method because it exists on Object.prototype, which is part of the prototype chain for the Array class. Although you can use valueOf() on an instance of Array, the return value of hasOwnProperty("valueOf") for that instance is false.
+ *
+ *
+ *
ActionScript 3.0 also has class objects, which are concrete representations of class definitions.
+ * When called on class objects, hasOwnProperty() returns true only if a property
+ * is a static property defined on that class object. For example, if you create a subclass of Array named
+ * CustomArray, and define a static property in CustomArray named foo, a call to
+ * CustomArray.hasOwnProperty("foo") returns true.
+ * For the static property DESCENDING defined in the Array class, however, a call to
+ * CustomArray.hasOwnProperty("DESCENDING") returns false.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function hasOwnProperty():Boolean instead of using an override of the base class.
+ *
+ * @param name The property of the object.
+ * @return If the target object has the property specified by the name
+ * parameter this value is true, otherwise false.
+ *
+ * @category Method
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function hasOwnProperty(name:String):Boolean;
+
+ /**
+ * Indicates whether the specified property exists and is enumerable. If true, then the property exists and
+ * can be enumerated in a for..in loop. The property must exist on the target object because this method does not
+ * check the target object's prototype chain.
+ *
+ *
Properties that you create are enumerable, but built-in properties are generally not enumerable.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function propertyIsEnumerable():Boolean instead of using an override of the base class.
+ *
+ * @param name The property of the object.
+ * @return If the property specified by the name parameter is enumerable this value is true, otherwise false.
+ *
+ * @maelexample The following example creates a generic object, adds a property to the object, then checks whether the object is enumerable. By way of contrast, the example also shows that a built-in property, the Array.length property, is not enumerable.
+ *
+ * var myObj:Object = new Object();
+ * myObj.prop1 = "hello";
+ * trace(myObj.propertyIsEnumerable("prop1")); // Output: true
+ *
+ * var myArray = new Array();
+ * trace(myArray.propertyIsEnumerable("length")); // Output: false
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function propertyIsEnumerable(name:String):Boolean;
+
+ /**
+ * Indicates whether an instance of the Object class is in the prototype chain of the object specified
+ * as the parameter. This method returns true if the object is in the prototype chain of the
+ * object specified by the theClass parameter. The method returns false
+ * if the target object is absent from the prototype chain of the theClass object,
+ * and also if the theClass parameter is not an object.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function isPrototypeOf():Boolean instead of using an override of the base class.
+ *
+ * @param theClass The class to which the specified object may refer.
+ *
+ * @return If the object is in the prototype chain of the object
+ * specified by the theClass parameter this value is true, otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function isPrototypeOf(theClass:Object):Boolean;
+
+ /**
+ * Sets the availability of a dynamic property for loop operations. The property must exist on the target object because this method does not check the target object's prototype chain.
+ * @param name The property of the object.
+ * @param isEnum If set to false, the dynamic property will not show up in for..in loops, and the method propertyIsEnumerable() will return false.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #propertyIsEnumerable()
+ */
+ public native function setPropertyIsEnumerable(name:String, isEnum:Boolean=true):void;
+
+ /**
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Returns the string representation of the specified object.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function toString():String instead of using an override of the base class.
+ *
+ * @playerversion Flash 9
+ *
+ * @return A string representation of the object.
+ *
+ * @oldexample This example shows the return value for toString() on a generic object:
+ *
+ * var myObject:Object = new Object();
+ * trace(myObject.toString()); // output: [object Object]
+ *
+ *
This method can be overridden to return a more meaningful value. The following examples show that this method has been overridden for the built-in classes Date, Array, and Number:
+ *
+ * // Date.toString() returns the current date and time
+ * var myDate:Date = new Date();
+ * trace(myDate.toString()); // output: [current date and time]
+ *
+ * // Array.toString() returns the array contents as a comma-delimited string
+ * var myArray:Array = new Array("one", "two");
+ * trace(myArray.toString()); // output: one,two
+ *
+ * // Number.toString() returns the number value as a string
+ * // Because trace() won't tell us whether the value is a string or number
+ * // we will also use typeof() to test whether toString() works.
+ * var myNumber:Number = 5;
+ * trace(typeof (myNumber)); // output: number
+ * trace(myNumber.toString()); // output: 5
+ * trace(typeof (myNumber.toString())); // output: string
+ *
+ *
The following example shows how to override toString() in a class. First create a text file named Vehicle.as that contains only the Vehicle class definition and place it into your Classes folder inside your Configuration folder.
+ *
+ * // contents of Vehicle.as
+ * class Vehicle {
+ * var numDoors:Number;
+ * var color:String;
+ * function Vehicle(param_numDoors:Number, param_color:String) {
+ * this.numDoors = param_numDoors;
+ * this.color = param_color;
+ * }
+ * function toString():String {
+ * var doors:String = "door";
+ * if (this.numDoors > 1) {
+ * doors += "s";
+ * }
+ * return ("A vehicle that is " + this.color + " and has " + this.numDoors + " " + doors);
+ * }
+ * }
+ *
+ * // code to place into a FLA file
+ * var myVehicle:Vehicle = new Vehicle(2, "red");
+ * trace(myVehicle.toString());
+ * // output: A vehicle that is red and has 2 doors
+ *
+ * // for comparison purposes, this is a call to valueOf()
+ * // there is no primitive value of myVehicle, so the object is returned
+ * // giving the same output as toString().
+ * trace(myVehicle.valueOf());
+ * // output: A vehicle that is red and has 2 doors
+ *
+ *
+ *
+ * @helpid x20983
+ * @refpath Objects/Core/Object/Methods/toString
+ * @keyword object, object.tostring, tostring
+ */
+ public native function toString():String;
+
+ /**
+ * Returns the primitive value of the specified object. If this object
+ * does not have a primitive value, the object itself is returned.
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function valueOf():Object instead of using an override of the base class.
+ *
+ * @playerversion Flash 9
+ *
+ * @return The primitive value of this object or the object itself.
+ *
+ * @oldexample The following example shows the return value of valueOf() for a generic object (which does not have a primitive value) and compares it to the return value of toString():
+ *
+ * // Create a generic object
+ * var myObject:Object = new Object();
+ * trace(myObject.valueOf()); // output: [object Object]
+ * trace(myObject.toString()); // output: [object Object]
+ *
+ *
The following examples show the return values for the built-in classes Date and Array, and compares them to the return values of Object.toString():
+ *
+ * // Create a new Date object set to February 1, 2004, 8:15 AM
+ * // The toString() method returns the current time in human-readable form
+ * // The valueOf() method returns the primitive value in milliseconds
+ * var myDate:Date = new Date(2004,01,01,8,15);
+ * trace(myDate.toString()); // output: Sun Feb 1 08:15:00 GMT-0800 2004
+ * trace(myDate.valueOf()); // output: 1075652100000
+ *
+ * // Create a new Array object containing two simple elements
+ * // In this case both toString() and valueOf() return the same value: one,two
+ * var myArray:Array = new Array("one", "two");
+ * trace(myArray.toString()); // output: one,two
+ * trace(myArray.valueOf()); // output: one,two
+ *
+ *
+ *
See the example for Object.toString() for an example of the return value
+ * of Object.valueOf() for a class that overrides toString().
+ *
+ * @see Object#toString()
+ *
+ * @helpid x20984
+ * @refpath Objects/Core/Object/Methods/valueOf
+ * @keyword object, object.valueof, valueof
+ */
+ public native function valueOf():Object;
+}
+
+}
+package {
+//
+// QName
+//
+
+// Based on the ECMA E4X spec, 1st Edition
+
+/**
+*
+* QName objects represent qualified names of XML elements and attributes. Each
+* QName object has a local name and a namespace Uniform Resource Identifier (URI).
+* When the value of the namespace URI is null, the QName object matches any namespace.
+* Use the QName constructor to create a new QName object that is either a copy of another QName
+* object or a new QName object with a uri from a Namespace object and a
+* localName from a QName object.
+*
+*
+*
Methods specific to E4X can use QName objects interchangeably with strings.
+* E4X methods are in the QName, Namespace, XML, and XMLList classes.
+* These E4X methods, which take a string, can also take a QName object.
+* This interchangeability is how namespace support works with, for example,
+* the XML.child() method.
+*
+*
The QName class (along with the XML, XMLList, and Namespace classes) implements
+* powerful XML-handling standards defined in ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2).
+*
+*
A qualified identifier evaluates to a QName object. If the QName object of an XML element is
+* specified without identifying a namespace, the uri
+* property of the associated QName object is set to the global default namespace. If the QName object of an XML
+* attribute is specified without identifying a namespace, the uri property is set to
+* an empty string.
+*
+* @includeExample examples\QNameExample.as -noswf
+*
+* @see XML
+* @see XMLList
+* @see Namespace
+* @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2)
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid
+* @refpath
+* @keyword QName
+*/
+public final class QName
+{
+
+ /**
+ * Creates a QName object with a uri from a Namespace object and a localName from a QName object.
+ * If either parameter is not the expected data type, the parameter is converted to a string and
+ * assigned to the corresponding property of the new QName object.
+ * For example, if both parameters are strings, a new QName object is returned with a uri property set
+ * to the first parameter and a localName property set to the second parameter.
+ * In other words, the following permutations, along with many others, are valid forms of the constructor:
+
If the parameter passed as the uri parameter is the null value,
+ * the uri property of the new QName property is set to the null value.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @param uri A Namespace object from which to copy the uri value. A parameter of any other type is converted to a string.
+ * @param localName A QName object from which to copy the localName value. A parameter of any other type is converted to a string.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName
+ **/
+ public native function QName(uri:Namespace, localName:String);
+
+ // Note [M.Shepherd 10/30/06] - this file "global.as" is created by a perl script that runs on the original files
+ // found in flashfarm perforce at //depot/main/player/FlashPlayer/avmglue/ASDocs/AS3/system_classes/*
+ // According to Dave Jacowitz
+ // "The 'system_classes' are duplicate ASDoc-only files that are not actually used
+ // in the Flash Player builds. They are for doc purposes only. The real Flash Player equivalents are in
+ // //depot/main/player/FlashPlayer/avmplus/core. The system_classes files are owned by the doc team,
+ // and we make an effort to keep them in relative sync with the real 'core' files.
+ // So I guess that from time to time, the FlexBuilder team needs to run the perl script, (which can be
+ // found somewhere in zorn.codemodel) and check in a new copy of global.as.
+ //
+ // Anyway, system_classes/QName.as contains several versions of the constructor, because this is
+ // what they want for the ASDocs. Flexbuilder, however, only recognizes one constructor, because
+ // that is all that is legal in ActionScript 3. So I've edited this file (global.as) to make the
+ // first constructor in this class be the one that we want to code hint.
+ //
+ // If you ever update global.as with a new version, make sure you preserve this change.
+
+ public native function QName(uri:Namespace, localName:QName);
+
+ /**
+ * Creates a QName object that is a copy of another QName object. If the parameter passed
+ * to the constructor is a QName object, a copy of the QName object is created. If the parameter
+ * is not a QName object, the parameter is converted to a string and assigned to the
+ * localName property of the new QName instance.
+ * If the parameter is undefined or unspecified, a new QName object
+ * is created with the localName property set to the empty string.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ *
+ * @param qname The QName object to be copied. Objects of any other type are
+ * converted to a string that is assigned to the localName property
+ * of the new QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function QName(qname:QName);
+
+
+ /**
+ * Returns a string composed of the URI, and the local name for the
+ * QName object, separated by "::".
+ *
+ *
The format depends on the uri property of the QName object:
+ * If uri == ""
+ * toString returns localName
+ * else if uri == null
+ * toString returns ~~::localName
+ * else
+ * toString returns uri::localName
+ *
+ *
+ * @return The qualified name, as a string.
+ *
+ * @oldexample
+ *
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.toString, toString
+ **/
+ public native function toString():String;
+
+ /**
+ * The local name of the QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.localName, localName
+ **/
+ public native function get localName():String;
+
+ /**
+ * The Uniform Resource Identifier (URI) of the QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.uri, uri
+ **/
+ public native function get uri():String;
+
+}
+}
+package {
+
+/**
+ * A RangeError exception is thrown when a numeric value is outside the acceptable range. When working with Arrays,
+ * referring to an index position of an array item that does not exist will throw a RangeError exception. Number.toExponential(),
+ * Number.toPrecision(), and Number.toFixed() will throw a RangeError exception in cases
+ * where the arguments are outside the acceptable range of numbers. You can extend Number.toExponential(),
+ * Number.toPrecision(), and Number.toFixed() to avoid throwing a RangeError.
+ * In addition, this exception
+ * will be thrown when:
+ *
+ *
Any Flash Player API that expects a depth number is invoked with an invalid depth
+ * number.
+ *
Any Flash Player API that expects a frame number is invoked with an invalid frame
+ * number.
+ *
Any Flash Player API that expects a layer number is invoked with an invalid layer
+ * number.
+ *
+ *
+ * @includeExample examples\RangeErrorExample.as -noswf
+ *
+ * @see Number#toExponential()
+ * @see Number#toPrecision()
+ * @see Number#toFixed()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, RangeError
+ */
+public dynamic class RangeError extends Error
+{
+ /**
+ * Creates a new RangeError object.
+ * @param message Contains the message associated with the RangeError object.
+ */
+ public native function RangeError(message:String = "");
+}
+
+
+}
+package {
+
+/**
+ * A ReferenceError exception is thrown when a reference to an undefined property is
+ * attempted on a sealed (nondynamic) object. References to undefined variables will
+ * result in ReferenceError exceptions to inform you of potential bugs and help you troubleshoot
+ * application code.
+ *
However, you can refer to undefined properties of a dynamic class without having a ReferenceError thrown. For more information, see the dynamic keyword.
+ *
+ * @includeExample examples\ReferenceErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, ReferenceError
+ * @see statements.html#dynamic dynamic keyword
+ */
+public dynamic class ReferenceError extends Error
+{
+ /**
+ * Creates a new ReferenceError object.
+ * @param message Contains the message associated with the ReferenceError object.
+ */
+ public native function ReferenceError(message:String = "");
+
+}
+
+
+}
+package {
+// RegExp class
+
+/**
+ *
+ * The RegExp class lets you work with regular expressions, which are patterns that you can use
+ * to perform searches in strings and to replace text in strings.
+ *
+ *
You can create a new RegExp object by using the new RegExp() constructor or by
+ * assigning a RegExp literal to a variable:
+ *
+ * var pattern1:RegExp = new RegExp("test-\d", "i");
+ * var pattern2:RegExp = /test-\d/i;
+ *
+ *
+ *
For more information, see "Using Regular Expressions" in Programming
+ * ActionScript 3.0.
+ *
+ * @includeExample examples\RegExpExample.as -noswf
+ *
+ * @see String#match()
+ * @see String#replace()
+ * @see String#search()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ **/
+public dynamic class RegExp {
+
+ /**
+ * Lets you construct a regular expression from two strings. One string defines the pattern of the
+ * regular expression, and the other defines the flags used in the regular expression.
+ *
+ * @param re The pattern of the regular expression (also known as the constructor string). This is the
+ * main part of the regular expression (the part that goes within the "/" characters).
+ *
+ *
Note: Do not include the starting and trailing "/" characters; use these only when defining a regular expression
+ * literal without using the constructor.
+ *
+ * @param flags The modifiers of the regular expression. These can include the following:
+ *
+ *
+ *
+ *
g When using the replace() method of the String class,
+ * specify this modifier to replace all matches, rather than only the first one.
+ * This modifier corresponds to the global property of the RegExp instance.
+ *
i The regular expression is evaluated without case
+ * sensitivity. This modifier corresponds to the ignoreCase property of the RegExp instance.
+ *
s The dot (.) character matches new-line characters. Note
+ * This modifier corresponds to the dotall property of the RegExp instance.
+ *
m The caret (^) character and dollar sign ($) match
+ * before and after new-line characters. This modifier corresponds to the
+ * multiline property of the RegExp instance.
+ *
x White space characters in the re string are ignored,
+ * so that you can write more readable constructors. This modifier corresponds to the
+ * extended property of the RegExp instance.
+ *
+ *
+ *
+ *
All other characters in the flags string are ignored.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.attribute, attribute
+ **/
+ public native function RegExp (re:String, flags:String);
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the RegExp() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #RegExp()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Performs a search for the regular expression on the given string str.
+ *
+ *
If the g (global) flag is not set for the regular
+ * expression, then the search starts
+ * at the beginning of the string (at index position 0); the search ignores
+ * the lastIndex property of the regular expression.
+ *
+ *
If the g (global) flag is set for the regular
+ * expression, then the search starts
+ * at the index position specified by the lastIndex property of the regular expression.
+ * If the search matches a substring, the lastIndex property changes to match the position
+ * of the end of the match.
+ *
+ * @param str The string to search.
+ *
+ * @return If there is no match, null; otherwise, an object with the following properties:
+ *
+ *
+ *
+ *
An array, in which element 0 contains the complete matching substring, and
+ * other elements of the array (1 through n) contain substrings that match parenthetical groups
+ * in the regular expression
+ *
+ *
index The character position of the matched substring within
+ * the string
+ *
+ *
input The string (str)
+ *
+ *
+ *
+ *
+ * @example When the g (global) flag is not set in the regular expression, then you can
+ * use exec() to find the first match in the string:
+ *
+ *
+ * var myPattern:RegExp = /(\w~~)sh(\w~~)/ig;
+ * var str:String = "She sells seashells by the seashore";
+ * var result:Object = myPattern.exec(str);
+ * trace(result);
+ *
+ *
+ *
The result object is set to the following:
+ *
+ *
+ *
+ *
result[0] is set to "She" (the complete
+ * match).
+ *
+ *
result[1] is set to an empty string (the first matching
+ * parenthetical group).
+ *
+ *
result[2] is set to "e" (the second matching
+ * parenthetical group).
+ *
+ *
result.index is set to 0.
+ *
+ *
result.input is set to the input string: "She sells seashells
+ * by the seashore".
+ *
+ *
+ *
+ *
+ *
+ *
In the following example, the g (global) flag is set in the regular
+ * expression, so you can use exec() repeatedly to find multiple matches:
+ *
+ *
+ * var myPattern:RegExp = /(\w~~)sh(\w~~)/ig;
+ * var str:String = "She sells seashells by the seashore";
+ * var result:Object = myPattern.exec(str);
+ *
+ * while (result != null) {
+ * trace ( result.index, "\t", result);
+ * result = myPattern.exec(str);
+ * }
+ *
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.exec, exec
+ * @see String#match()
+ * @see String#search()
+ */
+ public native function exec (str:String):Object;
+
+ /**
+ * Tests for the match of the regular expression in the given string str.
+ *
+ *
If the g (global) flag is not set for the regular expression,
+ * then the search starts at the beginning of the string (at index position 0); the search ignores
+ * the lastIndex property of the regular expression.
+ *
+ *
If the g (global) flag is set for the regular expression, then the search starts
+ * at the index position specified by the lastIndex property of the regular expression.
+ * If the search matches a substring, the lastIndex property changes to match the
+ * position of the end of the match.
+ *
+ * @param str The string to test.
+ *
+ * @return If there is a match, true; otherwise, false.
+ *
+ * @includeExample examples\RegExp.test.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.test, test
+ */
+ public native function test(str:String):Boolean;
+
+ /**
+ * Specifies whether the dot character (.) in a regular expression pattern matches
+ * new-line characters. Use the s flag when constructing
+ * a regular expression to set dotall = true.
+ *
+ * @includeExample examples\RegExp.dotall.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.dotall, dotall
+ */
+ public native function get dotall():Boolean;
+
+ /**
+ * Specifies whether to use extended mode for the regular expression.
+ * When a RegExp object is in extended mode, white space characters in the constructor
+ * string are ignored. This is done to allow more readable constructors.
+ *
+ *
Use the x flag when constructing a regular expression to set
+ * extended = true.
+ *
+ * @includeExample examples\RegExp.extended.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.extended, extended
+ */
+ public native function get extended():Boolean;
+
+ /**
+ * Specifies whether to use global matching for the regular expression. When
+ * global == true, the lastIndex property is set after a match is
+ * found. The next time a match is requested, the regular expression engine starts from
+ * the lastIndex position in the string. Use the g flag when
+ * constructing a regular expression to set global to true.
+ *
+ * @includeExample examples\RegExp.global.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.global, global
+ */
+ public native function get global():Boolean;
+
+ /**
+ * Specifies whether the regular expression ignores case sensitivity. Use the
+ * i flag when constructing a regular expression to set
+ * ignoreCase = true.
+ *
+ * @includeExample examples\RegExp.ignoreCase.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.ignoreCase, ignoreCase
+ **/
+ public native function get ignoreCase():Boolean;
+
+ /**
+ * Specifies the index position in the string at which to start the next search. This property
+ * affects the exec() and test() methods of the RegExp class.
+ * However, the match(), replace(), and search() methods
+ * of the String class ignore the lastIndex property and start all searches from
+ * the beginning of the string.
+ *
+ *
When the exec() or test() method finds a match and the g
+ * (global) flag is set to true for the regular expression, the method
+ * automatically sets the lastIndex property to the index position of the character
+ * after the last character in the matching substring of the last match. If the
+ * g (global) flag is set to false, the method does not
+ * set the lastIndexproperty.
+ *
+ *
You can set the lastIndex property to adjust the starting position
+ * in the string for regular expression matching.
+ *
+ * @includeExample examples\RegExp.lastIndex.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.lastIndex, lastIndex
+ */
+ public native function get lastIndex():Number;
+ public native function set lastIndex(value:Number):void;
+
+ /**
+ * Specifies whether the m (multiline) flag is set. If it is set,
+ * the caret (^) and dollar sign ($) in a regular expression
+ * match before and after new lines.
+ * Use the m flag when constructing a regular expression to set
+ * multiline = true.
+ *
+ * @includeExample examples\RegExp.multiline.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.multiline, multiline
+ */
+ public native function get multiline():Boolean;
+
+ /**
+ * Specifies the pattern portion of the regular expression.
+ *
+ * @includeExample examples\RegExp.source.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.source, source
+ */
+ public native function get source():String;
+
+}
+}
+package flash.errors
+{
+ /**
+ * The ScriptTimeoutError exception is thrown when the script timeout interval is reached.
+ * The script timeout interval is 15 seconds. There are two XML attributes
+ * that you can add to the mx:Application tag: scriptTimeLimit
+ * (the number of seconds until script timeout) and scriptRecursionLimit
+ * (the depth of recursive calls permitted).
+ *
+ *
Two ScriptTimeoutError exceptions are thrown. The first exception you can catch and exit
+ * cleanly. If there is no exception handler, the uncaught exception terminates execution. The
+ * second exception is thrown but cannot be caught by user code; it goes to the uncaught
+ * exception handler. It is uncatchable to prevent Flash Player from hanging
+ * indefinitely.
+ *
+ * @includeExample examples\ScriptTimeoutErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class ScriptTimeoutError extends Error {
+ /**
+ * Creates a new ScriptTimeoutError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function ScriptTimeoutError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+
+/**
+ * The SecurityError exception is thrown when some type of security violation
+ * takes place.
+ *
+ * Examples of security errors:
+ *
+ *
An unauthorized property access or method call is made across a security sandbox
+ * boundary.
+ *
An attempt was made to access a URL not permitted by the security sandbox.
+ *
A socket connection was attempted to an unauthorized port number, e.g. a port below
+ * 1024 without a policy file present.
+ *
An attempt was made to access the user's camera or microphone, and the request to
+ * access the device was denied by the user.
+ *
+ *
+ * @includeExample examples\SecurityErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, SecurityError
+ *
+ */
+public dynamic class SecurityError extends Error
+{
+ /**
+ * Creates a new SecurityError object.
+ */
+ public native function SecurityError(message:String = "");
+
+}
+
+
+}
+package flash.errors
+{
+ /**
+ * ActionScript throws a StackOverflowError exception when the stack available to the script
+ * is exhausted. ActionScript uses a stack to store information about each method call made in
+ * a script, such as the local variables that the method uses. The amount of stack space
+ * available varies from system to system.
+ *
+ *
A StackOverflowError exception might indicate that infinite recursion has occurred, in
+ * which case a termination case needs to be added to the function. It also might indicate
+ * that the recursive algorithm has a proper terminating condition but has exhausted the stack
+ * anyway. In this case, try to express the algorithm iteratively instead.
+ *
+ * @includeExample examples\StackOverflowErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class StackOverflowError extends Error {
+ /**
+ * Creates a new StackOverflowError object.
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function StackOverflowError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+/**
+ * A StackTraceElement provides programmatic access to the elements of the call stack.
+ * A string representation of StackTraceElement objects is returned by the Error.getStackTrace() method.
+ *
+ *
The StackTraceElement class is useful for writing custom exception handlers
+ * that need to display the call stack to the developer.
+ *
+ * @includeExample examples\StackTraceElementExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see Error#getStackTrace()
+ */
+
+public class StackTraceElement
+ {
+ /**
+ * The fully qualified name of the class containing the
+ * execution point represented by this stack trace
+ * element, or null if the execution point is not
+ * within a class.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var className:String;
+
+ /**
+ * The name of method or function containing the execution
+ * point represented by this stack trace element, or
+ * null if the execution point is not within a method.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var methodName:String;
+
+ /**
+ * The name of the ActionScript file containing the execution point
+ * represented by this stack trace element, or null if
+ * this information is not available.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var fileName:String;
+
+ /**
+ * Line number of the execution point in the source file
+ * specified by fileName, or null if this information
+ * is not available.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var lineNumber:Integer;
+
+ /**
+ * The nativeMethod property value is true if the execution point is within a native method and
+ * false otherwise.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var nativeMethod:Boolean;
+
+ /**
+ * Returns the string representation of this stack
+ * trace element. Such as:
+ *
+ * MyClass.method(MyClass.as:100)
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function toString():String;
+ }
+}
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// String object
+//****************************************************************************
+
+
+/**
+ * The String class is a data type that represents a string of characters. The String class
+ * provides methods and properties that let you manipulate primitive string value types.
+ * You can convert the value of any object into a String data type object using the String()
+ * function.
+ *
+ * All the methods of the String class, except for concat(),
+ * fromCharCode(), slice(), and substr(), are
+ * generic, which means the methods call toString() before performing their
+ * operations, and you can use these methods with other non-String objects.
+ *
+ * Because all string indexes are zero-based, the index of the last character
+ * for any string x is x.length - 1.
+ *
+ * You can call any of the methods of the String class whether you use the constructor method
+ * new String() to create a new string variable or simply assign a string literal value.
+ * Unlike previous versions of ActionScript, it makes no difference whether you use the constructor,
+ * the global function, or simply assign a string literal value. The following lines of code are equivalent:
+ *
+ *
+ * var str:String = new String("foo");
+ * var str:String = "foo";
+ * var str:String = String("foo");
+ *
When setting a string variable to undefined, Flash Player coerces undefined
+ * to null. So, the statement:
+ *
+ * var s:String = undefined;
+ * sets the value to null instead of undefined. Use the String()
+ * function if you need to use undefined.
+ * @includeExample examples\StringExample.as -noswf
+ *
+ * @playerversion Flash 9
+ *
+ * @see package.html#String() String Function
+ * @refpath Objects/Core/String
+ * @keyword string, string object, built-in class
+ */
+public final class String
+{
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the String() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #String()
+ */
+ public static const length:int = 1;
+
+ /**
+ * An integer specifying the number of characters in the specified String object.
+ *
+ * Because all string indexes are zero-based, the index of the last character for any
+ * string x is x.length - 1.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @oldexample The following example creates a new String object and uses String.length to count the number of characters:
+ *
The following example loops from 0 to my_str.length.
+ *
+ * The code checks the characters
+ * within a string, and if the string contains the @ character, true displays in the Output panel.
+ *
+ * The code checks the characters within a string, and if the string contains the @ character,
+ * true writes to the log file.
+ *
+ * If it does not contain the @ character,
+ * false displays in the Output panel.
+
+ * If it does not contain the @ character,
+ * then false writes to the log file.
+ *
+ *
+ * @helpid x209C5
+ * @refpath Objects/Core/String/Properties/length
+ * @keyword string, string.length, length
+ */
+ public native function get length():int
+
+
+ /**
+ * Returns a string comprising the characters represented by the Unicode character codes
+ * in the parameters.
+ *
+ * @playerversion Flash 9
+ *
+ * @param ...charCodes A series of decimal integers that represent Unicode values.
+ *
+ * @return The string value of the specified Unicode character codes.
+ *
+ * @oldexample The following example uses fromCharCode() to insert an @ character in the e-mail address:
+ *
+ *
+ *
+ * @helpid x209BE
+ * @refpath Objects/Core/String/Methods/fromCharCode
+ * @keyword string, string.fromcharcode, fromcharcode, from character code
+ */
+ public native static function fromCharCode(...charCodes):String;
+
+ /**
+ * Creates a new String object initialized to the specified string.
+ *
+ *
+ * Note: Because string literals use less overhead than String
+ * objects and are generally easier to use, you should use string literals instead of the
+ * String class unless you have a good reason to use a String object rather than a string literal.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The initial value of the new String object.
+ *
+ * @return A reference to a String object.
+ *
+ *
+ * @helpid x209C8
+ * @refpath Objects/Core/String/new String
+ * @keyword string, new string, new, constructor
+ */
+ public native function String(val:String);
+
+
+ /**
+ * Returns the character in the position specified by the index parameter.
+ * If index is not a number from 0 to string.length - 1, an
+ * empty string is returned.
+ *
+ * This method is similar to String.charCodeAt() except that the returned
+ * value is a character, not a 16-bit integer character code.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param index An integer specifying the position of a character in the string. The first
+ * character is indicated by 0, and the last character is indicated by
+ * my_str.length - 1.
+ *
+ * @return The character at the specified index. Or an empty string if the
+ * specified index is outside the range of this string's indices.
+ *
+ * @oldexample In the following example, this method is called on the first letter of the string "Chris":
+ *
+ * var my_str:String = "Chris";
+ * var firstChar_str:String = my_str.charAt(0);
+ * trace(firstChar_str); // output: C
+ *
+ *
+ *
+ * @see #charCodeAt()
+ * @helpid x209BA
+ * @refpath Objects/Core/String/Methods/charAt
+ * @keyword string, string.charat, charat, character at
+ */
+ public native function charAt(index:Number = 0):String;
+
+ /**
+ * Returns the numeric Unicode character code of the character at the specified
+ * index. If index is not a number from 0 to
+ * string.length - 1, NaN is returned.
+ *
+ * This method is similar to String.charAt() except that the returned
+ * value is a 16-bit integer character code, not the actual character.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param index An integer that specifies the position of a character in the string. The
+ * first character is indicated by 0, and the last character is indicated by
+ * my_str.length - 1.
+ *
+ * @return The Unicode character code of the character at the specified index. Or
+ * NaN if the index is outside the range of this string's indices.
+ *
+ * @oldexample In the following example, this method is called on the first letter of the string "Chris":
+ *
+ * var my_str:String = "Chris";
+ * var firstChar_num:Number = my_str.charCodeAt(0);
+ * trace(firstChar_num); // output: 67
+ *
+ *
+ *
+ * @see #charAt()
+ * @helpid x209BB
+ * @refpath Objects/Core/String/Methods/charCodeAt
+ * @keyword string, string.charcodeat, charcodeat, character code at
+ */
+ public native function charCodeAt(index:Number = 0):Number;
+
+ /**
+ * Appends the supplied arguments to the end of the String object, converting them to strings if
+ * necessary, and returns the resulting string. The original value of the source String object
+ * remains unchanged.
+ *
+ * @playerversion Flash 9
+ *
+ * @param ...args Zero or more values to be concatenated.
+ *
+ * @return A new string consisting of this string concatenated
+ * with the specified parameters.
+ *
+ * @oldexample The following example creates two strings and combines them using String.concat():
+ *
+ * var stringA:String = "Hello";
+ * var stringB:String = "World";
+ * var combinedAB:String = stringA.concat(" ", stringB);
+ * trace(combinedAB); // output: Hello World
+ *
+ *
+ *
+ * @helpid x209BC
+ * @refpath Objects/Core/String/Methods/concat
+ * @keyword string, string.concat, concat, concatenate
+ */
+ public native function concat(...args):String;
+
+ /**
+ * Searches the string and returns the position of the first occurrence of val
+ * found at or after startIndex within the calling string. This index is zero-based,
+ * meaning that the first character in a string is considered to be at index 0--not index 1. If
+ * val is not found, the method returns -1.
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The substring for which to search.
+ *
+ * @param startIndex An optional integer specifying the starting index of the search.
+ *
+ * @return The index of the first occurrence of the specified substring or -1.
+ *
+ * @oldexample The following examples use indexOf() to return the index of characters and substrings:
+ *
+ * var searchString:String = "Lorem ipsum dolor sit amet.";
+ * var index:Number;
+ *
+ * index = searchString.indexOf("L");
+ * trace(index); // output: 0
+ *
+ * index = searchString.indexOf("l");
+ * trace(index); // output: 14
+ *
+ * index = searchString.indexOf("i");
+ * trace(index); // output: 6
+ *
+ * index = searchString.indexOf("ipsum");
+ * trace(index); // output: 6
+ *
+ * index = searchString.indexOf("i", 7);
+ * trace(index); // output: 19
+ *
+ * index = searchString.indexOf("z");
+ * trace(index); // output: -1
+ *
+ *
+ *
+ * @see #lastIndexOf()
+ * @helpid x209C2
+ * @refpath Objects/Core/String/Methods/indexOf
+ * @keyword string, string.indexof, indexof, index
+ */
+ public native function indexOf(val:String = "undefined", startIndex:Number = 0):int;
+
+ /**
+ * Searches the string from right to left and returns the index of the last occurrence
+ * of val found before startIndex. The index is zero-based,
+ * meaning that the first character is at index 0, and the last is at string.length
+ * - 1. If val is not found, the method returns -1.
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The string for which to search.
+ *
+ * @param startIndex An optional integer specifying the starting index from which to
+ * search for val. The default is the maximum value allowed for an index.
+ * If startIndex is not specified, the search starts at the last item in the string.
+ *
+ * @return The position of the last occurrence of the specified substring or -1 if not found.
+ *
+ * @oldexample The following example shows how to use lastIndexOf() to return the index of a certain character:
+ *
+ * var searchString:String = "Lorem ipsum dolor sit amet.";
+ * var index:Number;
+ *
+ * index = searchString.lastIndexOf("L");
+ * trace(index); // output: 0
+ *
+ * index = searchString.lastIndexOf("l");
+ * trace(index); // output: 14
+ *
+ * index = searchString.lastIndexOf("i");
+ * trace(index); // output: 19
+ *
+ * index = searchString.lastIndexOf("ipsum");
+ * trace(index); // output: 6
+ *
+ * index = searchString.lastIndexOf("i", 18);
+ * trace(index); // output: 6
+ *
+ * index = searchString.lastIndexOf("z");
+ * trace(index); // output: -1
+ *
+ *
+ *
+ * @see #indexOf()
+ * @helpid x209C3
+ * @refpath Objects/Core/String/Methods/lastIndexOf
+ * @keyword string, string.lastindexof, lastindexof, last index of
+ */
+ public native function lastIndexOf(val:String = "undefined", startIndex:Number=0x7FFFFFFF):int;
+
+ /**
+ * Compares the sort order of two or more strings and returns the result of the comparison as an integer. While this
+ * method is intended to handle the comparison in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from other string comparisons such as the equality (==) or
+ * inequality (!=) operators.
+ * If the strings are equivalent, the return value is 0.
+ * If the original string value precedes the string value specified by other,
+ * the return value is a negative integer, the absolute value of which represents
+ * the number of characters that separates the two string values.
+ * If the original string value comes after other,
+ * the return value is a positive integer, the absolute value of which represents
+ * the number of characters that separates the two string values.
+ *
+ * @param other A string value to compare.
+ * @param ...values Optional set of more strings to compare.
+ * @return The value 0 if the strings are equal. Otherwise, a negative integer if the original
+ * string precedes the string argument and a positive integer if the string argument precedes
+ * the original string. In both cases the absolute value of the number represents the difference
+ * between the two strings.
+ */
+ public native function localeCompare(other:String, ...values):int;
+
+ /**
+ * Matches the specifed pattern against the string and returns a new string
+ * in which the first match of pattern is replaced with the content specified by repl.
+ * The pattern parameter can be a string or a regular expression. The repl parameter
+ * can be a string or a function; if it is a function, the string returned
+ * by the function is inserted in place of the match. The original string is not modified.
+ *
+ *
In the following example, only the first instance of "sh" (case-sensitive)
+ * is replaced:
+ *
+ *
+ * var myPattern:RegExp = /sh/;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // She sells seaschells by the seashore.
+ *
+ *
In the following example, all instances of "sh" (case-sensitive)
+ * are replaced because the g (global) flag is set in the regular expression:
+ *
+ *
+ * var myPattern:RegExp = /sh/g;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // She sells seaschells by the seaschore.
+ *
+ *
In the following example, all instance of "sh"
+ * are replaced because the g (global) flag is set in the regular expression
+ * and the matches are not case-sensitive becuase the i (ignoreCase) flag is set:
+ *
+ *
+ * var myPattern:RegExp = /sh/gi;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // sche sells seaschells by the seaschore.
+ *
+ * @param pattern The pattern to match, which can be any type of object, but it is typically
+ * either a string or a regular expression. If you specify a pattern parameter
+ * that is any object other than a string or a regular expression, the toString() method is
+ * applied to the parameter and the replace() method executes using the resulting string
+ * as the pattern.
+ *
+ * @param repl Typically, the string that is inserted in place of the matching content. However, you can
+ * also specify a function as this parameter. If you specify a function, the string returned
+ * by the function is inserted in place of the matching content.
+ *
+ *
When you specify a string as the repl parameter and specify a regular expression
+ * as the pattern parameter, you can use the following special $ replacement codes
+ * in the repl string:
+ *
+ *
+ *
+ *
+ *
+ *
$ Code
+ *
+ *
+ *
Replacement Text
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$$
+ *
+ *
+ *
$
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$&
+ *
+ *
+ *
The matched substring.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$`
+ *
+ *
+ *
The portion of the string that precedes the matched substring.
+ * Note that this code uses the straight left single quote character (`),
+ * not the straight single quote character (') or the left curly single quote
+ * character ().
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$'
+ *
+ *
+ *
The portion of string that follows the matched substring.
+ * Note that this code uses the straight single quote character (').
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$n
+ *
+ *
+ *
The nth captured parenthetical group match, where n is a single
+ * digit 1-9 and $n is not followed by a decimal digit.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$nn
+ *
+ *
+ *
The nnth captured parenthetical group match, where nn is a two-digit
+ * decimal number (01-99). If the nnth capture is undefined, the replacement text
+ * is an empty string.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
For example, the following shows the use of the $2 and $1
+ * replacement codes, which represent the first and second capturing group matched:
When you specify a function as the repl, the replace() method
+ * passes the following parameters to the function:
+ *
+ *
+ *
+ *
+ *
+ * The matching portion of the string.
+ *
+ *
+ *
+ * Any captured parenthetical group matches are provided as the next arguments. The number of arguments passed
+ * this way will vary depending on the number of parenthetical matches. You can determine the
+ * number of parenthetical matches by checking arguments.length - 3 within the function
+ * code.
+ *
+ *
+ *
+ * The index position in the string where the match begins.
+ *
The call to the replace() method uses a function as the repl
+ * parameter. The regular expression (/([a-z]*)([0-9]*)/g) is matched twice. The
+ * first time, the pattern matches the substring "abc12", and the following list
+ * of arguments is passed to the function:
+ *
The second time, the pattern matches the substring "def23", and the
+ * following list of arguments is passed to the function:
+ *
+ *
+ *
+ * {"def34", "def", "34", 6, "abc123 def34"}
+ *
+ *
+ * @return The resulting string. Note that the source string remains unchanged.
+ *
+ * @see RegExp
+ */
+ public native function replace(pattern:*, repl:Object):String;
+
+ /**
+ * Matches the specifed pattern against the
+ * string.
+ *
+ * @param pattern The pattern to match, which can be any type of object, but it is typically
+ * either a string or a regular expression. If the pattern is not a regular expression
+ * or a string, then the method converts it to a string before executing.
+ *
+ * @return An array of strings consisting of all substrings in
+ * the string that match the specified pattern.
+ *
+ *
If pattern is a regular expression, in order to return an array with
+ * more than one matching substring, the g (global) flag must be set
+ * in the regular expression:
+ *
+ *
+ *
+ *
If the g (global) flag is not set,
+ * the return array will contain no more than one match, and the lastIndex
+ * property of the regular expression remains unchanged.
+ *
+ *
If the g (global) flag is set, the method starts the search at
+ * the beginning of the string (index position 0). If a matching substring is an empty string (which
+ * can occur with a regular expression such as /x~~/), the method adds that
+ * empty string to the array of matches, and then continues searching at the next index position.
+ * The lastIndex property of the regular expression is set to 0 after the
+ * method completes.
+ *
+ *
+ *
+ *
If no match is found, the method returns null. If you pass
+ * no value (or an undefined value) as the pattern parameter,
+ * the method returns null.
+ *
+ *
+ * @oldexample
+ * var myPattern:RegExp = /sh./g;
+ * // The dot (.) matches any character.
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: she,sho
+ *
+ * myPattern = /sh./gi;
+ * // This time, make it case insensitive (with the i flag).
+ * str = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: She,she,sho
+ *
+ * myPattern = RegExp = new RegExp("sh(.)", "gi")
+ * // Note the grouping parentheses.
+ * str = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: She,e,she,e,sho,o
+ * // Note that the result array is
+ * // [[She,e],[she,e],[sho,o]]
+ *
+ *
+ * @see RegExp
+ */
+ public native function match(pattern:*):Array;
+
+ /**
+ * Searches for the specifed pattern and returns the index of
+ * the first matching substring. If there is no matching substring, the method returns
+ * -1.
+ *
+ * @param pattern The pattern to match, which can be any type of object but is typically
+ * either a string or a regular expression.. If the pattern is not a regular expression
+ * or a string, then the method converts it to a string before executing.
+ * Note that if you specify a regular expression, the method ignores the global flag ("g") of the
+ * regular expression, and it ignores the lastIndex property of the regular
+ * expression (and leaves it unmodified). If you pass an undefined value (or no value),
+ * the method returns -1.
+ *
+ * @return The index of the first matching substring, or -1 if
+ * there is no match. Note that the string is zero-indexed; the first character of
+ * the string is at index 0, the last is at string.length - 1.
+ *
+ * @oldexample
+ * var str:String = "She sells seashells by the seashore.";
+ * var myPattern:RegExp = /sh/;
+ * // This time, make it case insensitive (with the i flag).
+ * trace(str.match(myPattern));
+ *
+ * // Output: 13
+ * // (The substring match starts at character position 13.)
+ *
+ * var myPattern:RegExp = /sh/i;
+ * trace(str.match(myPattern));
+ *
+ * // Output: 0
+ * // (The substring match starts at character position 0
+ * // -- the first character of the source string.)
+ *
+ *
+ * @see RegExp
+ */
+ public native function search(pattern:*):int;
+
+ /**
+ * Returns a string that includes the startIndex character
+ * and all characters up to, but not including, the endIndex character. The original String object is not modified.
+ * If the endIndex parameter is not specified, then the end of the
+ * substring is the end of the string. If the character indexed by startIndex is the same as or to the right of the
+ * character indexed by endIndex, the method returns an empty string.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex The zero-based index of the starting point for the slice. If
+ * startIndex is a negative number, the slice is created from right-to-left, where
+ * -1 is the last character.
+ *
+ * @param endIndex An integer that is one greater than the index of the ending point for
+ * the slice. The character indexed by the endIndex parameter is not included in the extracted
+ * string.
+ * If endIndex is a negative number, the ending point is determined by
+ * counting back from the end of the string, where -1 is the last character.
+ * The default is the maximum value allowed for an index. If this parameter is omitted, String.length is used.
+ *
+ * @return A substring based on the specified indices.
+ *
+ * @oldexample The following example creates a variable, my_str, assigns it a String value, and then calls
+ * the slice() method using a variety of values for both the start and end
+ * parameters.
+ * Each call to slice() is wrapped in a trace() statement that displays
+ * the output in the Output panel.
+ * Each call to the slice() method is wrapped in a
+ * trace() statement that sends the output to the log file.
+ *
+ *
+ * // Index values for the string literal
+ * // positive index: 0 1 2 3 4
+ * // string: L o r e m
+ * // negative index: -5 -4 -3 -2 -1
+ *
+ * var my_str:String = "Lorem";
+ *
+ * // slice the first character
+ * trace("slice(0,1): "+my_str.slice(0, 1)); // output: slice(0,1): L
+ * trace("slice(-5,1): "+my_str.slice(-5, 1)); // output: slice(-5,1): L
+ *
+ * // slice the middle three characters
+ * trace("slice(1,4): "+my_str.slice(1, 4)); // slice(1,4): ore
+ * trace("slice(1,-1): "+my_str.slice(1, -1)); // slice(1,-1): ore
+ *
+ * // slices that return empty strings because start is not to the left of end
+ * trace("slice(1,1): "+my_str.slice(1, 1)); // slice(1,1):
+ * trace("slice(3,2): "+my_str.slice(3, 2)); // slice(3,2):
+ * trace("slice(-2,2): "+my_str.slice(-2, 2)); // slice(-2,2):
+ *
+ * // slices that omit the end parameter use String.length, which equals 5
+ * trace("slice(0): "+my_str.slice(0)); // slice(0): Lorem
+ * trace("slice(3): "+my_str.slice(3)); // slice(3): em
+ *
+ *
An example is also in the Strings.fla file in the HelpExamples folder.
+ * The following list gives typical paths to this folder:
+ *
+ *
+ *
+ *
+ * @see #substr()
+ * @see #substring()
+ * @helpid x209CB
+ * @refpath Objects/Core/String/Methods/slice
+ * @keyword string, string.slice, slice
+ */
+ public native function slice(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String;
+
+ /**
+ * Splits a String object into an array of substrings
+ * by dividing it wherever the specified delimiter parameter
+ * occurs.
+ *
+ *
If the delimiter parameter is a regular expression, only
+ * the first match at a given position of the string is considered,
+ * even if backtracking could find a nonempty substring match at that
+ * position. For example:
If the delimiter parameter is a regular expression
+ * containing grouping parentheses, then each time the
+ * delimiter is matched, the results (including any
+ * undefined results) of the grouping parentheses are spliced into the
+ * output array. For example
+ *
+ *
+ * var str:String = "Thi5 is a tricky-66 example.";
+ * var re:RegExp = /(\d+)/;
+ * var results:Array = str.split(re);
+ * // results == ["Thi","5"," is a tricky-","66"," example."]
+ *
+ *
+ *
If the limit parameter is specified, then
+ * the returned array will have no more than the specified
+ * number of elements.
+ *
If the delimiter is an empty string, an empty
+ * regular expression, or a regular expression that can match an empty
+ * string, each single character in the string
+ * is ouput as an element in the array.
+ *
+ *
If the delimiter parameter is undefined, the entire
+ * string is placed into the first element of the returned
+ * array.
+ *
+ * @playerversion Flash 9
+ *
+ * @param delimiter The pattern that specifies where to split this string. This can be any type of
+ * object but is typically either a string or a regular expression. If the delimiter
+ * is not a regular expression or string, then the method converts it to a string before executing.
+ *
+ * @param limit The maximum number of items to place into the array.
+ * The default is the maximum value allowed.
+ *
+ *
+ * @return An array of substrings.
+ *
+ *
+ *
+ * @see Array#join()
+ * @see RegExp
+ * @helpid x209CC
+ * @refpath Objects/Core/String/Methods/split
+ * @keyword string, string.split, split
+ */
+ public native function split(delimiter:*, limit:Number = 0x7fffffff):Array;
+
+ /**
+ * Returns a substring consisting of the characters that start at the specified
+ * startIndex and with a length specified by len. The original
+ * string is unmodified.
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex An integer that specified the index of the first character to be
+ * used to create the substring. If startIndex is a negative number, the
+ * starting index is determined from the end of the string, where -1 is the
+ * last character.
+ *
+ * @param len The number of characters in the substring being created.
+ * The default value is the maximum value allowed. If len
+ * is not specified, the substring includes all the characters from startIndex
+ * to the end of the string.
+ *
+ * @return A substring based on the specified parameters.
+ *
+ * @oldexample The following example creates a new string, my_str and uses substr() to return the second word in the string; first, using a positive start parameter, and then using a negative start parameter:
+ *
+ * var my_str:String = new String("Hello world");
+ * var mySubstring:String = new String();
+ * mySubstring = my_str.substr(6,5);
+ * trace(mySubstring); // output: world
+ *
+ * mySubstring = my_str.substr(-5,5);
+ * trace(mySubstring); // output: world
+ *
+ *
An example is also in the Strings.fla file in the HelpExamples folder. The following list gives typical paths to this folder:
+ *
+ *
+ * @helpid x209CD
+ * @refpath Objects/Core/String/Methods/substr
+ * @keyword string, string.substr, substr, substring
+ */
+ public native function substr(startIndex:Number = 0, len:Number = 0x7fffffff):String;
+
+ /**
+ * Returns a string consisting of the character specified by startIndex
+ * and all characters up to endIndex - 1. If endIndex is not
+ * specified, String.length is used. If the value of startIndex
+ * equals the value of endIndex, the method returns an empty string.
+ * If the value of startIndex is greater than the value of
+ * endIndex, the parameters are automatically swapped before the function
+ * executes. The original string is unmodified.
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex An integer specifying the index of the first character used to create
+ * the substring. Valid values for startIndex are 0 through
+ * String.length. If startIndex is a negative value, 0
+ * is used.
+ *
+ * @param endIndex An integer that is one greater than the index of the last character in the
+ * extracted substring. Valid values for endIndex are 0 through
+ * String.length. The character at endIndex is not included in
+ * the substring. The default is the maximum value allowed for an index.
+ * If this parameter is omitted, String.length is used. If
+ * this parameter is a negative value, 0 is used.
+ *
+ * @return A substring based on the specified parameters.
+ *
+ * @oldexample The following example shows how to use substring():
+ *
+ * var my_str:String = "Hello world";
+ * var mySubstring:String = my_str.substring(6,11);
+ * trace(mySubstring); // output: world
+ *
+ *
The following example shows what happens if a negative start parameter is used:
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all uppercase characters converted
+ * to lowercase.
+ *
+ * @see #toUpperCase()
+ * @helpid x209CF
+ * @refpath Objects/Core/String/Methods/toLowerCase
+ * @keyword string, string.tolowercase, tolowercase, to lowercase
+ */
+ public native function toLowerCase():String;
+
+ /**
+ * Returns a copy of this string, with all uppercase characters converted
+ * to lowercase. The original string is unmodified. While this
+ * method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from the toLowerCase() method.
+ *
+ * @return A copy of this string with all uppercase characters converted
+ * to lowercase.
+ *
+ * @see #toLowerCase()
+ */
+ public native function toLocaleLowerCase():String;
+
+
+ /**
+ * Returns a copy of this string, with all lowercase characters converted
+ * to uppercase. The original string is unmodified.
+ *
+ *
This method converts all characters (not simply a-z) for which Unicode uppercase
+ * equivalents exist:
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all lowercase characters converted
+ * to uppercase.
+ *
+ *
+ * @see #toLowerCase()
+ * @helpid x209D0
+ * @refpath Objects/Core/String/Methods/toUpperCase
+ * @keyword string, string.touppercase, touppercase, to uppercase
+ */
+ public native function toUpperCase():String;
+
+ /**
+ * Returns a copy of this string, with all lowercase characters converted
+ * to uppercase. The original string is unmodified. While this
+ * method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from the toUpperCase() method.
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all lowercase characters converted
+ * to uppercase.
+ *
+ * @see #toUpperCase()
+ */
+ public native function toLocaleUpperCase():String;
+
+ /**
+ * Returns the primitive value of a String instance. This method is designed to
+ * convert a String object into a primitive string value. Because Flash Player
+ * automatically calls valueOf() when necessary,
+ * you rarely need to explicitly call this method.
+ *
+ * @playerversion Flash 9
+ *
+ * @return The value of the string.
+ *
+ * @oldexample The following example creates a new instance of the String class
+ * and then shows that the valueOf method returns
+ * the primitive value, rather than a reference to the new instance.
+ *
+ *
+ * var str:String = new String("Hello World");
+ * var value:String = str.valueOf();
+ * trace(str instanceof String); // true
+ * trace(value instanceof String); // false
+ * trace(str === value); // false
+ *
+ *
+ * @langversion 3.0
+ */
+ public native function valueOf():String;
+}
+
+
+}
+package {
+/**
+ * A SyntaxError exception is thrown when a parsing error occurs.
+ *
+ *
ActionScript does not support the eval function or the Function
+ * constructor, two features that require an ActionScript compiler to be present to work.
+ * Therefore, ActionScript cannot throw SyntaxError exceptions in the cases
+ * described in the ECMA-262 specification.
+ *
ActionScript throws SyntaxError exceptions when an invalid
+ * regular expression is parsed by the RegExp class.
+ *
ActionScript throws SyntaxError exceptions when invalid XML is
+ * parsed by the XML class.
+ *
SyntaxError exceptions are thrown in accordance with the E4X
+ * specification; for instance, Section 10.3.1
+ *
+ *
+ *
+ * @see RegExp RegExp class
+ * @see XML XML class
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, SyntaxError
+ */
+public dynamic class SyntaxError extends Error
+{
+ /**
+ * Creates a new SyntaxError object.
+ */
+ public native function SyntaxError(message:String = "");
+
+}
+
+
+}
+package {
+
+/**
+ * A TypeError exception is thrown when the actual type of an operand is different
+ * from the expected type.
+ *
+ * In addition, this exception is thrown when:
+ *
+ *
An actual parameter to a function or method could not be coerced to the formal
+ * parameter type.
+ *
A value is assigned to a variable and cannot be coerced to the variable's type.
+ *
The right side of the is or instanceof operator is not a valid type.
+ *
The super keyword is used illegally.
+ *
A property lookup results in more than one binding, and is therefore ambiguous.
+ *
A method is invoked on an incompatible object. For example, a TypeError
+ * exception is thrown if a RegExp method is "grafted" onto a generic object
+ * and then invoked.
+ *
+ *
+ *
+ * @see operators.html#is is operator
+ * @see operators.html#instanceof instanceof operator
+ * @see statements.html#super super statement
+ * @see RegExp RegExp class
+ * @includeExample examples\TypeErrorExample.as -noswf
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, TypeError
+ *
+ */
+public dynamic class TypeError extends Error
+{
+ /**
+ * Creates a new TypeError object.
+ */
+ public native function TypeError(message:String = "");
+
+}
+
+
+}
+package {
+/**
+ * The uint class provides methods for working with a data type representing a 32-bit unsigned integer. Because an unsigned integer can only be
+ * positive, its maximum value is twice that of the int class.
+ *
The range of values represented by the uint class is 0 to 4,294,967,295 (2^32-1).
+ *
You can create a uint object by declaring a variable of type uint and assigning the variable a literal value. The default value of a variable of type uint is 0.
+ *
The uint class is primarily useful for pixel color values (ARGB and RGBA) and other situations where
+ * the int data type does not work well. For example, the number 0xFFFFFFFF, which
+ * represents the color value white with an alpha value of 255, can't be represented
+ * using the int data type because it is not within the valid range of the int values.
+ *
+ *
The following example creates a uint object and calls the
+ * toString() method:
+ *
+ * @helpid x2096B
+ * @refpath Objects/Core/uint/Constants/MIN_VALUE
+ * @keyword uint, uint.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:uint = 0;
+
+ /**
+ * Creates a new uint object. You can create a variable of uint type and assign it a literal value. The new uint() constructor is primarily used
+ * as a placeholder. A uint object is not the same as the
+ * uint() function, which converts a parameter to a primitive value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param num The numeric value of the uint object being created,
+ * or a value to be converted to a number. If num is not provided,
+ * the default value is 0.
+ *
+ * @return A reference to a uint object.
+ *
+ * @example The following code constructs two new uint objects; the first by assigning a literal value, and the second by using the constructor function:
+ *
+ * var n1:uint = 3;
+ * var n2:uint = new uint(10);
+ *
+ *
+ * @helpid x2097C
+ * @refpath Objects/Core/uint/new uint
+ * @keyword new number, constructor
+ */
+ public native function uint(num:Object);
+
+ /**
+ * Returns the string representation of a uint object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @usage myuint.toString(radix:uint) : String
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the
+ * number-to-string conversion. If you do not specify the radix
+ * parameter, the default value is 10.
+ *
+ * @return The string representation of the uint object.
+ *
+ * @example The following example uses 2 and 8 for the radix
+ * parameters and returns a string value with the corresponding
+ * representation of the number 9:
+ *
+ * The following example creates hexadecimal values:
+ *
+ * var r:uint = 250;
+ * var g:uint = 128;
+ * var b:uint = 114;
+ * var rgb:String = "0x" + r.toString(16) + g.toString(16) + b.toString(16);
+ * trace(rgb); // output: 0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid x2097E
+ * @refpath Objects/Core/uint/Methods/toString
+ * @keyword uint, uint.tostring, tostring
+ */
+ public native function toString(radix:uint):String;
+
+ /**
+ * Returns the primitive uint type value of the specified
+ * uint object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The primitive uint type value of this uint
+ * object.
+ *
+ * @example The following example outputs the primitive value of the
+ * numSocks object.
+ *
+ *
+ * @helpid x20A24
+ * @refpath Objects/Core/uint/Methods/valueOf
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():uint;
+}
+
+}
+package {
+
+/**
+ * A URIError exception is thrown when one of the global URI handling functions is used
+ * in a way that is incompatible with its definition. This exception is thrown when an invalid
+ * URI is specified to a Flash
+ * Player API function that expects a valid URI, such as the Socket.connect()
+ * method or the XML.load() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, URIError
+ *
+ * @see flash.net.Socket#connect()
+ * @see XML#load()
+ */
+public dynamic class URIError extends Error
+{
+ /**
+ * Creates a new URIError object.
+ * @param message Contains the message associated with the URIError object.
+ */
+ public native function URIError(message:String = "");
+
+}
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// VerifyError object
+//****************************************************************************
+/**
+ * The VerifyError class represents an error that occurs when a malformed
+ * or corrupted SWF file is encountered.
+ *
+ * @tiptext An VerifyError is thrown when a malformed or corrupted SWF File is encountered.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ * @see flash.display.Loader Loader class
+ */
+public dynamic class VerifyError extends Error
+{
+ /**
+ * Creates a new VerifyError object.
+ * @param message Contains the message associated with the VerifyError object.
+ */
+ public native function VerifyError(message:String = "");
+}
+
+
+}
+package {
+//
+// XML
+//
+
+// Based on the ECMA E4X Specification, 2nd Edition
+
+ /**
+ * The XML class contains methods and properties for working with XML objects. The XML class
+ * (along with the XMLList, Namespace, and QName classes) implements the
+ * powerful XML-handling standards defined in ECMAScript for XML
+ * (E4X) specification (ECMA-357 edition 2).
+ *
+ *
Use the toXMLString() method to return a string representation of the XML object
+ * regardless of whether the XML object has simple content or complex content.
+ *
+ *
Note: The XML class (along with related classes) from ActionScript 2.0 has been
+ * renamed XMLDocument and moved into the flash.xml package.
+ * It is included in ActionScript 3.0 for backward compatibility.
+ *
+ *
+ * @includeExample examples\XMLExample.as -noswf
+ *
+ * @see Namespace
+ * @see QName
+ * @see XMLList
+ * @see XML#toXMLString()
+ * @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+ * (E4X) specification (ECMA-357 edition 2)
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML
+*/
+public final dynamic class XML extends Object
+{
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the XML() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #XML()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Creates a new XML object. You must use the constructor to create an
+ * XML object before you call any of the methods of the XML class.
+ *
+ *
Use the toXMLString() method to return a string representation of the XML object
+ * regardless of whether the XML object has simple content or complex content.
+ *
+ * @param value Any object that can be converted to XML with the top-level
+ * XML() function.
+ *
+ * @see package.html#XML() top-level XML() function
+ * @see XML#toXMLString()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML
+ **/
+ public native function XML(value:Object);
+
+ /**
+ * Adds a namespace to the set of in-scope namespaces for the XML object. If the namespace already
+ * exists in the in-scope namespaces for the XML object (with a prefix matching that of the given
+ * parameter), then the prefix of the existing namespace is set to undefined. If the input parameter
+ * is a Namespace object, it's used directly. If it's a QName object, the input parameter's
+ * URI is used to create a new namespace; otherwise, it's converted to a String and a namespace is created from
+ * the String.
+ *
+ * @param ns The namespace to add to the XML object.
+ *
+ * @return The new XML object, with the namespace added.
+ *
+ * @includeExample examples\XML.addNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.addNamespace, addNamespace
+ **/
+ public native function addNamespace (ns:Object):XML;
+
+ /**
+ * Appends the given child to the end of the XML object's properties.
+ * The appendChild() method takes an XML object, an XMLList object, or
+ * any other data type that is then converted to a String.
+ *
+ * @return The resulting XML object.
+ *
+ * @param child The XML object to append.
+ *
+ * @oldexample Consider the following:
+ *
+ * var grp = <orchestra>
+ * <musician id="0" ><name>George</name><instrument>cello</instrument></musician>
+ * <musician id="1" ><name>Sam</name></musician>
+ * </orchestra>;
+ *
+ *
+ *
Add a new instrument element to the end of musician element for Sam:
+ *
grp.musician.(name == "George").appendChild(<instrument>cello</instrument>);
+ * Here is the resulting XML, which the method returns:
+ * var grp = <orchestra>
+ * <musician id="0" ><name>George</name><instrument>cello</instrument></musician>
+ * <musician id="1" ><<name>Sam</name><instrument>cello</instrument></musician>
+ * </orchestra>;
+ *
+ *
+ *
+ * @includeExample examples\XML.appendChild.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.appendChild, appendChild
+ **/
+ public native function appendChild ( child:Object ):XML;
+
+ /**
+ * Returns the XML value of the attribute that has the name matching the attributeName
+ * parameter. Attributes are found within XML elements.
+ * In the following example, the element has an attribute named "gender"
+ * with the value "boy": <first gender="boy">John</first>.
+ *
+ *
The attributeName parameter can be any data type; however,
+ * String is the most common data type to use. When passing any object other than a QName object,
+ * the attributeName parameter uses the toString() method
+ * to convert the parameter to a string.
+ *
+ *
If you need a qualified name reference, you can pass in a QName object. A QName object
+ * defines a namespace and the local name, which you can use to define the qualified name of an
+ * attribute. Therefore calling attribute(qname) is not the same as calling
+ * attribute(qname.toString()).
+ *
+ * @includeExample examples\XMLAttributeExample1.as -noswf
+ * @includeExample examples\XMLAttributeExample2.as -noswf
+ *
+ * @param attributeName The name of the attribute.
+ *
+ * @return An XMLList object or an empty XMLList object. Returns an empty XMLList object
+ * when an attribute value has not been defined.
+ *
+ * @see XML#attributes()
+ * @see QName
+ * @see Namespace
+ * @see XML#elements()
+ * @see operators.html#attribute_identifier attribute identifier (@) operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.attribute, attribute
+ **/
+ public native function attribute (attributeName:*):XMLList;
+
+ /**
+ * Returns a list of attribute values for the given XML object. Use the name()
+ * method with the attributes() method to return the name of an attribute.
+ * Use @~~ to return the names of all attributes.
+ *
+ * @return The list of attribute values.
+ *
+ * @includeExample examples\XMLAttributesExample1.as -noswf
+ * @includeExample examples\XMLAttributesExample2.as -noswf
+ *
+ * @see XML#attribute()
+ * @see XML#name()
+ * @see operators.html#attribute_identifier @ operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.attributes, attributes
+ **/
+ public native function attributes():XMLList;
+
+ /**
+ * Lists the children of an XML object. An XML child is an XML element, text node, comment,
+ * or processing instruction.
+ *
+ *
Use the propertyName parameter to list the
+ * contents of a specific XML child. For example, to return the contents of a child named
+ * <first>, use child.name("first"). You can generate the same result
+ * by using the child's index number. The index number identifies the child's position in the
+ * list of other XML children. For example, name.child(0) returns the first child
+ * in a list.
+ *
+ *
Use an asterisk (~~) to output all the children in an XML document.
+ * For example, doc.child("~~").
+ *
+ *
Use the length() method with the asterisk (~~) parameter of the
+ * child() method to output the total number of children. For example,
+ * numChildren = doc.child("~~").length().
+ *
+ * @param propertyName The element name or integer of the XML child.
+ *
+ * @return An XMLList object of child nodes that match the input parameter.
+ *
+ * @includeExample examples\XML.child.1.as -noswf
+ *
+ * @see XML#elements()
+ * @see XMLList XMLList class
+ * @see XML#length()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.child, child
+ **/
+ public native function child(propertyName:Object):XMLList;
+
+ /**
+ * Identifies the zero-indexed position of this XML object within the context of its parent.
+ *
+ * @return The position of the object. Returns -1 as well as positive integers.
+ *
+ * @includeExample examples\XML.childIndex.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.childindex, childindex
+ **/
+ public native function childIndex():int;
+
+ /**
+ * Lists the children of the XML object in the sequence in which they appear. An XML child
+ * is an XML element, text node, comment, or processing instruction.
+ *
+ * @return An XMLList object of the XML object's children.
+ *
+ * @includeExample examples\XML.children.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.children, children
+ **/
+ public native function children():XMLList;
+
+ /**
+ * Lists the properties of the XML object that contain XML comments.
+ *
+ * @return An XMLList object of the properties that contain comments.
+ *
+ * @includeExample examples\XML.comments.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.comments, comments
+ **/
+ public native function comments():XMLList;
+
+ /**
+ * Compares the XML object against the given value parameter.
+ *
+ * @param value A value to compare against the current XML object.
+ *
+ * @return If the XML object matches the value parameter, then true; otherwise false.
+ *
+ * @includeExample examples\XML.contains.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.contains, contains
+ **/
+ public native function contains (value:XML):Boolean;
+
+ /**
+ * Returns a copy of the given XML object. The copy is a duplicate of the entire tree of nodes.
+ * The copied XML object has no parent and returns null if you attempt to call the
+ * parent() method.
+ *
+ * @return The copy of the object.
+ *
+ * @includeExample examples\XML.copy.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.copy, copy
+ **/
+ public native function copy():XML;
+
+ /**
+ * Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the
+ * XML object that have the given name parameter. The name parameter
+ * is optional. The name parameter can be a QName object, a String data type
+ * or any other data type that is then converted to a String data type.
+ *
+ *
To return all descendants, use the "~~" parameter. If no parameter is passed,
+ * the string "~~" is passed and returns all descendants of the XML object.
+ *
+ * @param name The name of the element to match.
+ *
+ * @return An XMLList object of matching descendants. If there are no descendants, returns an
+ * empty XMLList object.
+ *
+ * @includeExample examples\XMLDescendantsExample1.as -noswf
+ *
+ * @see operators.html#descendant_accessor descendant accessor (..) operator
+ *
+ * @includeExample examples\XML.descendants.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.descendants, descendants
+ **/
+ public native function descendants (name:Object="*"):XMLList;
+
+ /**
+ * Returns an object with the following properties set to the default values: ignoreComments,
+ * ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and
+ * prettyPrinting. The default values are as follows:
+ *
+ *
+ *
ignoreComments = true
+ *
ignoreProcessingInstructions = true
+ *
ignoreWhitespace = true
+ *
prettyIndent = 2
+ *
prettyPrinting = true
+ *
+ *
+ *
Note: You do not apply this method to an instance of the XML class; you apply it to
+ * XML, as in the following code: var df:Object = XML.defaultSettings().
+ *
+ * @return An object with properties set to the default settings.
+ *
+ * @includeExample examples\XML.defaultSettings.1.as -noswf
+ *
+ * @see XML#ignoreComments
+ * @see XML#ignoreProcessingInstructions
+ * @see XML#ignoreWhitespace
+ * @see XML#prettyIndent
+ * @see XML#prettyPrinting
+ * @see XML#setSettings()
+ * @see XML#settings()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.defaultSettings, defaultSettings
+ **/
+ public native static function defaultSettings ():Object;
+
+ /**
+ * Lists the elements of an XML object. An element consists of a start and an end tag;
+ * for example <first></first>. The name parameter
+ * is optional. The name parameter can be a QName object, a String data type,
+ * or any other data type that is then converted to a String data type. Use the name parameter to list a specific element. For example,
+ * the element "first" returns "John" in this example:
+ * <first>John</first>.
+ *
+ *
To list all elements, use the asterisk (~~) as the
+ * parameter. The asterisk is also the default parameter.
+ *
+ *
Use the length() method with the asterisk parameter to output the total
+ * number of elements. For example, numElement = addressbook.elements("~~").length().
+ *
+ * @param name The name of the element. An element's name is surrounded by angle brackets.
+ * For example, "first" is the name in this example:
+ * <first></first>.
+ *
+ * @return An XMLList object of the element's content. The element's content falls between the start and
+ * end tags. If you use the asterisk (~~) to call all elements, both the
+ * element's tags and content are returned.
+ *
+ * @includeExample examples\XML.elements.1.as -noswf
+ *
+ * @includeExample examples\XMLElementsExample1.as -noswf
+ *
+ * @see XML#child()
+ * @see XMLList XMLList class
+ * @see XML#length()
+ * @see XML#attribute()
+ * @see operators.html#dot_(XML) XML dot (.) operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.elements, elements
+ **/
+ public native function elements ( name:Object="*" ):XMLList;
+
+ /**
+ * Checks to see whether the object has the property specified by the p parameter.
+ *
+ * @param p The property to match.
+ *
+ * @return If the property exists, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasOwnProperty.1.as -noswf
+ *
+ * @includeExample examples\XML.hasOwnProperty.2.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasOwnProperty, hasOwnProperty
+ **/
+ public native function hasOwnProperty ( p:String ):Boolean;
+
+ /**
+ * Checks to see whether the XML object contains complex content. An XML object contains complex content if
+ * it has child elements. XML objects that representing attributes, comments, processing instructions,
+ * and text nodes do not have complex content. However, an object that contains these can
+ * still be considered to contain complex content (if the object has child elements).
+ *
+ * @return If the XML object contains complex content, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasComplexContent.1.as -noswf
+ *
+ * @see XML#hasSimpleContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasComplexContent, hasComplexContent
+ **/
+ public native function hasComplexContent( ):Boolean;
+
+ /**
+ * Checks to see whether the XML object contains simple content. An XML object contains simple content
+ * if it represents a text node, an attribute node, or an XML element that has no child elements.
+ * XML objects that represent comments and processing instructions do not contain simple
+ * content.
+ *
+ * @return If the XML object contains simple content, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasComplexContent.1.as -noswf
+ *
+ * @see XML#hasComplexContent()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasSimpleContent, hasSimpleContent
+ **/
+ public native function hasSimpleContent( ):Boolean;
+
+ /**
+ * Lists the namespaces for the XML object, based on the object's parent.
+ *
+ * @return An array of Namespace objects.
+ *
+ * @includeExample examples\XML.inScopeNamespaces.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.inScopeNamespaces, inScopeNamespaces
+ **/
+ public native function inScopeNamespaces( ):Array;
+
+ /**
+ * Inserts the given child2 parameter after the child1 parameter in this XML object and returns the
+ * resulting object. If the child1 parameter is null, the method
+ * inserts the contents of child2before all children of the XML object
+ * (in other words, after none). If child1 is provided, but it does not
+ * exist in the XML object, the XML object is not modified and undefined is
+ * returned.
+ *
+ *
If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on)
+ * undefined is returned.
+ *
+ * @param child1 The object in the source object that you insert before child2.
+ * @param child2 The object to insert.
+ *
+ * @return The resulting XML object or undefined.
+ *
+ * @includeExample examples\XML.insertChildAfter.1.as -noswf
+ *
+ * @see XML#insertChildBefore()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.insertChildAfter, insertChildAfter
+ **/
+ public native function insertChildAfter ( child1:Object , child2:Object):*;
+
+ /**
+ * Inserts the given child2 parameter before the child1 parameter
+ * in this XML object and returns the resulting object. If the child1 parameter
+ * is null, the method inserts the contents of
+ * child2after all children of the XML object (in other words, before
+ * none). If child1 is provided, but it does not exist in the XML object,
+ * the XML object is not modified and undefined is returned.
+ *
+ *
If you call this method on an XML child that is not an element (text, attributes,
+ * comments, pi, and so on) undefined is returned.
+ *
+ * @param child1 The object in the source object that you insert after child2.
+ * @param child2 The object to insert.
+ *
+ * @return The resulting XML object or undefined.
+ *
+ * @includeExample examples\XML.insertChildBefore.1.as -noswf
+ *
+ * @see XML#insertChildAfter()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.insertChildBefore, insertChildBefore
+ **/
+ public native function insertChildBefore ( child1:Object , child2:Object):*;
+
+ /**
+ * For XML objects, this method always returns the integer 1.
+ * The length() method of the XMLList class returns a value of 1 for
+ * an XMLList object that contains only one value.
+ *
+ * @return Always returns 1 for any XML object.
+ *
+ * @includeExample examples\XML.length.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.length, length
+ **/
+ public native function length ( ):int;
+
+ /**
+ * Gives the local name portion of the qualified name of the XML object.
+ *
+ * @return The local name as either a String or null.
+ *
+ * @includeExample examples\XML.localName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.localName, localName
+ **/
+ public native function localName ( ):Object;
+
+ /**
+ * Gives the qualified name for the XML object.
+ *
+ * @return The qualified name is either a QName or null.
+ *
+ * @includeExample examples\XML.name.1.as -noswf
+ *
+ * @includeExample examples\XML.name.2.as -noswf
+ *
+ * @see XML#attributes()
+ * @see operators.html#attribute_identifier
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.name, name
+ **/
+ public native function name ( ):Object;
+
+ /**
+ * If no parameter is provided, gives the namespace associated with the qualified name of
+ * this XML object. If a prefix parameter is specified, the method returns the namespace
+ * that matches the prefix parameter and that is in scope for the XML object. If there is no
+ * such namespace, the method returns undefined.
+ *
+ * @param prefix The prefix you want to match.
+ *
+ * @return Returns null, undefined, or a namespace.
+ *
+ * @includeExample examples\XML.namespace.1.as -noswf
+ *
+ * @includeExample examples\XML.namespace.2.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.namespace, namespace
+ **/
+ public native function namespace ( prefix:String = null ):*;
+
+ /**
+ * Lists namespace declarations associated with the XML object in the context of its parent.
+ *
+ * @return An array of Namespace objects.
+ *
+ * @includeExample examples\XML.namespaceDeclarations.1.as -noswf
+ *
+ * @see XML#namespace()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.namespaceDeclarations, namespaceDeclarations
+ **/
+ public native function namespaceDeclarations ( ): Array;
+
+ /**
+ * Specifies the type of node: text, comment, processing-instruction,
+ * attribute, or element.
+ *
+ * @return The node type used.
+ *
+ * @includeExample examples\XMLNodeKindExample1.as -noswf
+ *
+ * @see Operators.html#attribute_identifier
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.nodeKind, nodeKind
+ **/
+ public native function nodeKind ( ):String;
+
+ /**
+ * For the XML object and all descendant XML objects, merges adjacent text nodes and
+ * eliminates empty text nodes.
+ *
+ * @return The resulting normalized XML object.
+ *
+ * @includeExample examples\XML.normalize.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.normalize, normalize
+ **/
+ public native function normalize ( ):XML;
+
+ /**
+ * Returns the parent of the XML object. If the XML object has no parent, the method returns
+ * undefined.
+ *
+ * @return The parent XML object. Returns either a String or undefined.
+ *
+ * @includeExample examples\XML.parent.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.parent, parent
+ **/
+ public native function parent ( ):*;
+
+ /**
+ * If a name parameter is provided, lists all the children of the XML object
+ * that contain processing instructions with that name. With no parameters, the method
+ * lists all the children of the XML object that contain any processing instructions.
+ *
+ * @param name The name of the processing instructions to match.
+ *
+ * @return A list of matching child objects.
+ *
+ * @includeExample examples\XML.processingInstructions.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.processingInstructions, processingInstructions
+ **/
+ public native function processingInstructions ( name:String = "*" ):XMLList;
+
+ /**
+ * Inserts a copy of the provided child object into the XML element before any existing XML
+ * properties for that element.
+ *
+ * @param value The object to insert.
+ *
+ * @return The resulting XML object.
+ *
+ * @includeExample examples\XML.prependChild.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.prependChild, prependChild
+ **/
+ public native function prependChild ( value:Object ):XML;
+
+ /**
+ * Checks whether the property p is in the set of properties that can be iterated in a
+ * for..in statement applied to the XML object. Returns true only
+ * if toString(p) == "0".
+ *
+ * @param p The property that you want to check.
+ *
+ * @return If the property can be iterated in a for..in statement, true;
+ * otherwise, false.
+ *
+ * @includeExample examples\XML.propertyIsEnumerable.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.propertyIsEnumerable, propertyIsEnumerable
+ **/
+ public native function propertyIsEnumerable ( p:String ):Boolean;
+
+ /**
+ * Removes the given namespace for this object and all descendants. The removeNamespaces()
+ * method does not remove a namespace if it is referenced by the object's qualified name or the
+ * qualified name of the object's attributes.
+ *
+ * @param ns The namespace to remove.
+ *
+ * @return A copy of the resulting XML object.
+ *
+ * @includeExample examples\XML.removeNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.removeNamespace, removeNamespace
+ **/
+ public native function removeNamespace ( ns:Namespace ):XML;
+
+ /**
+ * Replaces the properties specified by the propertyName parameter
+ * with the given value parameter.
+ * If no properties match propertyName, the XML object is left unmodified.
+ *
+ * @param propertyName Can be a
+ * numeric value, an unqualified name for a set of XML elements, a qualified name for a set of
+ * XML elements, or the asterisk wildcard ("*").
+ * Use an unqualified name to identify XML elements in the default namespace.
+ *
+ * @param value The replacement value. This can be an XML object, an XMLList object, or any value
+ * that can be converted with toString().
+ *
+ * @return The resulting XML object, with the matching properties replaced.
+ *
+ * @includeExample examples\XML.replace.1.as -noswf
+ *
+ * @includeExample examples\XML.replace.2.as -noswf
+ *
+ * @includeExample examples\XML.replace.3.as -noswf
+ *
+ * @includeExample examples\XML.replace.4.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.replace, replace
+ **/
+ public native function replace ( propertyName:Object , value:XML ):XML
+
+ /**
+ * Replaces the child properties of the XML object with the specified set of XML properties,
+ * provided in the value parameter.
+ *
+ * @param value The replacement XML properties. Can be a single XML object or an XMLList object.
+ *
+ * @return The resulting XML object.
+ *
+ * @includeExample examples\XML.setChildren.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setChildren, setChildren
+ **/
+ public native function setChildren ( value:Object ):XML;
+
+ /**
+ * Changes the local name of the XML object to the given name parameter.
+ *
+ * @param name The replacement name for the local name.
+ *
+ * @includeExample examples\XML.setLocalName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setLocalName, setLocalName
+ **/
+ public native function setLocalName ( name:String ):void;
+
+ /**
+ * Sets the name of the XML object to the given qualified name or attribute name.
+ *
+ * @param name The new name for the object.
+ *
+ * @includeExample examples\XML.setName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setName, setName
+ **/
+ public native function setName ( name:String ):void;
+
+ /**
+ * Sets the namespace associated with the XML object.
+ *
+ * @param ns The new namespace.
+ *
+ * @includeExample examples\XML.setNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setNamespace, setNamespace
+ **/
+ public native function setNamespace ( ns:Namespace ):void;
+
+ /**
+ * Sets values for the following XML properties: ignoreComments,
+ * ignoreProcessingInstructions, ignoreWhitespace,
+ * prettyIndent, and prettyPrinting.
+ *
+ * The following are the default settings, which are applied if no setObj parameter
+ * is provided:
+ *
+ *
+ *
XML.ignoreComments = true
+ *
XML.ignoreProcessingInstructions = true
+ *
XML.ignoreWhitespace = true
+ *
XML.prettyIndent = 2
+ *
XML.prettyPrinting = true
+ *
+ *
+ *
Note: You do not apply this method to an instance of the XML class; you apply it to
+ * XML, as in the following code: XML.setSettings().
+ *
+ * @param rest An object with each of the following properties:
+ *
+ *
+ *
+ * @includeExample examples\XML.defaultSettings.1.as -noswf
+ *
+ * @see XML#ignoreComments
+ * @see XML#ignoreProcessingInstructions
+ * @see XML#ignoreWhitespace
+ * @see XML#prettyIndent
+ * @see XML#prettyPrinting
+ * @see XML#defaultSettings()
+ * @see XML#setSettings()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.settings, settings
+ **/
+ public native static function settings ():Object;
+
+ /**
+ * Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.
+ *
+ * @return The list of properties.
+ *
+ * @includeExample examples\XML.text.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.text, text
+ **/
+ public native function text ( ):XMLList;
+
+ /**
+ * Returns a string representation of the XML object. The rules for this conversion depend on whether
+ * the XML object has simple content or complex content:
+ *
+ *
+ *
If the XML object has simple content, toString() returns the String contents of the
+ * XML object with the following stripped out: the start tag, attributes, namespace declarations, and
+ * end tag.
+ *
+ *
+ *
+ *
If the XML object has complex content, toString() returns an XML encoded String
+ * representing the entire XML object, including the start tag, attributes, namespace declarations,
+ * and end tag.
+ *
+ *
+ *
To return the entire XML object every time, use toXMLString().
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XMLToStringExample1.as -noswf
+ * @includeExample examples\XMLToStringExample2.as -noswf
+ *
+ * @see XML#hasSimpleContent()
+ * @see XML#hasComplexContent()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toString, toString
+ *
+ **/
+ public native function toString():String;
+
+ /**
+ * Returns a string representation of the XML object. Unlike the toString() method,
+ * the toXMLString() method always returns the start tag, attributes,
+ * and end tag of the XML object, regardless of whether the XML object has simple content or complex
+ * content. (The toString() method strips out these items for XML objects that contain
+ * simple content.)
+ *
+ * @oldexample The following XML object has simple content:
+ *
+ * <item>wiper blade</item>
+ *
+ *
The toString() method for this object returns the following String:
+ *
<item>wiper blade</item>
+ *
+ *
+ *
+ * The following XML object has complex content:
+ *
+ * Note: The white space formatting of the returned String depends on the setting of the
+ * prettyPrintingproperty of the XML class. In this example, prettyPrinting
+ * is set to false.
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XML.toXMLString.1.as -noswf
+ *
+ * @see XML#toString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toXMLString, toXMLString
+ **/
+ public native function toXMLString ( ):String;
+
+ /**
+ * Returns the XML object.
+ *
+ * @return Returns the primitive value of an XML instance.
+ *
+ * @includeExample examples\XML.valueOf.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.valueOf, valueOf
+ **/
+ public native function valueOf ( ):XML;
+
+
+
+ /**
+ * Determines whether XML comments are ignored
+ * when XML objects parse the source XML data. By default, the comments are ignored
+ * (true). To include XML comments, set this property to false.
+ * The ignoreComments property is used only during the XML parsing, not during
+ * the call to any method such as myXMLObject.child(~~).toXMLString().
+ * If the source XML includes comment nodes, they are kept or discarded during the XML parsing.
+ *
+ * @includeExample examples\XML.ignoreComments.1.as -noswf
+ *
+ * @see XML#child()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreComments, ignoreComments
+ **/
+ public native static function get ignoreComments():Boolean;
+ public native static function set ignoreComments(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether XML
+ * processing instructions are ignored when XML objects parse the source XML data.
+ * By default, the processing instructions are ignored (true). To include XML
+ * processing instructions, set this property to false. The
+ * ignoreProcessingInstructions property is used only during the XML parsing,
+ * not during the call to any method such as myXMLObject.child(~~).toXMLString().
+ * If the source XML includes processing instructions nodes, they are kept or discarded during
+ * the XML parsing.
+ *
+ * @includeExample examples\XML.ignoreProcessingInstructions.1.as -noswf
+ *
+ * @see XML#child()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreProcessingInstructions, ignoreProcessingInstructions
+ **/
+ public native static function get ignoreProcessingInstructions():Boolean;
+ public native static function set ignoreProcessingInstructions(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether white space characters
+ * at the beginning and end of text nodes are ignored during parsing. By default,
+ * white space is ignored (true). If a text node is 100% white space and the
+ * ignoreWhitespace property is set to true, then the node is not created.
+ * To show white space in a text node, set the ignoreWhitespace property to
+ * false.
+ *
+ * @includeExample examples\XML.ignoreWhitespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreWhitespace, ignoreWhitespace
+ **/
+ public native static function get ignoreWhitespace():Boolean;
+ public native static function set ignoreWhitespace(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether the toString()
+ * and toXMLString() methods normalize white space characters between some tags.
+ * The default value is true.
+ *
+ * @includeExample examples\XML.prettyPrinting.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @see #prettyIndent
+ * @see #toString()
+ * @see #toXMLString()
+ * @keyword XML, XML.prettyPrinting, prettyPrinting
+ **/
+ public native static function get prettyPrinting():Boolean;
+ public native static function set prettyPrinting(newPretty:Boolean):void;
+
+ /**
+ * Determines the amount of indentation applied by
+ * the toString() and toXMLString() methods when
+ * the XML.prettyPrinting property is set to true.
+ * Indentation is applied with the space character, not the tab character.
+ *
+ * The default value is 2.
+ *
+ * @includeExample examples\XML.prettyIndent.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @see #prettyPrinting
+ * @see #toString()
+ * @see #toXMLString()
+ * @keyword XML, XML.prettyIndent, prettyIndent
+ **/
+ public native static function get prettyIndent():int;
+ public native static function set prettyIndent(newIndent:int):void;
+}
+}
+package {
+//
+// XMLList
+//
+// Based on the ECMA E4X Specification, 1st Edition.
+
+/**
+ * An XMLList object is an ordered collection of properties. An XMLList object represents an
+ * XML document, an XML fragment, or an arbitrary collection of XML objects.
+ *
+ *
An XMLList object with one XML element is treated the same as an XML object.
+ * When there is one XML element, all methods that are available
+ * for the XML object are also available for the XMLList object.
+ *
+ *
In the following example, example.two is an XMLList object of length 1,
+ * so you can call any XML method on it.
The following table lists the XML methods that are not included in the XMLList class, but
+ * that you can use when your XMLList object has only one XML element. If you attempt to use these
+ * methods with anything other than one XML element (zero or more than one
+ * element), an exception is thrown.
+ *
+ *
+ *
XML methods
+ *
addNamespace()
+ *
appendChild()
+ *
childIndex()
+ *
inScopeNamespace()
+ *
insertChildAFter()
+ *
insertChildBefore()
+ *
name()
+ *
namespace()
+ *
localName()
+ *
namespaceDeclarations()
+ *
nodeKind()
+ *
prependChild()
+ *
removeNamespace()
+ *
replace()
+ *
setChildren()
+ *
setLocalName()
+ *
setName()
+ *
setNamespace()
+ *
+ *
+ *
This class (along with the XML, Namespace, and QName classes) implements powerful XML-handling
+ * standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2).
+ *
+ * @includeExample examples\XMLListExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList
+ * @see XML
+ * @see Namespace
+ * @see QName
+ */
+
+public final dynamic class XMLList
+{
+ /**
+ * Creates a new XMLList object.
+ *
+ * @param value Any object that can be converted to an XMLList object by using the top-level XMLList() function.
+ *
+ * @return If no arguments are included, the constructor returns an empty XMLList. If an XMLList object is included as
+ * the parameter, the constructor returns a shallow copy of the XMLList object. If the parameter is an object of a type
+ * other than XMLList, the constructor converts the object to an XMLList object and returns that object.
+ *
+ * @see global#XMLList() top-level XMLList() function
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList
+ **/
+ public native function XMLList (value:Object);
+
+ /**
+ * Calls the attribute() method of each XML object and returns an XMLList object
+ * of the results. The results match the given attributeName parameter. If there is no
+ * match, the attribute() method returns an empty XMLList object.
+ *
+ * @param attributeName The name of the attribute that you want to include in an XMLList object.
+ *
+ * @return An XMLList object of matching XML objects or an empty XMLList object.
+ *
+ * @see XML#attribute()
+ * @see XML#attributes()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.attribute, attribute
+ **/
+ public native function attribute (attributeName:* ):XMLList;
+
+ /**
+ * Calls the attributes() method of each XML object and
+ * returns an XMLList object of attributes for each XML object.
+ *
+ * @return An XMLList object of attributes for each XML object.
+ *
+ * @see XML#attribute()
+ * @see XML#attributes()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.attributes, attributes
+ **/
+ public native function attributes ( ):XMLList;
+
+ /**
+ * Calls the child() method of each XML object and returns an XMLList object that
+ * contains the results in order.
+ *
+ * @param propertyName The element name or integer of the XML child.
+ *
+ * @return An XMLList object of child nodes that match the input parameter.
+ *
+ * @see XML#child()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.child, child
+ **/
+ public native function child ( propertyName:Object ):XMLList;
+
+ /**
+ * Calls the children() method of each XML object and
+ * returns an XMLList object that contains the results.
+ *
+ * @return An XMLList object of the children in the XML objects.
+ *
+ * @oldexample The following sets a variable to an XMLList of children of all the items in the catalog XMLList:
+ *
+ *
var allitemchildren:XMLList = catalog.item.children();
+
+ * @oldexample The following sets a variable to an XMLList of all grandchildren of all the items in the catalog XMLList that
+ * have the name size:
+ *
+ *
var grandchildren:XMLList = catalog.item.children().size;
+ *
+ * @see XML#children()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.children, children
+ **/
+ public native function children ( ):XMLList;
+
+ /**
+ * Calls the comments() method of each XML object and returns
+ * an XMLList of comments.
+ *
+ * @return An XMLList of the comments in the XML objects.
+ *
+ * @see XML#comments()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.comments, comments
+ **/
+ public native function comments ( ):XMLList;
+
+ /**
+ * Checks whether the XMLList object contains an XML object that is equal to the given
+ * value parameter.
+ *
+ * @param value An XML object to compare against the current XMLList object.
+ *
+ * @return If the XMLList contains the XML object declared in the value parameter,
+ * then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.contains, contains
+ **/
+ public native function contains ( value:XML ):Boolean;
+
+ /**
+ * Returns a copy of the given XMLList object. The copy is a duplicate of the entire tree of nodes.
+ * The copied XML object has no parent and returns null if you attempt to call the parent() method.
+ *
+ * @return The copy of the XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.copy, copy
+ **/
+ public native function copy ( ):XMLList;
+
+ /**
+ * Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object
+ * that have the given name parameter. The name parameter can be a
+ * QName object, a String data type, or any other data type that is then converted to a String
+ * data type.
+ *
+ *
To return all descendants, use
+ * the asterisk (~~) parameter. If no parameter is passed,
+ * the string "~~" is passed and returns all descendants of the XML object.
+ *
+ * @return An XMLList object of the matching descendants (children, grandchildren, and so on) of the XML objects
+ * in the original list. If there are no descendants, returns an empty XMLList object.
+ *
+ * @param name The name of the element to match.
+ *
+ * @see XML#descendants()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.descendants, descendants
+ **/
+ public native function descendants (name:Object="*"):XMLList;
+
+ /**
+ * Calls the elements() method of each XML object. The name parameter is
+ * passed to the descendants() method. If no parameter is passed, the string "~~" is passed to the
+ * descendants() method.
+ *
+ * @param name The name of the elements to match.
+ *
+ * @return An XMLList object of the matching child elements of the XML objects.
+ *
+ * @see XML#elements()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.elements, elements
+ **/
+ public native function elements (name:Object="*"):XMLList;
+
+ /**
+ * Checks for the property specified by p.
+ *
+ * @param p The property to match.
+ *
+ * @return If the parameter exists, then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasOwnProperty, hasOwnProperty
+ **/
+ public native function hasOwnProperty(p:String):Boolean;
+
+ /**
+ * Checks whether the XMLList object contains complex content. An XMLList object is
+ * considered to contain complex content if it is not empty and either of the following conditions is true:
+ *
+ *
+ *
The XMLList object contains a single XML item with complex content.
+ *
The XMLList object contains elements.
+ *
+ *
+ * @return If the XMLList object contains complex content, then true; otherwise false.
+ *
+ * @see XML#hasComplexContent()
+ * @see XML#hasSimpleContent()
+ * @see #hasSimpleContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasComplexContent, hasComplexContent
+ **/
+ public native function hasComplexContent( ):Boolean;
+
+ /**
+ * Checks whether the XMLList object contains simple content. An XMLList object is
+ * considered to contain simple content if one or more of the following
+ * conditions is true:
+ *
+ *
The XMLList object is empty
+ *
The XMLList object contains a single XML item with simple content
+ *
The XMLList object contains no elements
+ *
+ *
+ * @return If the XMLList contains simple content, then true; otherwise false.
+ *
+ * @see XML#hasComplexContent()
+ * @see XML#hasSimpleContent()
+ * @see #hasComplexContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasSimpleContent, hasSimpleContent
+ **/
+ public native function hasSimpleContent( ):Boolean;
+
+ /**
+ * Returns the number of properties in the XMLList object.
+ *
+ * @return The number of properties in the XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.length, length
+ **/
+ public native function length ( ):int;
+
+ /**
+ * Merges adjacent text nodes and eliminates empty text nodes for each
+ * of the following: all text nodes in the XMLList, all the XML objects
+ * contained in the XMLList, and the descendants of all the XML objects in
+ * the XMLList.
+ *
+ * @return The normalized XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.normalize, normalize
+ **/
+ public native function normalize ( ):XMLList;
+
+ /**
+ * Returns the parent of the XMLList object if all items in the XMLList object have the same parent.
+ * If the XMLList object has no parent or different parents, the method returns undefined.
+ *
+ * @return Returns the parent XML object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.parent, parent
+ **/
+ public native function parent ( ):Object;
+
+ /**
+ * If a name parameter is provided, lists all the children of the XMLList object that
+ * contain processing instructions with that name. With no parameters, the method lists all the
+ * children of the XMLList object that contain any processing instructions.
+ *
+ * @param name The name of the processing instructions to match.
+ *
+ * @return An XMLList object that contains the processing instructions for each XML object.
+ *
+ * @see XML#processingInstructions()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.processingInstructions, processingInstructions
+ **/
+ public native function processingInstructions ( name:String = "*"):XMLList;
+
+ /**
+ * Checks whether the property p is in the set of properties that can be iterated in a for..in statement
+ * applied to the XMLList object. This is true only if toNumber(p) is greater than or equal to 0
+ * and less than the length of the XMLList object.
+ *
+ * @param p The index of a property to check.
+ *
+ * @return If the property can be iterated in a for..in statement, then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.propertyIsEnumerable, propertyIsEnumerable
+ **/
+ public native function propertyIsEnumerable ( p:String ):Boolean;
+
+ /**
+ * Calls the text() method of each XML
+ * object and returns an XMLList object that contains the results.
+ *
+ * @return An XMLList object of all XML properties of the XMLList object that represent XML text nodes.
+ *
+ * @see XML#text()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.text, text
+ **/
+ public native function text ( ):XMLList;
+
+ /**
+ * Returns a string representation of all the XML objects in an XMLList object. The rules for
+ * this conversion depend on whether the XML object has simple content or complex content:
+ *
+ *
+ *
If the XML object has simple content, toString() returns the string contents of the
+ * XML object with the following stripped out: the start tag, attributes, namespace declarations, and
+ * end tag.
+ *
+ *
+ *
+ *
If the XML object has complex content, toString() returns an XML encoded string
+ * representing the entire XML object, including the start tag, attributes, namespace declarations,
+ * and end tag.
+ *
+ *
+ *
To return the entire XML object every time, use the toXMLString() method.
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XMLToStringExample1.as -noswf
+ * @includeExample examples\XMLToStringExample2.as -noswf
+ *
+ * @see XMLList#hasSimpleContent()
+ * @see XMLList#hasComplexContent()
+ * @see XMLList#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toString, toString
+ *
+ **/
+ public native function toString( ):String;
+
+ /**
+ * Returns a string representation of all the XML objects in an XMLList object.
+ * Unlike the toString() method, the toXMLString()
+ * method always returns the start tag, attributes,
+ * and end tag of the XML object, regardless of whether the XML object has simple content
+ * or complex content. (The toString() method strips out these items for XML
+ * objects that contain simple content.)
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @see XMLList#toString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toXMLString, toXMLString
+ **/
+ public native function toXMLString( ):String;
+
+ /**
+ * Returns the XMLList object.
+ *
+ * @return Returns the current XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.valueOf, valueOf
+ **/
+ public native function valueOf( ):XMLList;
+
+}
+}
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache
new file mode 100644
index 0000000..dd2cbda
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache
new file mode 100644
index 0000000..38cd43e
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache
new file mode 100644
index 0000000..7fad70b
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache
new file mode 100644
index 0000000..dddaefd
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache
new file mode 100644
index 0000000..d586ff0
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache
new file mode 100644
index 0000000..1105dd8
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache
new file mode 100644
index 0000000..d092715
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1 b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1
new file mode 100644
index 0000000..321766f
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1 differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1 b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1
new file mode 100644
index 0000000..7e1ce9d
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1 differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1 b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1
new file mode 100644
index 0000000..ae30180
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1 differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..225a55b
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2 b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2
new file mode 100644
index 0000000..ecdb723
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2 differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml
new file mode 100644
index 0000000..d798bc4
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml b/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml
new file mode 100644
index 0000000..5ca0b77
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml b/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml
new file mode 100644
index 0000000..4d25e6b
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExamples/metadata.xml b/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExamples/metadata.xml
new file mode 100644
index 0000000..e28196e
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExamples/metadata.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..587fd51
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html
@@ -0,0 +1,80 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html
new file mode 100644
index 0000000..0540f73
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html
@@ -0,0 +1,77 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..3c046a7
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html
@@ -0,0 +1,107 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html
new file mode 100644
index 0000000..cb89d8c
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html
@@ -0,0 +1,104 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..ffb8e68
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html
@@ -0,0 +1,53 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html
new file mode 100644
index 0000000..d6cec74
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html
@@ -0,0 +1,50 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd
new file mode 100644
index 0000000..88f8b27
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd
new file mode 100644
index 0000000..24d2235
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml
new file mode 100644
index 0000000..b19d93f
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ v1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html
new file mode 100644
index 0000000..6de8d75
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html
@@ -0,0 +1,54 @@
+
+
+
+
+FlexApp
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat
new file mode 100644
index 0000000..c600a4f
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat
@@ -0,0 +1,3 @@
+SET OPTS=-include-libraries+=..\..\frameworks\libs\automation.swc;..\..\frameworks\libs\automation_agent.swc;..\..\frameworks\libs\automation_dmv.swc;..\..\frameworks\libs\automation_flashflexkit.swc;..\..\frameworks\libs\qtp.swc
+
+..\..\bin\mxmlc.exe %OPTS% runtimeloading.mxml
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml
new file mode 100644
index 0000000..03af971
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..50fcbb3
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html
new file mode 100644
index 0000000..a1dc36b
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..20ee809
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html
new file mode 100644
index 0000000..bb1f7ed
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..7ac650d
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html
new file mode 100644
index 0000000..d16ac8c
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd
new file mode 100644
index 0000000..94b0d99
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd
new file mode 100644
index 0000000..d932f99
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml
new file mode 100644
index 0000000..e389ad8
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ v1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..8af9492
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html
new file mode 100644
index 0000000..1c5ce79
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..a8b3b64
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html
new file mode 100644
index 0000000..3cf5fc4
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf differ
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..13a33b7
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html
new file mode 100644
index 0000000..0885430
--- /dev/null
+++ b/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
new file mode 100644
index 0000000..25cb955
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index
new file mode 100644
index 0000000..0f9992a
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
new file mode 100644
index 0000000..6b2aaa7
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree b/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree
new file mode 100644
index 0000000..d171356
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
new file mode 100644
index 0000000..1bc9206
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ
diff --git a/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
new file mode 100644
index 0000000..aae91fc
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
new file mode 100644
index 0000000..5ca0b77
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
new file mode 100644
index 0000000..a303e41
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/version.ini b/.metadata/version.ini
new file mode 100644
index 0000000..c335d75
--- /dev/null
+++ b/.metadata/version.ini
@@ -0,0 +1 @@
+com.adobe.flexbuilder.standalone=1
\ No newline at end of file
diff --git a/examples/.metadata/.lock b/examples/.metadata/.lock
new file mode 100644
index 0000000..e69de29
diff --git a/examples/.metadata/.log b/examples/.metadata/.log
new file mode 100644
index 0000000..837ac15
--- /dev/null
+++ b/examples/.metadata/.log
@@ -0,0 +1,382 @@
+!SESSION 2009-03-15 20:47:41.113 -----------------------------------------------
+eclipse.buildId=unknown
+java.version=1.5.0_16
+java.vendor=Apple Inc.
+BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
+Command-line arguments: -os macosx -ws carbon -arch x86 -data /Users/comcast/Documents/code/core_lib/openpyro-git/examples
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.804
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.810
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.815
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.816
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.816
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.817
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.817
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.817
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.818
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.819
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.820
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.820
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.820
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
+
+!ENTRY org.tigris.subversion.subclipse.core 4 0 2009-03-15 20:47:45.821
+!MESSAGE No subversion client interface found.
+!STACK 0
+org.tigris.subversion.svnclientadapter.SVNClientException: No subversion client interface found.
+ at org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory.getPreferredSVNClientType(SVNClientAdapterFactory.java:86)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.setSvnClientInterface(SVNClientManager.java:59)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.getSvnClientInterface(SVNClientManager.java:97)
+ at org.tigris.subversion.subclipse.core.SVNClientManager.createSVNClient(SVNClientManager.java:114)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.createSVNClient(SVNProviderPlugin.java:415)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getAdminDirectoryName(SVNProviderPlugin.java:536)
+ at org.tigris.subversion.subclipse.core.SVNProviderPlugin.isAdminDirectory(SVNProviderPlugin.java:590)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener$2.visit(SyncFileChangeListener.java:116)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:76)
+ at org.tigris.subversion.subclipse.core.resourcesListeners.SyncFileChangeListener.resourceChanged(SyncFileChangeListener.java:75)
+ at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
+ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
+ at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
+ at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
+ at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:295)
+ at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:133)
+ at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
diff --git a/examples/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf b/examples/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf
new file mode 100644
index 0000000..25090bb
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-1001260215/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-1001260215/library.swf
new file mode 100644
index 0000000..5b15918
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-1001260215/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-237160479/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-237160479/library.swf
new file mode 100644
index 0000000..4b8e11a
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-237160479/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-264568295/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-264568295/library.swf
new file mode 100644
index 0000000..4b8e11a
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-264568295/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-973852399/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-973852399/library.swf
new file mode 100644
index 0000000..5b15918
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/-973852399/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf
new file mode 100644
index 0000000..73a07fa
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/1271930913/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png
new file mode 100644
index 0000000..0a23649
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_component_icon_small.png differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png
new file mode 100644
index 0000000..7e39ddd
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/flash_container_icon_small.png differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf
new file mode 100644
index 0000000..3180998
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/339014625/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf
new file mode 100644
index 0000000..e8f64ec
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/530497369/library.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache
new file mode 100644
index 0000000..ed23602
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/SwcCache/swcPaths.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as
new file mode 100644
index 0000000..6b77c4f
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/extraClassPath/Global.as
@@ -0,0 +1,9337 @@
+/****************************************************************************
+*
+* ADOBE CONFIDENTIAL
+* ___________________
+*
+* Copyright [2002] - [2006] Adobe Macromedia Software LLC and its licensors
+* All Rights Reserved.
+*
+* NOTICE: All information contained herein is, and remains the property
+* of Adobe Macromedia Software LLC and its licensors, if any.
+* The intellectual and technical concepts contained herein are proprietary
+* to Adobe Macromedia Software LLC and its licensors and may be covered by
+* U.S. and Foreign Patents, patents in process, and are protected by trade
+* secret or copyright law. Dissemination of this information or reproduction
+* of this material is strictly forbidden unless prior written permission is
+* obtained from Adobe Macromedia Software LLC and its licensors.
+****************************************************************************/
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// ArgumentError object
+//****************************************************************************
+/**
+ * The ArgumentError class represents an error that occurs when the arguments
+ * supplied in a function do not match the arguments defined for
+ * that function. Possible sources of this error include a function being called with
+ * the wrong number of arguments, an argument of the incorrect type, or an argument that is
+ * invalid.
+ *
+ * @tiptext An ArgumentError is thrown when the parameter values supplied during a
+ * function call do not match the parameters defined for that function.
+ *
+ * @includeExample examples\ArgumentErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+public dynamic class ArgumentError extends Error
+{
+ /**
+ * Creates an ArgumentError object.
+ * @param message A string associated with the error.
+ */
+ public native function ArgumentError(message:String = "");
+}
+
+}
+package {
+/**
+ * An arguments object is used to store and access a function's arguments.
+ * While inside the function's body it can be accessed with the local arguments
+ * variable.
+ *
+ * The arguments are stored as array elements, the first is accessed as
+ * arguments[0], the second as arguments[1], etc. The
+ * arguments.length property indicates the number of arguments passed to
+ * the function. Note that there may be a different number of arguments passed in than
+ * the function declares.
+ *
+ *
+ * ActionScript 3.0 has no arguments.caller property, which did exist in previous versions of
+ * ActionScript. To get a reference to the function
+ * that called the current function, you must pass a reference to that function as an
+ * argument. An example of this technique can be found in the example for arguments.callee.
+ *
+ *
ActionScript 3.0 supports a new ...(rest) statement that is recommended instead of the
+ * arguments class.
+ *
+ * @tiptext An arguments object is used to store and access a function's arguments.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ *
+ * @includeExample examples\ArgumentsExample.as -noswf
+ * @see statements.html#..._(rest)_parameter ...(rest) statement
+ * @see Function
+ */
+public class arguments {
+ /**
+ * A reference to the currently executing function.
+ *
+ * @includeExample examples\arguments.callee.1.as -noswf
+ * @tiptext A reference to the currently executing function.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ */
+ public var callee:Function;
+
+
+ /**
+ * The number of arguments passed to the function. This may be more or less
+ * than the function declares.
+ *
+ * @tiptext The number of parameters passed to the function.
+ * @playerversion Flash 8
+ * @langversion 3.0
+ */
+ public var length:Number;
+}
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Array object
+//****************************************************************************
+
+/**
+ * The Array class lets you access and manipulate arrays. Array indices are zero-based, which means that the first element in the array is [0], the second element is [1], and so on. To create an Array object, you use the new Array() constructor . Array() can also be
+ * invoked as a function. And, you can use the array access ([]) operator to initialize an array or access the elements of an array.
+ *
You can store a wide variety of data types in an array element, including numbers, strings, objects, and even other arrays. You can create a multidimensional array by creating an indexed array and assigning to each of its elements a different indexed array. Such an array is considered multidimensional because it can be used to represent data in a table.
+ *
Arrays are sparse arrays meaning there may be an element at index 0 and another at index 5, but nothing in the index positions between those two elements. In such a case, the elements in positions 1 through 4 are undefined, which indicates the absence of an element, not necessarily the presence of an element with the value undefined.
+ *
+ *
Array assignment is by reference rather than by value. When you assign one array variable to another array variable, both refer to the same array:
+ *
+ * var oneArray:Array = new Array("a", "b", "c");
+ * var twoArray:Array = oneArray; // Both array variables refer to the same array.
+ * twoArray[0] = "z";
+ * trace(oneArray); // Output: z,b,c.
+ *
+ *
The Array class should not be used to create associative arrays, which are different data structures that contain named elements instead of numbered elements. You should use the Object class to create associative arrays (also called hashes). Although ActionScript permits you to create associative arrays using the Array class, you cannot use any of the Array class methods or properties.
+ *
You can subclass Array and override or add methods. However, you must specify the subclass as dynamic
+ * or you will lose the ability to store data in an array.
+ *
+ * @tiptext Lets you access and manipulate indexed arrays.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\ArrayExample.as -noswf
+ *
+ * @oldexample In the following example, my_array contains four months of the year:
+ *
+ * @helpid x208A1
+ * @refpath Objects/Core/Array
+ * @keyword Array, Array object, built-in class
+ *
+ * @see operators.html#array_access [] (array access)
+ * @see Object Object class
+ */
+public dynamic class Array
+{
+
+ /**
+ * Specifies case-insensitive sorting for the Array class sorting methods. You can use this constant
+ * for the options parameter in the sort() or sortOn() method.
+ *
The value of this constant is 1.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F6
+ */
+ public static const CASEINSENSITIVE:uint = 1;
+ /**
+ * Specifies descending sorting for the Array class sorting methods.
+ * You can use this constant for the options parameter in the sort()
+ * or sortOn() method.
+ *
The value of this constant is 2.
+ *
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F7
+ */
+ public static const DESCENDING:uint = 2;
+ /**
+ * Specifies numeric (instead of character-string) sorting for the Array class sorting methods.
+ * Including this constant in the options
+ * parameter causes the sort() and sortOn() methods
+ * to sort numbers as numeric values, not as strings of numeric characters.
+ * Without the NUMERIC constant, sorting treats each array element as a
+ * character string and produces the results in Unicode order.
+ *
+ *
For example, given the array of values [2005, 7, 35], if the NUMERIC
+ * constant is not included in the options parameter, the
+ * sorted array is [2005, 35, 7], but if the NUMERIC constant is included,
+ * the sorted array is [7, 35, 2005].
+ *
+ *
This constant applies only to numbers in the array; it does
+ * not apply to strings that contain numeric data such as ["23", "5"].
+ *
+ *
The value of this constant is 16.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F8
+ */
+ public static const NUMERIC:uint = 16;
+ /**
+ * Specifies that a sort returns an array that consists of array indices as a result of calling
+ * the sort() or sortOn() method. You can use this constant
+ * for the options parameter in the sort() or sortOn()
+ * method, so you have access to multiple views on the array elements while the original array is unmodified.
+ *
The value of this constant is 8.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217F9
+ */
+ public static const RETURNINDEXEDARRAY:uint = 8;
+ /**
+ * Specifies the unique sorting requirement for the Array class sorting methods.
+ * You can use this constant for the options parameter in the sort() or sortOn()
+ * method. The unique sorting option terminates the sort if any two elements
+ * or fields being sorted have identical values.
+ *
The value of this constant is 4.
+
+ * @see Array#sort()
+ * @see Array#sortOn()
+ * @helpid x217FA
+ */
+ public static const UNIQUESORT:uint = 4;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * A non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1.
+ *
Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\Array.length.1.as -noswf
+ *
+ * @helpid x2089F
+ * @refpath Objects/Core/Array/Properties/length
+ * @keyword array.length, length
+ */
+ public native function get length():uint;
+ public native function set length(newLength:uint);
+
+
+ /**
+ * Lets you create an array of the specified length.
+ * If you don't specify any parameters, an array with a length of 0 is created.
+ * If you specify a length, an array is created with length number of elements.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param numElements An integer that specifies the number of elements in the array.
+ *
+ * @throws RangeError If the sole argument is a number that is not an integer greater than or equal to zero.
+ * @includeExample examples\Array.1.as -noswf
+ * @includeExample examples\Array.2.as -noswf
+ *
+ * @see operators.html#array_access [] array access
+ * @see #length Array.length
+ *
+ */
+ public native function Array(numElements:int = 0);
+
+ /**
+ * Lets you create an array containing the specified elements.
+ * The values specified can be of any type.
+ * The first element in an array always has an index or position of 0.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ * @param ...values A comma-separated list of one or more arbitrary values.
+ *
Note: If only a single numeric parameter is passed to the Array constructor,
+ * it is assumed to specify the array's length property.
+ * @throws RangeError If the sole argument is a number that is not an integer greater than or equal to zero.
+ * @includeExample examples\Array.3.as -noswf
+ * @see operators.html#array_access [] array access
+ * @see #length Array.length
+ */
+ public native function Array(...values);
+
+ /**
+ * Concatenates the elements specified in the parameters with the elements in an array and creates a new array. If the parameters specify an array, the elements of that array are concatenated.
+ *
+ * @tiptext Concatenates the elements specified in the parameters.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args A value of any data type (such as numbers, elements, or strings) to be concatenated in a new array. If you don't
+ * pass any values, the new array is a duplicate of the original array.
+ *
+ * @return An array that contains the elements from this array followed by elements from
+ * the parameters.
+ *
+ * @includeExample examples\Array.concat.1.as -noswf
+ *
+ * @helpid x2089D
+ * @refpath Objects/Core/Array/Methods/concat
+ * @keyword array.concat, concat, concatenate
+ */
+ public native function concat(...args):Array;
+
+ /**
+ * Executes a test function on each item in the array until an item is reached that returns false for the specified function. You use this method to find out if all items in an array meet a certain criterion; for example, they all have values less than some number).
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example, item < 20) or a more complex operation, and it can be invoked with three arguments: the value of
+ * an item, the index of an item, and the Array object as in (item, index, array).
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A Boolean value; true if all items in the array return true for the specified function, otherwise false.
+ *
+ * @includeExample examples\Array.every.as -noswf
+ * @see #some() Array.some()
+ */
+ public native function every(callback:Function, thisObject=null):Boolean;
+
+ /**
+ * Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function. If an item returns false, it is not included in the new array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example, item < 20) or a more complex operation and will be invoked with three arguments, including the
+ * value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A new array containing all items from the original array that returned true.
+ *
+ * @includeExample examples\Array.filter.as -noswf
+ * @see #map() Array.map()
+ */
+ public native function filter(callback:Function, thisObject=null):Array;
+
+ /**
+ * Executes a function on each item in the array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple command
+ * (for example, a trace() statement) or a more complex operation and it can be invoked with three arguments,
+ * including the value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ *
+ * @includeExample examples\Array.forEach.as -noswf
+ * @includeExample examples\Array.forEach.2.as -noswf
+ */
+ public native function forEach(callback:Function, thisObject=null):void;
+
+ /**
+ * Searches for an item in an array using strict equality (===) and returns the index
+ * position of the item.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param searchElement The item to find in the array.
+ *
+ * @param fromIndex The location in the array from which to start searching for the item.
+ * @return A zero-based index position of the item in the array. If the searchElement argument
+ * is not found the return value will be -1.
+ *
+ * @includeExample examples\Array.indexOf.as -noswf
+ * @see #lastIndexOf() Array.lastIndexOf()
+ * @see operators.html#strict_equality === (strict equality)
+ */
+ public native function indexOf(searchElement, fromIndex:int=0):int;
+
+ /**
+ * Converts the elements in an array to strings, inserts the specified separator between the
+ * elements, concatenates them, and returns the resulting string. A nested array is always
+ * separated by a comma (,), not by the separator passed to the join() method.
+ *
+ * @tiptext Converts the elements in an array to strings.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param sep A character or string that separates array elements in
+ * the returned string. If you omit this parameter, a comma is used as the default
+ * separator.
+ *
+ * @return A string consisting of the elements of an array
+ * converted to strings and separated by the specified parameter.
+ *
+ * @includeExample examples\Array.join.1.as -noswf
+ * @includeExample examples\Array.join.2.as -noswf
+ *
+ * @oldsee mx.String#split mx.String.split()
+ * @see String#split()
+ *
+ * @helpid x2089E
+ * @refpath Objects/Core/Array/Methods/join
+ * @keyword array.join, join
+ */
+ public native function join(sep=void 0):String;
+
+ /**
+ * Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===).
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param searchElement The item to find in the array.
+ *
+ * @param fromIndex The location in the array from which to start searching for the item. The default is the maximum
+ * value allowed for an index. If fromIndex is not specified, the search starts at the last item
+ * in the array.
+ * @return A zero-based index position of the item in the array. If the searchElement argument is
+ * not found the return value will be -1.
+ *
+ * @includeExample examples\Array.lastIndexOf.as -noswf
+ * @see #indexOf() Array.indexOf()
+ * @see operators.html#strict_equality === (strict equality)
+ */
+ public native function lastIndexOf(searchElement, fromIndex:int=0x7fffffff):int;
+
+ /**
+ * Executes a function on each item in an array, and constructs a new array of items corresponding to the results of the function on each item in the original array.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple command (such as changing the case of an array of strings) or a more complex operation and will be invoked with three arguments,
+ * including the value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A new array containing the results of the function on each item in the original array.
+ *
+ * @includeExample examples\Array.map.as -noswf
+ * @see #filter() Array.filter()
+ */
+ public native function map(callback:Function, thisObject=null):Array
+
+ /**
+ * Removes the last element from an array and returns the value of that element.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The value of the last element (of any data type) in the specified array.
+ *
+ * @includeExample examples\Array.pop.1.as -noswf
+ *
+ * @see #push() Array.push()
+ * @see #shift() Array.shift()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A2
+ * @refpath Objects/Core/Array/Methods/pop
+ * @keyword array.pop, pop
+ */
+ public native function pop():Object;
+
+ /**
+ * Adds one or more elements to the end of an array and returns the new length of the array.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args One or more values to append to the array.
+ * @return An integer representing the length of the new array.
+ *
+ * @includeExample examples\Array.push.1.as -noswf
+ * @includeExample examples\Array.push.2.as -noswf
+ *
+ * @see #pop() Array.pop()
+ * @see #shift() Array.shift()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A3
+ * @refpath Objects/Core/Array/Methods/push
+ * @keyword array.push, push
+ */
+ public native function push( ...args):uint;
+
+ /**
+ * Reverses the array in place.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\Array.reverse.1.as -noswf
+ *
+ * @return The new array.
+ * @helpid x2099E
+ * @refpath Objects/Core/Array/Methods/reverse
+ * @keyword array.reverse, reverse
+ */
+ public native function reverse():Array;
+
+ /**
+ * Removes the first element from an array and returns that element. The remaining elements in the array are moved
+ * from their original position, i, to i-1.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The first element (of any data type) in an array.
+ *
+ * @includeExample examples\Array.shift.1.as -noswf
+ *
+ * @see #pop() Array.pop()
+ * @see #push() Array.push()
+ * @see #unshift() Array.unshift()
+ *
+ * @helpid x208A4
+ * @refpath Objects/Core/Array/Methods/shift
+ * @keyword array.shift, shift
+ */
+ public native function shift():Object;
+
+ /**
+ * Returns a new array that consists of a range of elements from the original array, without modifying the original array. The returned array includes the startIndex element and all elements up to, but not including, the endIndex element.
+ *
If you don't pass any parameters, a duplicate of the original array is created.
+ *
+ * @tiptext Returns a new array that consists of a range of elements from the original array.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param startIndex A number specifying the index of the starting point
+ * for the slice. If start is a negative number, the starting
+ * point begins at the end of the array, where -1 is the last element.
+ *
+ * @param endIndex A number specifying the index of the ending point for
+ * the slice. If you omit this parameter, the slice includes all elements from the
+ * starting point to the end of the array. If end is a negative
+ * number, the ending point is specified from the end of the array, where -1 is the
+ * last element.
+ *
+ * @return An array that consists of a range of elements from the original array.
+ *
+ * @includeExample examples\Array.slice.1.as -noswf
+ * @includeExample examples\Array.slice.2.as -noswf
+ * @includeExample examples\Array.slice.3.as -noswf
+ *
+ * @helpid x208A5
+ * @refpath Objects/Core/Array/Methods/slice
+ * @keyword array.slice, slice
+ */
+ public native function slice(startIndex:int=0, endIndex:int=-1):Array;
+
+ /**
+ * Executes a test function on each item in the array until an item is reached that returns true for the specified function. Use this method to find out if any items in an array meet a certain criterion, such as having a value less than some number.
+ *
For this method, the second parameter, thisObject, must be null if the
+ * first parameter, callback, is a method closure. In other words, if you create a function in a movie clip
+ * called me:
+ *
+ * function myFunction(){
+ * //your code here
+ * }
+ *
+ *
and then use the filter method on an array called myArray:
+ *
+ * myArray.filter(myFunction, me);
+ *
+ *
the function myFunction is a member function of the Timeline class, which cannot be overridden
+ * by me. Flash Player will throw an exception.
+ * You can avoid this runtime error by assigning the function to a variable, as follows:
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @param callback The function to run on each item in the array. This function can contain a simple comparison (for example
+ * item < 20) or a more complex operation and it is invoked with three arguments, including the
+ * value of an item, the index of an item, and the Array object as in:
+ *
function callback(item:*, index:int, array:Array):void;
+ *
+ * @param thisObject An object to use as this for the function.
+ * @return A Boolean value; true if any items in the array return true for the specified function, otherwise false.
+ *
+ * @includeExample examples\Array.some.as -noswf
+ * @see #every() Array.every()
+ */
+ public native function some(callback:Function, thisObject=null):Boolean;
+
+
+ /**
+ * Sorts the elements in an array. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.)
+ *
By default, Array.sort() works in the following way:
+ *
+ *
Sorting is case-sensitive (Z precedes a).
+ *
Sorting is ascending (a precedes b).
+ *
The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.
+ *
All elements, whatever the data type, are sorted as if they were strings, so 100 precedes 99, because "1" is a lower string value than "9".
+ *
+ *
+ * To sort an array by using settings that deviate from the default settings,
+ * you can either use one of the sorting options described in the ...args parameter entry
+ * for the sortOptions argument or you can create your own custom function to do the sorting.
+ * If you create a custom function, you can use it by calling the sort() method, using the name
+ * of your custom function as the first argument (compareFunction)
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args The arguments specifying a comparison function and one or more values that determine the behavior of the sort.
+ *
This method uses the syntax and argument order Array.sort(compareFunction, sortOptions) with the arguments defined as:
+ *
compareFunction - A comparison function used to determine the sorting order of elements in an array. This argument is optional. A function should take two arguments to compare. Given the elements A and B, the result of compareFunction can have one of the following three values:
+ *
+ *
-1, if A should appear before B in the sorted sequence
+ *
0, if A equals B
+ *
1, if A should appear after B in the sorted sequence
+ *
+ *
+ *
sortOptions - One or more numbers or names of defined constants, separated by the |(bitwise OR) operator, that change the behavior of the sort from the default. This argument is optional. The following values are acceptable for sortOptions:
+ *
+ *
1 or Array.CASEINSENSITIVE
+ *
2 or Array.DESCENDING
+ *
4 or Array.UNIQUESORT
+ *
8 or Array.RETURNINDEXEDARRAY
+ *
16 or Array.NUMERIC
+ *
+ * For more information, see the Array.sortOn() method.
+ *
+ *
Note: The Array.sort() method is defined in the ECMAScript (ECMA-262) edition 3
+ * language specification, but the
+ * array sorting options introduced in Flash Player 7 are Flash-specific extensions to
+ * ECMA-262.
+ *
+ * @return The return value depends on whether you pass any arguments, as described in
+ * the following list:
+ *
+ *
If you specify a value of 4 or Array.UNIQUESORT for the sortOptions argument
+ * of the ...args parameter and two or more elements being sorted have identical sort fields,
+ * Flash returns a value of 0 and does not modify the array.
+ *
If you specify a value of 8 or Array.RETURNINDEXEDARRAY for
+ * the sortOptions argument of the ...args parameter, Flash returns a sorted numeric
+ * array of the indices that reflects the results of the sort and does not modify the array.
+ *
Otherwise, Flash returns nothing and modifies the array to reflect the sort order.
+ *
+ *
+ * @includeExample examples\Array.sort.1.as -noswf
+ * @includeExample examples\Array.sort.2.as -noswf
+ * @includeExample examples\Array.sort.3.as -noswf
+ * @includeExample examples\Array.sort.4.as -noswf
+ * @includeExample examples\Array.sort.5.as -noswf
+ *
+ * @see operators.html#bitwise_OR | (bitwise OR)
+ * @see #sortOn() Array.sortOn()
+ *
+ * @helpid x209AF
+ * @refpath
+ * @keyword array.sort, sort
+ */
+ public native function sort(...args):Array;
+
+ /**
+ * Sorts the elements in an array according to one or more fields in the array.
+ * The array should have the following characteristics:
+ *
+ *
The array is an indexed array, not an associative array.
+ *
Each element of the array holds an object with one or more properties.
+ *
All of the objects have at least one property in common, the values of which can be used
+ * to sort the array. Such a property is called a field.
+ *
+ *
If you pass multiple fieldName parameters, the first field represents the primary sort field, the second represents the next sort field, and so on. Flash sorts according to Unicode values. (ASCII is a subset of Unicode.) If either of the elements being compared does not contain the field that is specified in the fieldName parameter, the field is assumed to be set to undefined, and the elements are placed consecutively in the sorted array in no particular order.
+ *
By default, Array.sortOn() works in the following way:
+ *
+ *
Sorting is case-sensitive (Z precedes a).
+ *
Sorting is ascending (a precedes b).
+ *
The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.
+ *
Numeric fields are sorted as if they were strings, so 100 precedes 99, because "1" is a lower string value than "9".
+ *
+ *
Flash Player 7 added the options parameter, which you can use to override the default sort behavior. To sort a simple array (for example, an array with only one field), or to specify a sort order that the options parameter doesn't support, use Array.sort().
+ *
To pass multiple flags, separate them with the bitwise OR (|) operator:
Flash Player 8 added the ability to specify a different sorting option for each field when you sort by more than one field. In Flash Player 8, the options parameter accepts an array of sort options such that each sort option corresponds to a sort field in the fieldName parameter. The following example sorts the primary sort field, a, using a descending sort; the secondary sort field, b, using a numeric sort; and the tertiary sort field, c, using a case-insensitive sort:
Note: The fieldName and options arrays must have the same number of elements; otherwise, the options array is ignored. Also, the Array.UNIQUESORT and Array.RETURNINDEXEDARRAY options can be used only as the first element in the array; otherwise, they are ignored.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param fieldName A string that identifies a field to be used as the sort value, or an
+ * array in which the first element represents the primary sort field, the second represents
+ * the secondary sort field, and so on.
+ *
+ * @param options One or more numbers or names of defined constants, separated by the bitwise OR (|) operator, that change the sorting behavior. The following values are acceptable for the options parameter:
+ *
Code hinting is enabled if you use the string form of the flag (for example, DESCENDING) rather than the numeric form (2).
+ *
+ *
+ * @return The return value depends on whether you pass any parameters:
+ *
+ *
If you specify a value of 4 or Array.UNIQUESORT for the options parameter, and two or more elements being sorted have identical sort fields, a value of 0 is returned and the array is not modified.
+ *
If you specify a value of 8 or Array.RETURNINDEXEDARRAY for the options parameter, an array is returned that reflects the results of the sort and the array is not modified.
+ *
Otherwise, nothing is returned and the array is modified to reflect the sort order.
+ *
+ *
+ * @includeExample examples\Array.sortOn.1.as -noswf
+ * @includeExample examples\Array.sortOn.2.as -noswf
+ * @includeExample examples\Array.sortOn.3.as -noswf
+ *
+ * @see operators.html#bitwise_OR | (bitwise OR)
+ * @see #sort() Array.sort()
+ *
+ * @helpid x2058F
+ * @refpath Objects/Core/Array/Methods/sortOn
+ * @keyword array.sortOn, sortOn
+ */
+ public native function sortOn(fieldName:Object, options:Object = null):Array; // 'key' is a String, or an Array of String. 'options' is optional.
+
+ /**
+ * Adds elements to and removes elements from an array. This method modifies the array without
+ * making a copy.
+ *
Note: To override this method in a subclass of Array, use ...args for the parameters.
+ * For example:
+ *
+ * public override function splice(...args) {
+ * // your statements here
+ * }
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param startIndex An integer that specifies the index of the element in the array where the insertion or
+ * deletion begins. You can specify a negative integer to specify a position relative to the end of the array
+ * (for example, -1 is the last element of the array).
+ * @param deleteCount An integer that specifies the number of elements to be deleted. This number includes the
+ * element specified in the startIndex parameter. If no value is specified for the
+ * deleteCount parameter, the method deletes all of the values from the startIndex
+ * element to the last element in the array. If the value is 0, no elements are deleted.
+ * @param values An optional list of one or more comma-separated values, or an array,
+ * to insert into the array at the insertion point specified in the startIndex parameter.
+ *
+ * @return An array containing the elements that were removed from the original array.
+ *
+ * @includeExample examples\Array.splice.1.as -noswf
+ *
+ * @helpid x208A6
+ * @refpath Objects/Core/Array/Methods/splice
+ * @keyword array.splice, splice
+ */
+ public native function splice(startIndex:int, deleteCount:uint, ... values):Array;
+
+ /**
+ * Returns a string value representing the elements in the specified Array object. Every element in the array, starting with index 0 and ending with the highest index, is converted to a concatenated string and separated by commas. To specify a custom separator, use the Array.join() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string.
+ *
+ * @includeExample examples\Array.toString.1.as -noswf
+ *
+ *
This example outputs 1,2,3,4,5 as a result of the trace statement.
+ *
This example writes 1,2,3,4,5 to the log file.
+ *
+ * @see String#split() String.split()
+ * @see #join() Array.join()
+ *
+ * @helpid x20A11
+ * @refpath Objects/Core/Array/Methods/toString
+ * @keyword array.toString, toString
+ */
+ public native function toString():String;
+
+ /**
+ * Returns a string value representing the elements in the specified array object. Every element in the array, starting with index 0 and ending with the highest index, is converted to a concatenated string and separated by commas. In the ActionScript 3.0 implementation, this method returns the same value as the Array.toString() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string.
+ * @see #toString() Array.toString()
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Adds one or more elements to the beginning of an array and returns the new length of the array. The other
+ * elements in the array are moved from their original position, i, to i+1.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param ...args One or more numbers, elements, or variables to be inserted at the beginning of the array.
+ *
+ * @return An integer representing the new length of the array.
+ *
+ * @includeExample examples\Array.unshift.1.as -noswf
+ *
+ * @see Array#pop()
+ * @see Array#push()
+ * @see Array#shift()
+ * @helpid x208A7
+ * @refpath Objects/Core/Array/Methods/unshift
+ * @keyword array.unshift, unshift
+ */
+ public native function unshift( ...args):uint;
+
+ /**
+ * The default number of arguments for the constructor. You can specify 0, 1, or any number of arguments. For details, see the Array() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Array()
+ */
+ public static const length:int = 1;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Boolean object
+//****************************************************************************
+/**
+* A data type that can have one of two values, either true or false.
+* Used for logical operations. Use the Boolean
+* class to retrieve the primitive data type or string representation of a Boolean object.
+*
+*
It makes no difference whether you use the constructor, the global function, or simply assign
+* a literal value. The fact that all three ways of creating a Boolean are equivalent is new in ActionScript 3.0,
+* and different from a Boolean in JavaScript where a Boolean object is distinct from the Boolean primitive type.
+*
+*
The following lines of code are equivalent:
+*
+* var flag:Boolean = true;
+* var flag:Boolean = new Boolean(true);
+* var flag:Boolean = Boolean(true);
+*
+*
+ * @includeExample examples\BooleanExample.as -noswf
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid x208C1
+* @keyword boolean, built-in class
+* @refpath Objects/Core/Boolean/
+*/
+public final class Boolean
+{
+
+/**
+ * Creates a Boolean object with the specified value. If you omit the expression
+ * parameter, the Boolean object is initialized with a value of false. If you
+ * specify a value for the expression parameter, the method evaluates it and returns the result
+ * as a Boolean value according to the rules in the global Boolean() function.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param expression Any expression.
+ *
+ * @return A reference to a Boolean object.
+ *
+ * @example The following code creates a new Boolean object, initialized to a value of false called myBoolean:
+ *
+ * var myBoolean:Boolean = new Boolean();
+ *
+ *
+ * @see package.html#Boolean() Boolean()
+ * @helpid x208C0
+ * @refpath Objects/Core/Boolean/new Boolean
+ * @keyword new boolean, constructor
+ */
+ public native function Boolean(expression:Object = false);
+
+
+ /**
+ * The default number of arguments for the constructor. For details, see the Boolean() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Boolean()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Returns the string representation ("true" or
+ * "false") of the Boolean object. The output is not localized, and will be "true" or
+ * "false" regardless of the system language.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string; "true" or "false".
+ *
+ * @example This example creates a variable of type Boolean and then uses the toString() method
+ * to convert the value to a string for use in an array of strings:
+ *
+ * var myStringArray:Array = new Array("yes", "could be");
+ * var myBool:Boolean = 0;
+ * myBool.toString();
+ * myStringArray.push(myBool);
+ *
+ *
+ *
+ * @helpid x208C2
+ * @refpath Objects/Core/Boolean/Methods/toString
+ * @keyword boolean.toString, toString
+ */
+ public native function toString():String;
+
+ /**
+ * Returns true if the value of the specified Boolean
+ * object is true; false otherwise.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A Boolean value.
+ *
+ * @example The following example shows how this method works, and also shows that the
+ * value of a new Boolean object is false:
+ *
+ * var myBool:Boolean = new Boolean();
+ * trace(myBool.valueOf()); // false
+ * myBool = (6==3+3);
+ * trace(myBool.valueOf()); // true
+ *
+ *
+ *
+ * @helpid x208C3
+ * @refpath Objects/Core/Boolean/Methods/valueOf
+ * @keyword boolean.valueOf, valueOf
+ */
+ public native function valueOf():Boolean;
+}
+}
+
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Class object
+//****************************************************************************
+/**
+ * A class object is created for each class definition in a program. Every class object is an instance
+ * of the Class class. The class object contains the static properties and methods of the class. The
+ * class object creates instances of the class when invoked using the new operator.
+ *
+ *
Some methods return an object of type Class, such as flash.net.getClassByAlias().
+ * Other methods may have a parameter of type Class, such as flash.net.registerClassAlias().
+ *
The Class name is the reference to the class object.
+ *
For example:
+ *
+ * class Foo {
+ * }
+ *
+ *
class Foo{} is the class definition that creates a class object Foo. Additionally, the statement
+ * new Foo() will create a new instance of class Foo, and the result will be of type Foo.
+ *
Use the class statement to declare your classes. Class objects are useful for advanced
+ * techniques, such as the runtime assignment of classes to an existing instance object, as shown in the "Class Examples"
+ * section below.
+ *
Any static properties and methods of a class live on the class's Class object. Class, itself, declares
+ * prototype.
+ *
+ *
Generally, you do not need to declare or create variables of type Class manually. However, in the following
+ * code, a class is assigned as a public Class property circleClass, and you can refer to this Class property
+ * as a property of the main Library class:
+ *
+ * package {
+ * import flash.display.Sprite;
+ * public class Library extends Sprite {
+ *
+ * public var circleClass:Class = Circle;
+ * public function Library() {
+ * }
+ * }
+ * }
+ *
+ * import flash.display.Shape;
+ * class Circle extends Shape {
+ * public function Circle(color:uint = 0xFFCC00, radius:Number = 10) {
+ * graphics.beginFill(color);
+ * graphics.drawCircle(radius, radius, radius);
+ * }
+ * }
+ *
+ *
+ *
Another SWF file can load the resulting Library.swf file and then instantiate objects of type Circle. The
+ * following is one way, not the only way, to get access to a child SWF file's assets (other techniques include using
+ * flash.utils.getDefnitionByName() or importing stub definitions of the child SWF file):
+ *
+ *
+ * package {
+ * import flash.display.Sprite;
+ * import flash.display.Shape;
+ * import flash.display.Loader;
+ * import flash.net.URLRequest;
+ * import flash.events.Event;
+ * public class LibaryLoader extends Sprite {
+ * public function LibaryLoader() {
+ * var ldr:Loader = new Loader();
+ * var urlReq:URLRequest = new URLRequest("Library.swf");
+ * ldr.load(urlReq);
+ * ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
+ * }
+ * private function loaded(event:Event):void {
+ * var library:Object = event.target.content;
+ * var circle:Shape = new library.circleClass();
+ * addChild(circle);
+ * }
+ * }
+ * }
+ *
+ *
In ActionScript 3.0, you can create embedded classes for external assets (such as images, sounds, or fonts) that are
+ * compiled into SWF files. In earlier versions of ActionScript, you associated those assets using a linkage ID with the
+ * MovieClip.attachMovie() method. In ActionScript 3.0, each embedded asset is represented by a unique embedded
+ * asset class. So, you can use the new operator to instantiate the asset's associated class and call methods and properties
+ * on that asset.
+ *
For example, if you are using an MXML compiler to generate SWF files, you would create an embedded
+ * class as follows:
+ *
+ * [Embed(source="bratwurst.jpg")]
+ * public var imgClass:Class;
+ *
+ *
And, to instantiate it, you write the following:
+ *
+ * var myImg:Bitmap = new imgClass();
+ *
+ *
+ *
+ * @includeExample examples\Class.1.as -noswf
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Class
+ * @see Object#prototype
+ * @see operators.html#new new operator
+ */
+public dynamic class Class
+{
+}
+}
+
+package {
+// Top Level Constants
+
+/**
+ * A special value representing positive Infinity. The value of this constant is the same as Number.POSITIVE_Infinity.
+ * @includeExample examples\Constants.Infinity.1.as -noswf
+ * @see Number#POSITIVE_Infinity
+ */
+public const Infinity:Number;
+
+
+/**
+ * A special value representing negative Infinity. The value of this constant is the same as Number.NEGATIVE_Infinity.
+ * @includeExample examples\Constants.NegInfinity.1.as -noswf
+ * @see Number#NEGATIVE_Infinity
+ */
+public const Infinity:Number;
+
+/**
+ * A special member of the Number data type that represents a value that is "not a number" (NaN).
+ * When a mathematical expression results in a value that cannot be expressed as a number, the result is NaN.
+ * The following list describes common expressions that result in NaN.
+ *
+ *
Division by 0 results in NaN only if the divisor is also 0. If the divisor is greater than 0, division by 0 results in Infinity. If the divisor is less than 0, division by 0 results in -Infinity;
+ *
Square root of a negative number;
+ *
The arcsine of a number outside the valid range of 0 to 1;
+ *
Infinity subtracted from Infinity;
+ *
Infinity or -Infinity divided by Infinity or -Infinity;
+ *
Infinity or -Infinity multiplied by 0;
+ *
+ *
The NaN value is not a member of the int or uint data types.
+ *
The NaN value is not considered equal to any other value, including NaN, which makes it impossible to use the equality operator to test whether an expression is NaN. To determine whether a number is the NaN function, use isNaN().
+ *
+ * @see global#isNaN()
+ * @see Number#NaN
+ */
+public const NaN:Number;
+
+
+/**
+ * A special value that applies to untyped variables that have not been initialized or dynamic object properties that are not initialized.
+ * In ActionScript 3.0, only variables that are untyped can hold the value undefined,
+ * which is not true in ActionScript 1.0 and ActionScript 2.0.
+ * For example, both of the following variables are undefined because they are untyped and unitialized:
+ *
+ *
var foo;
+ *
var bar:~~;
+ *
+ *
The undefined value also applies to uninitialized or undefined properties of dynamic objects.
+ * For example, if an object is an instance of the Object class,
+ * the value of any dynamically added property is undefined until a value is assigned to that property.
+ *
+ *
Results vary when undefined is used with various functions:
+ *
+ *
The value returned by String(undefined) is "undefined" (undefined is
+ * converted to a string).
+ *
The value returned by Number(undefined) is NaN.
+ *
The value returned by int(undefined) and uint(undefined) is 0.
+ *
The value returned by Object(undefined) is a new Object instance.
+ *
When the value undefined is assigned to a typed variable,
+ * the value is converted to the default value of the data type.
+ *
+ *
Do not confuse undefined with null.
+ * When null and undefined are compared with the equality
+ * (==) operator, they compare as equal. However, when null and undefined are
+ * compared with the strict equality (===) operator, they compare
+ * as not equal.
+ * @includeExample examples\Constants.undefined.1.as -noswf
+ * @includeExample examples\Constants.undefined.2.as -noswf
+ * @see global#null
+ */
+public const undefined;
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Date object
+//****************************************************************************
+
+
+/**
+ * The Date class represents date and time information. An instance of the Date class represents a particular point in time for which the properties such as month, day, hours and seconds can be queried or modified. The Date class lets you retrieve date and time values relative to universal time (Greenwich mean time, now called universal time or UTC) or relative to local time, which is determined by the local time zone setting on the operating system running Flash Player. The methods of the Date class are not static but apply only to the individual Date object specified when the method is called. The Date.UTC() and Date.parse() methods are exceptions; they are static methods.
+ *
The Date class handles daylight saving time differently, depending on the operating system and Flash Player version. Flash Player 6 and later versions handle daylight saving time on the following operating systems in these ways:
+ *
Windows - the Date object automatically adjusts its output for daylight saving time. The Date object detects whether daylight saving time is employed in the current locale, and if so, it detects the standard-to-daylight saving time transition date and times. However, the transition dates currently in effect are applied to dates in the past and the future, so the daylight saving time bias might calculate incorrectly for dates in the past when the locale had different transition dates.
+ *
Mac OS X - the Date object automatically adjusts its output for daylight saving time. The time zone information database in Mac OS X is used to determine whether any date or time in the present or past should have a daylight saving time bias applied.
+ *
Mac OS 9 - the operating system provides only enough information to determine whether the current date and time should have a daylight saving time bias applied. Accordingly, the date object assumes that the current daylight saving time bias applies to all dates and times in the past or future.
+ *
Flash Player 5 handles daylight saving time on the following operating systems as follows:
+ *
Windows - the U.S. rules for daylight saving time are always applied, which leads to incorrect transitions in Europe and other areas that employ daylight saving time but have different transition times than the U.S. Flash correctly detects whether daylight saving time is used in the current locale.
+ *
To use the Date class, construct a Date instance using the new operator.
+ *
ActionScript 3.0 adds several new accessor properties that can be used in place of many Date class methods that access or modify Date instances. ActionScript 3.0 also includes several new variations of the toString() method that are included for ECMA-262 3rd Edition compliance, including: Date.toLocaleString(), Date.toTimeString(), Date.toLocaleTimeString(), Date.toDateString(), Date.toLocaleDateString().
+ *
To compute relative time or time elapsed, see the getTimer() method in the flash.utils package.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\DateExample.as -noswf
+ * @see flash.utils#getTimer() flash.utils.getTimer()
+ *
+ * @helpid x208E9
+ * @refpath Objects/Core/Date
+ * @keyword Date object, built-in class, date
+ */
+public final dynamic class Date
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 0, 1, or any number of arguments
+ * up to a maximum of 7. For details, see the Date() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Date()
+ */
+ public static const length:int = 7;
+
+ /**
+ * The full year (a four-digit number, such as 2000) of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getFullYear()
+ * @see #setFullYear()
+ */
+ public function get fullYear():Number { return getFullYear(); }
+ public function set fullYear(value:Number):void { setFullYear(value); }
+
+ /**
+ * The month (0 for January, 1 for February, and so on) portion of a
+ * Date object according to local time. Local time is determined by the operating system
+ * on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMonth()
+ * @see #setMonth()
+ */
+ public function get month():Number { return getMonth(); }
+ public function set month(value:Number):void { setMonth(value); }
+
+ /**
+ * The day of the month (an integer from 1 to 31) specified by a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getDate()
+ * @see #setDate()
+ */
+ public function get date():Number { return getDate(); }
+ public function set date(value:Number):void { setDate(value); }
+
+ /**
+ * The hour (an integer from 0 to 23) of the day portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getHours()
+ * @see #setHours()
+ */
+ public function get hours():Number { return getHours(); }
+ public function set hours(value:Number):void { setHours(value); }
+
+ /**
+ * The minutes (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMinutes()
+ * @see #setMinutes()
+ */
+ public function get minutes():Number { return getMinutes(); }
+ public function set minutes(value:Number):void { setMinutes(value); }
+
+ /**
+ * The seconds (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getSeconds()
+ * @see #setSeconds()
+ */
+ public function get seconds():Number { return getSeconds(); }
+ public function set seconds(value:Number):void { setSeconds(value); }
+
+ /**
+ * The milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMilliseconds()
+ * @see #setMilliseconds()
+ */
+ public function get milliseconds():Number { return getMilliseconds(); }
+ public function set milliseconds(value:Number):void { setMilliseconds(value); }
+
+ /**
+ * The four-digit year of a Date object according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCFullYear()
+ * @see #setUTCFullYear()
+ */
+ public function get fullYearUTC():Number { return getUTCFullYear(); }
+ public function set fullYearUTC(value:Number):void { setUTCFullYear(value); }
+
+ /**
+ * The month (0 [January] to 11 [December]) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMonth()
+ * @see #setUTCMonth()
+ */
+ public function get monthUTC():Number { return getUTCMonth(); }
+ public function set monthUTC(value:Number):void { setUTCMonth(value); }
+
+ /**
+ * The day of the month (an integer from 1 to 31) of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCDate()
+ * @see #setUTCDate()
+ */
+ public function get dateUTC():Number { return getUTCDate(); }
+ public function set dateUTC(value:Number):void { setUTCDate(value); }
+
+ /**
+ * The hour (an integer from 0 to 23) of the day of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCHours()
+ * @see #setUTCHours()
+ */
+ public function get hoursUTC():Number { return getUTCHours(); }
+ public function set hoursUTC(value:Number):void { setUTCHours(value); }
+
+ /**
+ * The minutes (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMinutes()
+ * @see #setUTCMinutes()
+ */
+ public function get minutesUTC():Number { return getUTCMinutes(); }
+ public function set minutesUTC(value:Number):void { setUTCMinutes(value); }
+
+ /**
+ * The seconds (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCSeconds()
+ * @see #setUTCSeconds()
+ */
+ public function get secondsUTC():Number { return getUTCSeconds(); }
+ public function set secondsUTC(value:Number):void { setUTCSeconds(value); }
+
+ /**
+ * The milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCMilliseconds()
+ * @see #setUTCMilliseconds()
+ */
+ public function get millisecondsUTC():Number { return getUTCMilliseconds(); }
+ public function set millisecondsUTC(value:Number):void { setUTCMilliseconds(value); }
+
+ /**
+ * The number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object. Use this method to represent a specific instant in time
+ * when comparing two or more Date objects.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getTime()
+ * @see #setTime()
+ */
+ public function get time():Number { return getTime(); }
+ public function set time(value:Number):void { setTime(value); }
+
+ /**
+ * The difference, in minutes, between the computer's local time and universal
+ * time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getTimezoneOffset()
+ */
+ public function get timezoneOffset():Number { return getTimezoneOffset(); }
+
+ /**
+ * The day of the week (0 for Sunday, 1 for Monday, and so on) specified by this
+ * Date according to local time. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getDay()
+ */
+ public function get day():Number { return getDay(); }
+
+ /**
+ * The day of the week (0 for Sunday, 1 for Monday, and so on) of this Date
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getUTCDay()
+ */
+ public function get dayUTC():Number { return getUTCDay(); }
+
+ /**
+ * Returns the number of milliseconds between midnight on January 1, 1970, universal time,
+ * and the time specified in the parameters. This method uses universal time, whereas the
+ * Date constructor uses local time.
+ *
This method is useful if you want to pass a UTC date to the Date class constructor.
+ * Because the Date class constructor accepts the millisecond offset as an argument, you
+ * can use the Date.UTC() method to convert your UTC date into the corresponding millisecond
+ * offset, and send that offset as an argument to the Date class constructor:
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A four-digit integer that represents the year (for example, 2000).
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param date An integer from 1 to 31.
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The number of milliseconds since January 1, 1970 and the specified date and time.
+ *
+ * @includeExample examples\Date.UTC.1.as -noswf
+ *
+ * @helpid x2090F
+ * @refpath Objects/Core/Date/Methods/UTC
+ * @keyword date.utc, utc, date
+ */
+ public native static function UTC(year:Number,month:Number,date:Number = 1,
+ hour:Number = 0,minute:Number = 0,second:Number = 0,millisecond:Number = 0):Number;
+
+ /**
+ * Constructs a new Date object that holds the specified date and time.
+ *
+ *
The Date() constructor takes up to seven parameters (year, month,
+ * ..., millisecond) to specify a date and time to the millisecond. The date that
+ * the newly constructed Date object contains depends on the number, and data type, of arguments passed.
+ *
+ *
If you pass no arguments, the Date object is assigned the current date and time.
+ *
If you pass one argument of data type Number, the Date object is assigned a time value based on the number of milliseconds since January 1, 1970 0:00:000 GMT, as specified by the lone argument.
+ *
If you pass one argument of data type String, and the string contains a valid date, the Date object contains a time value based on that date.
+ *
If you pass two or more arguments, the Date object is assigned a time value based on the argument values passed, which represent the date's year, month, date, hour, minute, second and milliseconds.
+ *
+ *
If you pass a string to the Date class constructor, the date can be in a variety of formats, but must at least include the month, date and year. For example, Feb 1 2005 is valid, but Feb 2005 is not. The following list indicates some of the valid formats:
+ *
+ *
Day Month Date Hours:Minutes:Seconds GMT Year (for instance, "Tue Feb 1 00:00:00 GMT-0800 2005", which matches toString())
+ *
Day Month Date Year Hours:Minutes:Seconds AM/PM (for instance, "Tue Feb 1 2005 12:00:00 AM", which matches toLocaleString())
+ *
Day Month Date Year (for instance, "Tue Feb 1 2005", which matches toDateString())
+ *
Month/Day/Year (for instance, "02/01/2005")
+ *
Month/Year (for instance, "02/2005")
+ *
+ * @param yearOrTimevalue If other parameters are specified, this number represents a
+ * year (such as 1965); otherwise, it represents a time value. If the number represents a year, a
+ * value of 0 to 99 indicates 1900 through 1999; otherwise all four digits of the year must be
+ * specified. If the number represents a time value (no other parameters are specified), it is the
+ * number of milliseconds before or after 0:00:00 GMT January 1, 1970; a negative values represents
+ * a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param date An integer from 1 to 31.
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999 of milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see #getMonth()
+ * @see #getDate()
+ * @see #getFullYear()
+ * @helpid x208FD
+ * @refpath Objects/Core/Date/new Date
+ * @keyword new Date, constructor, date
+ */
+ public native function Date(yearOrTimevalue:Object,month:Number,date:Number = 1,hour:Number = 0,minute:Number = 0,second:Number = 0,millisecond:Number = 0);
+
+
+ /**
+ * Returns the day of the month (an integer from 1 to 31) specified by a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The day of the month (1 - 31) a Date object represents.
+ *
+ * @includeExample examples\Date.getDate.1.as -noswf
+ *
+ * @see #getMonth()
+ * @see #getFullYear()
+ * @helpid x208EA
+ * @refpath Objects/Core/Date/Methods/getDate
+ * @keyword date.getdate, getdate, date
+ */
+ public native function getDate():Number;
+
+ /**
+ * Returns the day of the week (0 for Sunday, 1 for Monday, and so on) specified by this
+ * Date according to local time. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A numeric version of the day of the week (0 - 6) a Date object
+ * represents.
+ *
+ * @includeExample examples\Date.getDay.1.as -noswf
+ *
+ * @helpid x208EB
+ * @refpath Objects/Core/Date/Methods/getDay
+ * @keyword date.getday, getday, date
+ */
+ public native function getDay():Number;
+
+ /**
+ * Returns the full year (a four-digit number, such as 2000) of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The full year a Date object represents.
+ *
+ * @includeExample examples\Date.getFullYear.1.as -noswf
+ *
+ * @helpid x208EC
+ * @refpath Objects/Core/Date/Methods/getFullYear
+ * @keyword date.getfullyear, getfullyear, date
+ */
+ public native function getFullYear():Number;
+
+ /**
+ * Returns the hour (an integer from 0 to 23) of the day portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The hour (0 - 23) of the day a Date object represents.
+ *
+ * @includeExample examples\Date.getHours.1.as -noswf
+ *
+ * @helpid x208ED
+ * @refpath Objects/Core/Date/Methods/getHours
+ * @keyword date.gethours, gethours, date
+ */
+ public native function getHours():Number;
+
+ /**
+ * Returns the milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The milliseconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getMilliseconds.1.as -noswf
+ *
+ * @helpid x208EE
+ * @refpath Objects/Core/Date/Methods/getMilliseconds
+ * @keyword date.getmilliseconds, getmilliseconds, date
+ */
+ public native function getMilliseconds():Number;
+
+ /**
+ * Returns the minutes (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The minutes portion of a Date object.
+ *
+ * @includeExample examples\Date.getMinutes.1.as -noswf
+ *
+ * @helpid x208EF
+ * @refpath Objects/Core/Date/Methods/getMinutes
+ * @keyword date.getminutes, getminutes, date
+ */
+ public native function getMinutes():Number;
+
+ /**
+ * Returns the month (0 for January, 1 for February, and so on) portion of this
+ * Date according to local time. Local time is determined by the operating system
+ * on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The month (0 - 11) portion of a Date object.
+ *
+ * @includeExample examples\Date.getMonth.1.as -noswf
+ *
+ * @helpid x208F0
+ * @refpath Objects/Core/Date/Methods/getMonth
+ * @keyword date.getmonth, getmonth, date
+ */
+ public native function getMonth():Number;
+
+ /**
+ * Returns the seconds (an integer from 0 to 59) portion of a Date object
+ * according to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The seconds (0 to 59) portion of a Date object.
+ *
+ * @includeExample examples\Date.getSeconds.1.as -noswf
+ *
+ * @helpid x208F1
+ * @refpath Objects/Core/Date/Methods/getSeconds
+ * @keyword date.getseconds, getseconds, date
+ */
+ public native function getSeconds():Number;
+
+ /**
+ * Returns the number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object. Use this method to represent a specific instant in time
+ * when comparing two or more Date objects.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The number of milliseconds since Jan 1, 1970 that a Date object represents.
+ *
+ * @includeExample examples\Date.getTime.1.as -noswf
+ * @includeExample examples\Date.getTime.2.as -noswf
+ *
+ * @helpid x208F2
+ * @refpath Objects/Core/Date/Methods/getTime
+ * @keyword date.gettime, gettime, date
+ */
+ public native function getTime():Number;
+
+ /**
+ * Returns the difference, in minutes, between the computer's local time and universal
+ * time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return Difference, in minutes, of local time and universal time (UTC).
+ *
+ * @includeExample examples\Date.getTimezoneOffset.1.as -noswf
+ *
+ * @helpid x208F3
+ * @refpath Objects/Core/Date/Methods/getTimezoneOffset
+ * @keyword date.gettimezoneoffset, gettimezoneoffset, date
+ */
+ public native function getTimezoneOffset():Number;
+
+ /**
+ * Returns the day of the month (an integer from 1 to 31) of a Date object,
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC day of the month (1 to 31) that a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCDate.1.as -noswf
+ *
+ * @see #getDate()
+ * @helpid x208F4
+ * @refpath Objects/Core/Date/Methods/getUTCDate
+ * @keyword date.getutcdate, getutcdate, date
+ */
+ public native function getUTCDate():Number;
+
+ /**
+ * Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of this Date
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC day of the week (0 to 6) that a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCDay.1.as -noswf
+ *
+ * @see #getDay()
+ * @helpid x208F5
+ * @refpath Objects/Core/Date/Methods/getUTCDay
+ * @keyword date.getutcday, getutcday, date
+ */
+ public native function getUTCDay():Number;
+
+ /**
+ * Returns the four-digit year of a Date object according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC four-digit year a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCFullYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208F6
+ * @refpath Objects/Core/Date/Methods/getUTCFullYear
+ * @keyword date.getutcfullyear, getutcfullyear, date
+ */
+ public native function getUTCFullYear():Number;
+
+ /**
+ * Returns the hour (an integer from 0 to 23) of the day of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC hour of the day (0 to 23) a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCHours.1.as -noswf
+ *
+ * @see #getHours()
+ * @helpid x208F7
+ * @refpath Objects/Core/Date/Methods/getUTCHours
+ * @keyword date.getutchours, getutchours, date
+ */
+ public native function getUTCHours():Number;
+
+ /**
+ * Returns the milliseconds (an integer from 0 to 999) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC milliseconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMilliseconds.1.as -noswf
+ *
+ * @helpid x208F8
+ * @refpath Objects/Core/Date/Methods/getUTCMilliseconds
+ * @keyword date.getutcmilliseconds, getutcmilliseconds, date
+ */
+ public native function getUTCMilliseconds():Number;
+
+ /**
+ * Returns the minutes (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC minutes portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMinutes.1.as -noswf
+ *
+ * @helpid x208F9
+ * @refpath Objects/Core/Date/Methods/getUTCMinutes
+ * @keyword date.getutcminutes, getutcminutes, date
+ */
+ public native function getUTCMinutes():Number;
+
+ /**
+ * Returns the month (0 [January] to 11 [December]) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC month portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCMonth.1.as -noswf
+ *
+ * @see #getMonth()
+ * @helpid x208FA
+ * @refpath Objects/Core/Date/Methods/getUTCMonth
+ * @keyword date.getutcmonth, getutcmonth, date
+ */
+ public native function getUTCMonth():Number;
+
+ /**
+ * Returns the seconds (an integer from 0 to 59) portion of a Date object
+ * according to universal time (UTC).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC seconds portion of a Date object.
+ *
+ * @includeExample examples\Date.getUTCSeconds.1.as -noswf
+ *
+ * @helpid x208FB
+ * @refpath Objects/Core/Date/Methods/getUTCSeconds
+ * @keyword date.getutcseconds, getutcseconds, date
+ */
+
+ public native function getUTCSeconds():Number;
+
+ /**
+ * Returns the year of a Date object according to universal time (UTC). The year
+ * is the full year minus 1900. For example, the year 2000 is represented as 100.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The UTC year a Date object represents.
+ *
+ * @includeExample examples\Date.getUTCYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208F6
+ * @refpath Objects/Core/Date/Methods/getUTCFullYear
+ * @keyword date.getutcfullyear, getutcfullyear, date
+ */
+ public native function getUTCYear():Number;
+
+ /**
+ * Returns the year of a Date object according to local time. Local time is
+ * determined by the operating system on which Flash Player is running. The year is the
+ * full year minus 1900. For example, the year 2000 is represented as 100.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return An integer.
+ *
+ * @includeExample examples\Date.getYear.1.as -noswf
+ *
+ * @see #getFullYear()
+ * @helpid x208FC
+ * @refpath Objects/Core/Date/Methods/getYear
+ * @keyword date.getyear, getyear, date
+ */
+ public native function getYear():Number;
+
+ /**
+ * Converts a string representing a date into a number equaling the number of milliseconds
+ * elapsed since January 1, 1970, UTC.
+ *
+ * @param date A string representation of a date, which conforms to the format for the output of
+ * Date.toString(). The date format for the output of Date.toString() is:
+ *
+ * Day Mon Date HH:MM:SS TZD YYYY
+ *
+ *
For example:
+ *
+ * Wed Apr 12 15:30:17 GMT-0700 2006
+ *
+ *
Other supported formats include (and you can include partial representations of these, meaning
+ * just the month, day, and year):
+ *
+ * @return A number representing the milliseconds elapsed since January 1, 1970, UTC.
+ *
+ * @includeExample examples\Date.parse.1.as -noswf
+ * @see #toString() Date.toString()
+ */
+ public native static function parse(date:String):Number;
+
+ /**
+ * Sets the day of the month, according to local time, and returns the new time in
+ * milliseconds. Local time is determined by the operating system on which Flash Player
+ * is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setDate.1.as -noswf
+ *
+ * @helpid x208FE
+ * @refpath Objects/Core/Date/Methods/setDate
+ * @keyword date.setdate, setdate, date
+ */
+ public native function setDate(day:Number):Number;
+
+ /**
+ * Sets the year, according to local time, and returns the new time in milliseconds. If
+ * the month and day parameters are specified,
+ * they are set to local time. Local time is determined by the operating system on which
+ * Flash Player is running.
+ *
+ * Calling this method does not modify the other fields of the Date but
+ * Date.getUTCDay() and Date.getDay() can report a new value
+ * if the day of the week changes as a result of calling this method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A four-digit number specifying a year. Two-digit numbers do not represent
+ * four-digit years; for example, 99 is not the year 1999, but the year 99.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day A number from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setFullYear.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x208FF
+ * @refpath Objects/Core/Date/Methods/setFullYear
+ * @keyword date.setfullyear, setfullyear, date
+ */
+ public native function setFullYear(year:Number, month:Number, day:Number):Number;
+
+ /**
+ * Sets the hour, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ * @param minute An integer from 0 to 59.
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setHours.1.as -noswf
+ *
+ * @helpid x20900
+ * @refpath Objects/Core/Date/Methods/setHours
+ * @keyword date.sethours, sethours, date
+ */
+ public native function setHours(hour:Number, minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the milliseconds, according to local time, and returns the new time in
+ * milliseconds. Local time is determined by the operating system on which Flash Player
+ * is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMilliseconds.1.as -noswf
+ *
+ * @helpid x20901
+ * @refpath Objects/Core/Date/Methods/setMilliseconds
+ * @keyword date.setmilliseconds, setmilliseconds, date
+ */
+ public native function setMilliseconds(millisecond:Number):Number;
+
+ /**
+ * Sets the minutes, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param minute An integer from 0 to 59.
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMinutes.1.as -noswf
+ *
+ * @helpid x20902
+ * @refpath Objects/Core/Date/Methods/setMinutes
+ * @keyword date.setminutes, setminutes, date
+ */
+ public native function setMinutes(minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the month and optionally the day of the month, according to local time, and
+ * returns the new time in milliseconds. Local time is determined by the operating
+ * system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setMonth.1.as -noswf
+ *
+ * @helpid x20903
+ * @refpath Objects/Core/Date/Methods/setMonth
+ * @keyword date.setmonth, setmonth, date
+ */
+ public native function setMonth(month:Number, day:Number):Number;
+
+ /**
+ * Sets the seconds, according to local time, and returns the new time in milliseconds.
+ * Local time is determined by the operating system on which Flash Player is running.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param second An integer from 0 to 59.
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setSeconds.1.as -noswf
+ *
+ * @helpid x20904
+ * @refpath Objects/Core/Date/Methods/setSeconds
+ * @keyword date.setseconds, setseconds, date
+ */
+ public native function setSeconds(second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the date in milliseconds since midnight on January 1, 1970, and returns the new
+ * time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer value where 0 is midnight on January 1, universal time (UTC).
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setTime.1.as -noswf
+ *
+ * @helpid x20905
+ * @refpath Objects/Core/Date/Methods/setTime
+ * @keyword date.settime, settime, date
+ */
+ public native function setTime(millisecond:Number):Number;
+
+ /**
+ * Sets the day of the month, in universal time (UTC), and returns the new time in
+ * milliseconds. Calling this method does not modify the other fields of a Date
+ * object, but the Date.getUTCDay() and Date.getDay() methods can report
+ * a new value if the day of the week changes as a result of calling this method.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param day A number; an integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCDate.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x20906
+ * @refpath Objects/Core/Date/Methods/setUTCDate
+ * @keyword date.setutcdate, setutcdate, date
+ */
+ public native function setUTCDate(day:Number):Number;
+
+ /**
+ * Sets the year, in universal time (UTC), and returns the new time in milliseconds.
+ *
+ * Optionally, this method can also set the month and day of the month. Calling
+ * this method does not modify the other fields, but the Date.getUTCDay() and
+ * Date.getDay() methods can report a new value if the day of the week changes as a
+ * result of calling this method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year An integer that represents the year specified as a full four-digit year,
+ * such as 2000.
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return An integer.
+ *
+ * @includeExample examples\Date.setUTCFullYear.1.as -noswf
+ *
+ * @see #getUTCDay()
+ * @see #getDay()
+ * @helpid x20907
+ * @refpath Objects/Core/Date/Methods/setUTCFullYear
+ * @keyword date.setutcfullyear, setutcfullyear, date
+ */
+ public native function setUTCFullYear(year:Number, month:Number, day:Number):Number;
+
+ /**
+ * Sets the hour, in universal time (UTC), and returns the new time in milliseconds.
+ * Optionally, the minutes, seconds and milliseconds can be specified.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param hour An integer from 0 (midnight) to 23 (11 p.m.).
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCHours.1.as -noswf
+ *
+ * @helpid x20908
+ * @refpath Objects/Core/Date/Methods/setUTCHours
+ * @keyword date.setutchours, setutchours, date
+ */
+ public native function setUTCHours(hour:Number, minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the milliseconds, in universal time (UTC), and returns the new time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMilliseconds.1.as -noswf
+ *
+ * @helpid x20909
+ * @refpath Objects/Core/Date/Methods/setUTCMilliseconds
+ * @keyword date.setutcmilliseconds, setutcmilliseconds, date
+ */
+ public native function setUTCMilliseconds(millisecond:Number):Number;
+
+ /**
+ * Sets the minutes, in universal time (UTC), and returns the new time in milliseconds.
+ * Optionally, you can specify the seconds and milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param minute An integer from 0 to 59.
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMinutes.1.as -noswf
+ *
+ * @helpid x2090A
+ * @refpath Objects/Core/Date/Methods/setUTCMinutes
+ * @keyword date.setutcminutes, setutcminutes, date
+ */
+ public native function setUTCMinutes(minute:Number, second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the month, and optionally the day, in universal time(UTC) and returns the new
+ * time in milliseconds. Calling this method does not modify the other fields, but the
+ * Date.getUTCDay() and Date.getDay() methods might report a new
+ * value if the day of the week changes as a result of calling this method.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param month An integer from 0 (January) to 11 (December).
+ *
+ * @param day An integer from 1 to 31.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCMonth.1.as -noswf
+ *
+ * @see #getDay()
+ * @helpid x2090B
+ * @refpath Objects/Core/Date/Methods/setUTCMonth
+ * @keyword date.setutcmonth, setutcmonth, date
+ */
+ public native function setUTCMonth(month:Number, day:Number):Number;
+
+ /**
+ * Sets the seconds, and optionally the milliseconds, in universal time (UTC) and
+ * returns the new time in milliseconds.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param second An integer from 0 to 59.
+ *
+ * @param millisecond An integer from 0 to 999.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setUTCSeconds.1.as -noswf
+ *
+ * @helpid x2090C
+ * @refpath Objects/Core/Date/Methods/setUTCSeconds
+ * @keyword date.setutcseconds, setutcseconds, date
+ */
+ public native function setUTCSeconds(second:Number, millisecond:Number):Number;
+
+ /**
+ * Sets the year, in local time, and returns the new time in milliseconds. Local time is
+ * determined by the operating system on which Flash Player is running.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param year A number that represents the year. If year is an
+ * integer between 0 and 99, setYear sets the year at 1900 +
+ * year; otherwise, the year is the value of the year
+ * parameter.
+ *
+ * @return The new time, in milliseconds.
+ *
+ * @includeExample examples\Date.setYear.1.as -noswf
+ *
+ * @helpid x2090D
+ * @refpath Objects/Core/Date/Methods/setYear
+ * @keyword date.setyear, setyear, date
+ */
+ public native function setYear(year:Number):Number;
+
+
+ /**
+ * Returns a string representation of the day and date only, and does not include the time or timezone.
+ * Contrast with the following methods:
+ *
+ *
Date.toTimeString(), which returns only the time and timezone
+ *
Date.toString(), which returns not only the day and date, but also the time and timezone.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of day and date only.
+ *
+ * @includeExample examples\Date.toDateString.1.as -noswf
+ *
+ * @see #toString()
+ */
+ public native function toDateString():String;
+
+ /**
+ * Returns a String representation of the time and timezone only, and does not include the day and date.
+ * Contrast with the Date.toDateString() method, which returns only the day and date.
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of time and timezone only.
+ *
+ * @see #toDateString()
+ */
+ public native function toTimeString():String;
+
+ /**
+ * Returns a String representation of the day, date, time, given in local time.
+ * Contrast with the Date.toString() method, which returns the same information (plus the timezone)
+ * with the year listed at the end of the string.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return A string representation of a Date object in the local timezone.
+ *
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Returns a String representation of the day and date only, and does not include the time or timezone.
+ * This method returns the same value as Date.toDateString.
+ * Contrast with the following methods:
+ *
+ *
Date.toTimeString(), which returns only the time and timezone
+ *
Date.toString(), which returns not only the day and date, but also the
+ * time and timezone.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The String representation of day and date only.
+ *
+ * @see #toDateString()
+ * @see #toTimeString()
+ * @see #toString()
+ */
+ public native function toLocaleDateString():String;
+
+ /**
+ * Returns a String representation of the time only, and does not include the day, date, year or timezone.
+ * Contrast with the Date.toTimeString() method, which returns the time and timezone.
+ *
+ * @playerversion Flash 9
+ * @langversion ActionScript 3.0
+ *
+ * @return The string representation of time and timezone only.
+ *
+ * @see #toTimeString()
+ */
+ public native function toLocaleTimeString():String;
+
+ /**
+ * Returns a String representation of the day, date, and time in universal time (UTC).
+ * For example, the date February 1, 2005 is returned as Tue Feb 1 00:00:00 2005 UTC.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The string representation of a Date object in UTC time.
+ *
+ * @see #toString()
+ */
+ public native function toUTCString():String;
+
+
+ /**
+ * Returns a String representation of the day, date, time, and timezone.
+ * The date format for the output is:
+ *
+ * Day Mon Date HH:MM:SS TZD YYYY
+ *
+ *
For example:
+ *
+ * Wed Apr 12 15:30:17 GMT-0700 2006
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The string representation of a Date object.
+ *
+ * @includeExample examples\Date.toString.1.as -noswf
+ *
+ * @helpid x2090E
+ * @refpath Objects/Core/Date/Methods/toString
+ * @keyword date.tostring, tostring, date
+ */
+ public native function toString():String;
+
+ /**
+ * Returns the number of milliseconds since midnight January 1, 1970, universal time,
+ * for a Date object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The number of milliseconds since January 1, 1970 that a Date object represents.
+ *
+ * @includeExample examples\Date.valueOf.1.as -noswf
+ *
+ * @helpid
+ * @refpath Objects/Core/Date/Methods/valueOf
+ * @keyword date.valueof, valueof, date
+ */
+ public native function valueOf():Number;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// DefinitionError object
+//****************************************************************************
+/**
+ * The DefinitionError class represents an error that occurs whenever user code
+ * attempts to define an identifier that is already defined. Common cases
+ * where this error occurs include redefining classes, interfaces,
+ * or functions.
+ *
+ * @tiptext An DefinitionError is thrown when code attempts to redefine a class,
+ * interface, or function.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ */
+public dynamic class DefinitionError extends Error
+{
+ /**
+ * Creates a new DefinitionError object.
+ */
+ public native function DefinitionError(message:String = "");
+}
+
+
+}
+package flash.errors
+{
+ /**
+ * An EOFError exception is thrown when you attempt to read past the end of the available data. For example, an
+ * EOFError is thrown when one of the read methods in the IDataInput interface is
+ * called and there is insufficient data to satisfy the read request.
+ *
+ * @includeExample examples\EOFErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @see flash.utils.ByteArray
+ * @see flash.utils.IDataInput
+ * @see flash.net.Socket
+ * @see flash.net.URLStream
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class EOFError extends IOError {
+ /**
+ * Creates a new EOFError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function EOFError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Error object
+//****************************************************************************
+/**
+ * Contains information about an error that occurred in a script. While developing ActionScript 3.0 applications,
+ * you can run your compiled code and Flash Player will display exceptions of type Error, or of a subclass,
+ * in a dialog box at runtime to help you troubleshoot the code.
+ * You create an Error object using the Error constructor function.
+ * Typically, you throw a new Error object from within a try
+ * code block that is then caught by a catch or finally code block.
+ *
You can also create a subclass of the Error class and throw instances of that subclass.
+ *
+ * @includeExample examples\ErrorExample.as -noswf
+ *
+ * @tiptext An Error is thrown when an error occurs in a script.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+public dynamic class Error extends Object
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Error() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Error()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Contains the reference number associated with the specific error message. For a custom Error object
+ * this number is the value from the id parameter supplied in the constructor.
+ * @return The error code number for a specific error message.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Contains the error number.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.errorID, errorID
+ */
+ public native function get errorID():int;
+
+ /**
+ * Contains the message associated with the Error object. By default, the value of this property
+ * is "Error". You can specify a message property when you create an
+ * Error object by passing the error string to the Error constructor function.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Contains the error message associated with the Error instance.
+ *
+ * @oldexample In the following example, a method throws errors based on the
+ * parameters passed to it. If either of the parameters is unspecified an instance of
+ * the Error class with an appropriate message is thrown. If the second parameter is
+ * zero an error with a different message gets thrown:
+ *
+ * function divideNum(num1:Number, num2:Number):Number {
+ * if (isNaN(num1) || isNaN(num2)) {
+ * throw new Error("divideNum function requires two numeric parameters.");
+ * } else if (num2 == 0) {
+ * throw new Error("cannot divide by zero.");
+ * }
+ * return num1/num2;
+ * }
+ * try {
+ * var theNum:Number = divideNum(1, 0);
+ * trace("SUCCESS! "+theNum);
+ * } catch (e_err:Error) {
+ * trace("ERROR! "+e_err.message);
+ * trace("\t"+e_err.name);
+ * }
+ *
+ * If you test this ActionScript with the specified parameters, an error message
+ * displays indicating that you are attempting to divide by 0.
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.message, message
+ */
+ public var message:String;
+
+ /**
+ * Contains the name of the Error object. By default, the value of this property is "Error".
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The name of the Error instance.
+ *
+ * @oldexample In the following example, a function throws a specified error depending on the two numbers that you try to divide. Add the following ActionScript to Frame 1 of the Timeline:
+ *
+ * function divideNumber(numerator:Number, denominator:Number):Number {
+ * if (isNaN(numerator) || isNaN(denominator)) {
+ * throw new Error("divideNum function requires two numeric parameters.");
+ * } else if (denominator == 0) {
+ * throw new DivideByZeroError();
+ * }
+ * return numerator/denominator;
+ * }
+ * try {
+ * var theNum:Number = divideNumber(1, 0);
+ * trace("SUCCESS! "+theNum);
+ * // output: DivideByZeroError -> Unable to divide by zero.
+ * } catch (e_err:DivideByZeroError) {
+ * // divide by zero error occurred
+ * trace(e_err.name+" -> "+e_err.toString());
+ * } catch (e_err:Error) {
+ * // generic error occurred
+ * trace(e_err.name+" -> "+e_err.toString());
+ * }
+ *
+ *
In the following example, we define a custom Error class called
+ * DivideByZeroError:
+ *
+ * class DivideByZeroError extends Error {
+ * public DivideByZeroError() {
+ * super ("Unable to divide by zero.");
+ * name = "DivideByZeroError";
+ * }
+ * }
+ *
+ *
The following method then throws the custom error when it detects the
+ * appropriate error conditions:
+ *
+ * function divideNumbers(num1:Number, num2:Number) { etc.
+ *
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.name, name
+ */
+ public var name:String;
+
+ /**
+ * Creates a new Error object. If message is specified, its value is assigned
+ * to the object's Error.message property.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Creates a new Error instance with the specified error message.
+ *
+ * @param message A string associated with the Error object; this parameter
+ * is optional.
+ * @param id A reference number to associate with the specific error message.
+ *
+ * @return A reference to an Error object.
+ *
+ * @includeExample examples\Error.1.as -noswf
+ *
+ * @oldexample In the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical:
+ *
+ * function compareStrings(str1_str:String, str2_str:String):void {
+ * if (str1_str != str2_str) {
+ * throw new Error("Strings do not match.");
+ * }
+ * }
+ * try {
+ * compareStrings("Dog", "dog");
+ * // output: Strings do not match.
+ * } catch (e_err:Error) {
+ * trace(e_err.toString());
+ * }
+ *
+ *
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error, constructor
+ */
+ public native function Error(message:String = "", id:int = 0);
+
+ /**
+ * For debugger versions of the Flash Player, only; this method returns the call stack for an error
+ * as a string at the time of the error's construction. The first line of the return value is the
+ * string representation of the exception object, followed by the strack trace elements. For example:
+ *
+ * TypeError: null cannot be converted to an object
+ * at com.xyz.OrderEntry.retrieveData(OrderEntry.as:995)
+ * at com.xyz.OrderEntry.init(OrderEntry.as:200)
+ * at com.xyz.OrderEntry.$construct(OrderEntry.as:148)
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the call stack for an error in a readable form.
+ *
+ *
+ * @return A string representation of the call stack.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error, call stack
+ */
+ public native function getStackTrace():String
+
+ /**
+ *
+ * Returns the string "Error" by default or the value contained in Error.message, if defined.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the error message, or the word "Error" if the message is
+ * undefined.
+ *
+ * @return The error message.
+ *
+ * @includeExample examples\Error.toString.1.as -noswf
+ *
+ * @oldexample In the following example, a function throws an error (with a specified message) if the two strings that are passed to it are not identical:
+ *
+ * function compareStrings(str1_str:String, str2_str:String):void {
+ * if (str1_str != str2_str) {
+ * throw new Error("Strings do not match.");
+ * }
+ * }
+ * try {
+ * compareStrings("Dog", "dog");
+ * // output: Strings do not match.
+ * } catch (e_err:Error) {
+ * trace(e_err.toString());
+ * }
+ *
+ *
+ * @see #message Error.message
+ * @see statements.html#throw
+ * @see statements.html#try..catch..finally
+ *
+ * @helpid
+ * @refpath
+ * @keyword Error.toString, toString
+ */
+ override native public function toString():String;
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// EvalError object
+//****************************************************************************
+/**
+ * The EvalError class represents an error that occurs whenever user code
+ * calls the eval() function or attempts to use the new
+ * operator with a Function object. Neither calling eval() nor
+ * calling new with a Function object is supported.
+ *
+ * @tiptext An EvalError is thrown when code attempts to call eval() or use new with
+ * a Function object.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ */
+public dynamic class EvalError extends Error
+{
+ /**
+ * Creates a new EvalError object.
+ */
+ public native function EvalError(message:String = "");
+}
+
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Function object
+//****************************************************************************
+
+
+/**
+ * A Function is the basic unit of code that can be invoked in ActionScript.
+ * Both user-defined and built-in functions in ActionScript are represented by Function objects,
+ * which are instances of the Function class.
+ *
Methods of a class are slightly different than Function objects. Unlike an ordinary function object, a method is tightly linked to its associated class object. So, a method or property has a definition that is shared among all instances of the same class. Methods can be extracted from an instance and treated as "bound methods" (retaining the link to the original instance). For a bound method, the this keyword points to the original object that implemented the method. For a function, this points to the associated object at the time the function is invoked.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @includeExample examples\FunctionExample.as -noswf
+ *
+ * @tiptext The Function class is used to represent a built-in or user-defined function.
+ *
+ * @helpid
+ * @refpath
+ * @keyword Function, Function object, built-in class
+ */
+dynamic public class Function
+{
+ /**
+ */
+ public var prototype:Object;
+
+ /**
+ * Specifies the value of thisObject to be used within any function that ActionScript calls.
+ * This method also specifies the parameters to be passed to any called function. Because apply()
+ * is a method of the Function class, it is also a method of every Function object in ActionScript.
+ *
The parameters are specified as an Array object, unlike Function.call(), which specifies
+ * parameters as a comma-delimited list. This is often useful when the number of parameters to be passed is not
+ * known until the script actually executes.
+ *
Returns the value that the called function specifies as the return value.
+
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the object instance on which the Function is called.
+ *
+ * @param thisObject The object to which myFunction is applied.
+ *
+ * @param argArray An array whose elements are passed to myFunction as parameters.
+ *
+ * @return Any value that the called function specifies.
+ *
+ *
+ * @oldexample The following function invocations are equivalent:
+ *
The following simple example shows how apply() passes an array of parameters:
+ *
+ * function theFunction() {
+ * trace(arguments);
+ * }
+ *
+ * // create a new array to pass as a parameter to apply()
+ * var firstArray:Array = new Array(1,2,3);
+ * theFunction.apply(null,firstArray);
+ * // outputs: 1,2,3
+ *
+ * // create a second array to pass as a parameter to apply()
+ * var secondArray:Array = new Array("a", "b", "c");
+ * theFunction.apply(null,secondArray);
+ * // outputs a,b,c
+ *
+ *
The following example shows how apply() passes an array of parameters and specifies the value of this:
+ *
+ * // define a function
+ * function theFunction() {
+ * trace("this == myObj? " + (this == myObj));
+ * trace("arguments: " + arguments);
+ * }
+ *
+ * // instantiate an object
+ * var myObj:Object = new Object();
+ *
+ * // create arrays to pass as a parameter to apply()
+ * var firstArray:Array = new Array(1,2,3);
+ * var secondArray:Array = new Array("a", "b", "c");
+ *
+ * // use apply() to set the value of this to be myObj and send firstArray
+ * theFunction.apply(myObj,firstArray);
+ * // output:
+ * // this == myObj? true
+ * // arguments: 1,2,3
+ *
+ * // use apply() to set the value of this to be myObj and send secondArray
+ * theFunction.apply(myObj,secondArray);
+ * // output:
+ * // this == myObj? true
+ * // arguments: a,b,c
+ *
+ *
+ * @see #call() Function.call()
+ * @helpid
+ * @refpath
+ * @keyword Function, Function.apply, apply
+ */
+ public native function apply(thisObject:Object,argArray:Array = null): void;
+
+ /**
+ * Invokes the function represented by a Function object. Every function in ActionScript
+ * is represented by a Function object, so all functions support this method.
+ *
In almost all cases, the function call (()) operator can be used instead of this method.
+ * The function call operator produces code that is concise and readable. This method is primarily useful
+ * when the thisObject parameter of the function invocation needs to be explicitly controlled.
+ * Normally, if a function is invoked as a method of an object, within the body of the function, thisObject
+ * is set to myObject, as shown in the following example:
+ *
+ * myObject.myMethod(1, 2, 3);
+ *
+ *
In some situations, you might want thisObject to point somewhere else;
+ * for example, if a function must be invoked as a method of an object, but is not actually stored as a method
+ * of that object:
You can pass the value null for the thisObject parameter to invoke a function as a
+ * regular function and not as a method of an object. For example, the following function invocations are equivalent:
Returns the value that the called function specifies as the return value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Invokes this Function.
+ *
+ * @param thisObject An object that specifies the value of thisObject within the function body.
+ *
+ * @param parameter1 A parameter to be passed to the myFunction. You can specify zero or more parameters.
+ *
+ * @oldexample The following example uses Function.call() to make a function behave as a method of another object, without storing the function in the object:
+ *
+ * function myObject() {
+ * }
+ * function myMethod(obj) {
+ * trace("this == obj? " + (this == obj));
+ * }
+ * var obj:Object = new myObject();
+ * myMethod.call(obj, obj);
+ *
+ *
The trace() statement displays:
+ *
The trace() statement sends the following code to the log file:
+ *
+ * this == obj? true
+ *
+ *
+ * @see #apply() Function.apply()
+ * @helpid
+ * @refpath
+ * @keyword Function, Function.call, call
+ */
+ public native function call(thisObject:Object, parameter1:String = null): void;
+ /**
+ */
+ public native function toString():String;
+}
+
+
+}
+package {
+// Top Level functions
+
+
+ /**
+ * Creates a new array. The array can be of length zero or more, or an array populated by a list of
+ * specified elements, possibly of different data types. The number and data type of
+ * the arguments you use determine the contents of the returned array.
+ *
+ *
Calling Array() with no arguments returns an empty array.
+ *
Calling Array() with a single integer argument returns an array of the specified length, but whose elements have undefined values.
+ *
Calling Array() with a list of specific values returns an array with elements that contain each of the specified values.
+ *
+ * Using the Array() function is similar to creating an array with the Array class constructor.
+ *
Use the as operator for explicit type conversion, or type casting,
+ * when the argument is not a primitive value. For more information, see the Example
+ * section of this entry.
+ * @includeExample examples\Array.func.4.as -noswf
+ * @includeExample examples\Array.func.5.as -noswf
+ * @param args You can pass no arguments for an empty array, a single integer argument for an array of a specific length, or a series of comma-separated values of various types for an array populated with those values.
+ * @return An array of length zero or more.
+ * @see Array Array class
+ * @see operators.html#as as operator
+ */
+ public native function Array(...args):Array
+
+ /**
+ * Converts the expression parameter to a Boolean value and returns the value.
+ *
The return value depends on the data type and value of the argument, as described in the following table:
+ *
+ *
+ *
+ *
Input Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
0
+ *
0
+ *
false
+ *
+ *
+ *
NaN
+ *
NaN
+ *
false
+ *
+ *
+ *
Number (not 0 or NaN)
+ *
4
+ *
true
+ *
+ *
+ *
Empty string
+ *
""
+ *
false
+ *
+ *
+ *
Non-empty string
+ *
"6"
+ *
true
+ *
+ *
+ *
null
+ *
null
+ *
false
+ *
+ *
+ *
undefined
+ *
undefined
+ *
false
+ *
+ *
+ *
instance of Object class
+ *
var obj:Object = new Object(); Boolean(obj)
+ *
true
+ *
+ *
+ *
No argument
+ *
Boolean()
+ *
false
+ *
+ *
+ *
Unlike previous versions of ActionScript, the Boolean() function returns the same results as does the Boolean class constructor.
+ * @param expression An expression or object to convert to Boolean.
+ * @return The result of the conversion to Boolean.
+ */
+ public native function Boolean(expression:Object):Boolean
+
+ /**
+ * Decodes an encoded URI into a string. Returns a string in which all characters previously encoded
+ * by the encodeURI function are restored to their unencoded representation.
+ *
The following table shows the set of escape sequences that are not decoded to characters by the decodeURI function. Use decodeURIComponent() to decode the escape sequences in this table.
+ *
+ *
+ *
Escape sequences not decoded
+ *
Character equivalents
+ *
+ *
+ *
%23
+ *
#
+ *
+ *
+ *
%24
+ *
$
+ *
+ *
+ *
%26
+ *
&
+ *
+ *
+ *
%2B
+ *
+
+ *
+ *
+ *
%2C
+ *
,
+ *
+ *
+ *
%2F
+ *
/
+ *
+ *
+ *
%3A
+ *
:
+ *
+ *
+ *
%3B
+ *
;
+ *
+ *
+ *
%3D
+ *
=
+ *
+ *
+ *
%3F
+ *
?
+ *
+ *
+ *
%40
+ *
@
+ *
+ *
+
+ * @param uri A string encoded with the encodeURI function.
+ * @return A string in which all characters previously escaped by the encodeURI function are
+ * restored to their unescaped representation.
+ * @includeExample examples\DecodeURIExample.as -noswf
+
+ * @see global#decodeURIComponent()
+ * @see global#encodeURI()
+ * @see global#encodeURIComponent()
+ */
+ public native function decodeURI(uri:String):String
+
+ /**
+ * Decodes an encoded URI component into a string. Returns a string in which
+ * all characters previously escaped by the encodeURIComponent
+ * function are restored to their uncoded representation.
+ *
This function differs from the decodeURI() function in that it is intended for use only with a part of a URI string, called a URI component.
+ * A URI component is any text that appears between special characters called component separators ( ":", "/", ";" and "?" ).
+ * Common examples of a URI component are "http" and "www.adobe.com".
+ *
Another important difference between this function and decodeURI() is that because this function
+ * assumes that it is processing a URI component it treats the escape sequences that represent special separator characters (; / ? : @ & = + $ , #) as regular
+ * text that should be decoded.
+ * @param uri A string encoded with the encodeURIComponent function.
+ * @return A string in which all characters previously escaped by the encodeURIComponent function are
+ * restored to their unescaped representation.
+ * @see global#decodeURI()
+ * @see global#encodeURI()
+ * @see global#encodeURIComponent()
+ */
+ public native function decodeURIComponent(uri:String):String
+
+ /**
+ * Encodes a string into a valid URI (Uniform Resource Identifier).
+ * Converts a complete URI into a string in which all characters are encoded
+ * as UTF-8 escape sequences unless a character belongs to a small group of basic characters.
+ *
The following table shows the entire set of basic characters that are not converted to UTF-8 escape sequences by the encodeURI function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
; / ? : @ & = + $ , #
+ *
+ *
+ *
- _ . ! ~ ~~ ' ( )
+ *
+ *
+ * @param uri A string representing a complete URI.
+ * @return A string with certain characters encoded as UTF-8 escape sequences.
+ * @includeExample examples\EncodeURIExample.as -noswf
+ * @see global#decodeURI()
+ * @see global#decodeURIComponent()
+ * @see global#encodeURIComponent()
+ */
+ public native function encodeURI(uri:String):String
+
+ /**
+ * Encodes a string into a valid URI component. Converts a substring of a URI into a
+ * string in which all characters are encoded as UTF-8 escape sequences unless a character
+ * belongs to a very small group of basic characters.
+ *
The encodeURIComponent() function differs from the encodeURI() function in that it is intended for use only with a part of a URI string, called a URI component.
+ * A URI component is any text that appears between special characters called component separators ( ":", "/", ";" and "?" ).
+ * Common examples of a URI component are "http" and "www.adobe.com".
+ *
Another important difference between this function and encodeURI() is that because this function
+ * assumes that it is processing a URI component it treats the special separator characters (; / ? : @ & = + $ , #) as regular
+ * text that should be encoded.
+ *
The following table shows all characters that are not converted to UTF-8 escape sequences by the encodeURIComponent function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
- _ . ! ~ ~~ ' ( )
+ *
+ *
+ * @see global#decodeURI()
+ * @see global#decodeURIComponent()
+ * @see global#encodeURI()
+ */
+ public native function encodeURIComponent(uri:String):String
+
+ /**
+ * Converts the parameter to a string and encodes it in a URL-encoded format,
+ * where most nonalphanumeric characters are replaced with % hexadecimal sequences.
+ * When used in a URL-encoded string, the percentage symbol (%) is used to introduce
+ * escape characters, and is not equivalent to the modulo operator (%).
+ *
The following table shows all characters that are not converted to escape sequences by the escape() function.
+ *
+ *
+ *
Characters not encoded
+ *
+ *
+ *
0 1 2 3 4 5 6 7 8 9
+ *
+ *
+ *
a b c d e f g h i j k l m n o p q r s t u v w x y z
+ *
+ *
+ *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+ *
+ *
+ *
@ - _ . ~~ + /
+ *
+ *
+
+ * @param str The expression to convert into a string and encode in a URL-encoded format.
+ * @return A URL-encoded string.
+ * @see global#unescape()
+ */
+ public native function escape(str:String):String
+
+ /**
+ * Converts a given numeric value to an integer value. Decimal values are truncated at the decimal point.
+ * @param value A value to be converted to an integer.
+ * @return The converted integer value.
+ * @see global#uint()
+ */
+ public native function int(value:Number):int
+
+ /**
+ * Returns true if the value is a finite number,
+ * or false if the value is Infinity or -Infinity.
+ * The presence of Infinity or -Infinity indicates a mathematical
+ * error condition such as division by 0.
+ * @param num A number to evaluate as finite or infinite.
+ * @return Returns true if it is a finite number
+ * or false if it is infinity or negative infinity.
+ */
+ public native function isFinite(num:Number):Boolean
+
+
+ /**
+ * Returns true if the value is NaN(not a number). The isNaN() function is useful for checking whether a mathematical expression evaluates successfully to a number. The NaN value is a special member of the Number data type that represents a value that is "not a number."
+ *
Note: The NaN value is not a member of the int or uint data types.
+ *
The following table describes the return value of isNaN() on various input types and values.
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
0 divided by 0
+ *
isNaN(0/0)
+ *
true
+ *
+ *
+ *
Non-zero number divided by 0
+ *
isNaN(5/0)
+ *
false
+ *
+ *
+ *
Square root of a negative number
+ *
isNaN(Math.sqrt(-1))
+ *
true
+ *
+ *
+ *
Arcsine of number greater than 1 or less than 0
+ *
isNaN(Math.asin(2))
+ *
true
+ *
+ *
+ *
String that can be converted to Number
+ *
isNaN("5")
+ *
false
+ *
+ *
+ *
String that cannot be converted to Number
+ *
isNaN("5a")
+ *
true
+ *
+ *
+ * @param num A numeric value or mathematical expression to evaluate.
+ * @return Returns true if the value is NaN(not a number) and false otherwise.
+ */
+ public native function isNaN(num:Number):Boolean
+
+ /**
+ * Determines whether the specified string is a valid name for an XML element or attribute.
+ * @param str A string to evaluate.
+ * @return Returns true if the str argument is a valid XML name; false otherwise.
+ */
+ public native function isXMLName(str:String):Boolean
+
+ /**
+ * Converts a given value to a Number value. The following table shows the result of various input types:
+ *
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
Number(undefined)
+ *
NaN
+ *
+ *
+ *
null
+ *
Number(null)
+ *
0
+ *
+ *
+ *
true
+ *
Number(true)
+ *
1
+ *
+ *
+ *
false
+ *
Number(false)
+ *
0
+ *
+ *
+ *
NaN
+ *
Number(NaN)
+ *
NaN
+ *
+ *
+ *
Empty string
+ *
Number("")
+ *
0
+ *
+ *
+ *
String that converts to Number
+ *
Number("5")
+ *
The number (e.g. 5)
+ *
+ *
+ *
String that does not convert to Number
+ *
Number("5a")
+ *
NaN
+ *
+ *
+ * @param value A value to be converted to a number.
+ * @return The converted number value.
+ */
+ public native function Number(expression:Object):Number
+
+ /**
+ * Every value in ActionScript 3.0 is an object, which means that calling Object() on a value returns that value.
+ * @param value An object or a number, string, or Boolean value to convert.
+ * @return The value specified by the value parameter.
+ */
+ public native function Object(value:Object):Object
+
+ /**
+ * Converts a string to an integer. If the specified string in the parameters cannot be converted to a number, the function returns NaN. Strings beginning with 0x are interpreted as hexadecimal numbers. Unlike in previous versions of ActionScript, integers beginning with 0 are not interpreted as octal numbers. You must specify a radix of 8 for octal numbers. White space and zeroes preceding valid integers is ignored, as are trailing nonnumeric characters.
+ * @param str A string to convert to an integer.
+ * @param radix An integer representing the radix (base) of the number to parse. Legal values are from 2 to 36.
+ * @return A number or NaN (not a number).
+ */
+ public native function parseInt(str:String, radix:uint=0):Number
+
+ /**
+ * Converts a string to a floating-point number. The function reads, or parses, and returns the numbers in a string until it reaches a character that is not a part of the initial number. If the string does not begin with a number that can be parsed, parseFloat() returns NaN. White space preceding valid integers is ignored, as are trailing nonnumeric characters.
+ * @param str The string to read and convert to a floating-point number.
+ * @return A number or NaN (not a number).
+ */
+ public native function parseFloat(str:String):Number
+
+ /**
+ * Returns a string representation of the specified parameter.
+ *
The following table shows the result of various input types:
+ *
+ *
+ *
Input Type/Value
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
undefined
+ *
+ *
+ *
null
+ *
"null"
+ *
+ *
+ *
true
+ *
"true"
+ *
+ *
+ *
false
+ *
"false"
+ *
+ *
+ *
NaN
+ *
"NaN"
+ *
+ *
+ *
String
+ *
String
+ *
+ *
+ *
Object
+ *
Object.toString()
+ *
+ *
+ *
Number
+ *
String representation of the number
+ *
+ *
+ * @param expression An expression to convert to a string.
+ * @return A string representation of the value passed for the expression parameter.
+ */
+ public native function String(expression:Object):String
+
+ /**
+ * Evaluates the parameter str as a string, decodes the string from URL-encoded format
+ * (converting all hexadecimal sequences to ASCII characters), and returns the string.
+ * @param str A string with hexadecimal sequences to escape.
+ * @return A string decoded from a URL-encoded parameter.
+ */
+ public native function unescape(str:String):String
+
+ /**
+ * Converts a given numeric value to an unsigned integer value. Decimal values are truncated at the decimal point.
+ *
The following table describes the return value of uint() on various input types and values.
+ *
+ *
+ *
Input Type/Value
+ *
Example
+ *
Return Value
+ *
+ *
+ *
undefined
+ *
uint(undefined)
+ *
0
+ *
+ *
+ *
null
+ *
uint(null)
+ *
0
+ *
+ *
+ *
0
+ *
uint(0)
+ *
0
+ *
+ *
+ *
NaN
+ *
uint(NaN)
+ *
0
+ *
+ *
+ *
Positive floating point number
+ *
uint(5.31)
+ *
Truncated unsigned integer (e.g. 5)
+ *
+ *
+ *
Negative floating point number
+ *
uint(-5.78)
+ *
Truncates to integer then applies rule for negative integers
+ *
+ *
+ *
Negative integer
+ *
uint(-5)
+ *
Sum of uint.MAX_VALUE and the negative integer (e.g. uint.MAX_VALUE + (-5))
+ *
+ *
+ *
true
+ *
uint(true)
+ *
1
+ *
+ *
+ *
false
+ *
uint(false)
+ *
0
+ *
+ *
+ *
Empty String
+ *
uint("")
+ *
0
+ *
+ *
+ *
String that converts to Number
+ *
uint("5")
+ *
See rules for Numbers in this table
+ *
+ *
+ *
String that does not convert to Number
+ *
uint("5a")
+ *
0
+ *
+ *
+
+ * @param value A value to be converted to an integer.
+ * @return The converted integer value.
+ * @see global#int()
+ */
+ public native function uint(value:Number):uint
+
+ /**
+ * Converts an object to an XML object.
+ *
The following table describes return values for various input types.
+ *
+ *
+ *
Parameter Type
+ *
Return Value
+ *
+ *
+ *
Boolean
+ *
Value is first converted to a string, then converted to an XML object.
+ *
+ *
+ *
Null
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
Number
+ *
Value is first converted to a string, then converted to an XML object.
+ *
+ *
+ *
Object
+ *
Converts to XML only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ *
String
+ *
Value is converted to XML.
+ *
+ *
+ *
Undefined
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
XML
+ *
Input value is returned unchanged.
+ *
+ *
+ *
XMLList
+ *
Returns an XML object only if the XMLList object contains only one property of type XML. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ * @param expression Object to be converted to XML.
+ * @return An XML object containing values held in the converted object.
+ * @see global#XMLList()
+ */
+ public native function XML(expression:Object):XML
+
+ /**
+ * Converts an object to an XMLList object, as described in the following table.
+ *
+ *
+ *
Parameter Type
+ *
Return Value
+ *
+ *
+ *
Boolean
+ *
Value is first converted to a string, then converted to an XMLList object.
+ *
+ *
+ *
Null
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
Number
+ *
Value is first converted to a string, then converted to an XMLList object.
+ *
+ *
+ *
Object
+ *
Converts to XMLList only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception).
+ *
+ *
+ *
String
+ *
Value is converted to an XMLList object.
+ *
+ *
+ *
Undefined
+ *
A runtime error occurs (TypeError exception).
+ *
+ *
+ *
XML
+ *
Value is converted to an XMLList object.
+ *
+ *
+ *
XMLList
+ *
Input value is returned unchanged.
+ *
+ *
+ * @param expression Object to be converted into an XMLList object.
+ * @return An XMLList object containing values held in the converted object.
+ * @see global#XML()
+ */
+ public native function XMLList(expression:Object):XMLList
+
+
+}
+package flash.errors
+{
+ /**
+ * The IllegalOperationError exception is thrown when a method is not implemented or the
+ * implementation doesn't cover the current usage.
+ *
+ * Examples of illegal operation error exceptions include:
+ *
+ *
A base class, such as DisplayObjectContainer, provides more functionality than a Stage
+ * can support (such as masks)
+ *
Certain accessibility methods are called when Flash Player is compiled without accessibility
+ * support
+ *
The mms.cfg setting prohibits a FileReference action
+ *
ActionScript tries to run a FileReference.browse() call when a browse dialog box is already up
+ *
ActionScript tries to use an unsupported protocol for FileReference (such as FTP)
+ *
+ *
Authoring only features are invoked from a run-time player.
+ *
An attempt is made to set the name of a timeline-placed object.
+ *
+ *
+ *
+ *
+ *
+ * @includeExample examples\IllegalOperationErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class IllegalOperationError extends Error {
+ /**
+ * Creates a new IllegalOperationError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function IllegalOperationError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+/**
+ * A data type representing a 32-bit signed integer.
+ * The range of values represented by the int class is -2,147,483,648 (-2^31) to 2,147,483,647 (2^31-1).
+ *
The properties of the int class are static, which means you do not need an object to use them, so you do not need to use the constructor. The methods, however, are not static, which means that you do need an object to use them. You can create an int object by using the int class constructor or by declaring a variable of type int and assigning the variable a literal value.
+ *
The int data type is useful for loop counters and other situations where a floating point number is not needed, and is similar to the int data type in Java and C++. The default value of a variable typed as int is 0
+ *
If you are working with numbers that exceed int.MAX_VALUE, consider using Number.
+ *
The following example calls the toString() method of the int class, which returns the string 1234:
+ *
+ *
+ * @helpid x20964
+ * @refpath Objects/Core/int/Constants/MAX_VALUE
+ * @keyword int, int.max_value, max_value, max value
+ */
+ public static const MAX_VALUE:int = 2147483647;
+
+ /**
+ * The smallest representable 32-bit signed integer, which is -2,147,483,648.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @example The following ActionScript displayswrites the largest and smallest representable ints to the Output panel to the log file:
+ *
+ *
+ *
+ * @helpid x2096B
+ * @refpath Objects/Core/int/Constants/MIN_VALUE
+ * @keyword int, int.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:int = -2147483648;
+
+ /**
+ * Constructor; creates a new int object. You must use the int constructor when using int.toString() and int.valueOf(). You do not use a constructor when using the properties of a int object. The new int constructor is primarily used as a placeholder. A int object is not the same as the int() function that converts a parameter to a primitive value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ *
+ * @param num The numeric value of the int object being created or a value to be converted to a number. The default value is 0 if value is not provided.
+ *
+ * @return A reference to a int object.
+ *
+ * @example The following code constructs new int objects:
+ *
+ * var n1:int = new int(3.4);
+ * var n2:int = new int(-10);
+ *
+ *
+ *
+ * @see int#toString()
+ * @see int#valueOf()
+ * @helpid x2097C
+ * @refpath Objects/Core/int/new int
+ * @keyword new number, constructor
+ */
+ public native function int(num:Object);
+
+ /**
+ * Returns the string representation of an int object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10.
+ *
+ * @return A string.
+ *
+ * @example The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9:
+ *
The following example results in a hexadecimal value.
+ *
+ * var r:int = new int(250);
+ * var g:int = new int(128);
+ * var b:int = new int(114);
+ * var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
+ * trace(rgb);
+ * // output: rgb:0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid x2097E
+ * @refpath Objects/Core/int/Methods/toString
+ * @keyword number, number.tostring, tostring
+ */
+ public native function toString(radix:uint):String;
+
+ /**
+ * Returns the primitive value of the specified int object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return An int value.
+ *
+ * @example The following example results in the primative value of the numSocks object.
+ *
+ * var numSocks = new int(2);
+ * trace(numSocks.valueOf()); // output: 2
+ *
+ *
+ * @helpid x20A24
+ * @refpath Objects/Core/int/Methods/valueOf
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():int;
+}
+}
+package flash.errors
+{
+ /**
+ * The IOError exception is thrown when some type of input or output failure occurs.
+ * For example, an IOError exception is thrown if a read/write operation is attempted on
+ * a socket that has not connected or that has become disconnected.
+ *
+ *
+ * @includeExample examples\IOErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class IOError extends Error {
+ /**
+ * Creates a new IOError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function IOError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Math object
+//****************************************************************************
+
+/**
+ * The Math class contains methods and constants that represent common mathematical
+ * functions and values.
+ *
Use the methods and properties of this class to access and manipulate mathematical constants and functions.
+ * All the properties and methods of the Math class are static and must be called using the syntax
+ * Math.method(parameter) or Math.constant.
+ * In ActionScript, constants are defined with the maximum precision of double-precision IEEE-754 floating-point numbers.
+ *
Several Math class methods use the measure of an angle in radians as a parameter. You can use the following equation
+ * to calculate radian values before calling the method and then provide the calculated value as the parameter, or you can
+ * provide the entire right side of the equation (with the angle's measure in degrees in place of degrees) as
+ * the radian parameter.
+ *
To calculate a radian value, use the following formula:
+ *
+ * radians = degrees ~~ Math.PI/180
+ *
+ *
To calculate degrees from radians, use the following formula:
+ *
+ * degrees = radians ~~ 180/Math.PI
+ *
+ *
The following is an example of passing the equation as a parameter to calculate the sine of a 45° angle:
+ *
Math.sin(45 ~~ Math.PI/180) is the same as Math.sin(.7854)
+ *
Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow, sin, and sqrt may
+ * result in slightly different values depending on the algorithms
+ * used by the CPU or operating system. Flash Player calls on the CPU (or operating system if the CPU doesn't support
+ * floating point calculations) when performing the calculations for the listed functions, and results have shown
+ * slight variations depending upon the CPU or operating system in use.
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The Math class is a top-level class consisting of static properties and
+ * methods that define common mathematical constants and functions.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math, math object, built-in class
+ */
+public final class Math
+{
+ /**
+ * A mathematical constant for the base of natural logarithms, expressed as e.
+ * The approximate value of eis 2.71828182845905.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base of natural logarithms, expressed as e.
+ *
+ * @oldexample This example shows how Math.E is used to compute
+ * continuously compounded interest for a simple case of 100 percent interest over
+ * a one-year period.
+ *
+ * var principal:Number = 100;
+ * var simpleInterest:Number = 100;
+ * var continuouslyCompoundedInterest:Number = (100 * Math.E) - principal;
+ *
+ * trace ("Beginning principal: $" + principal);
+ * trace ("Simple interest after one year: $" + simpleInterest);
+ * trace ("Continuously compounded interest after one year: $" + continuouslyCompoundedInterest);
+ *
+ * // Output:
+ * Beginning principal: $100
+ * Simple interest after one year: $100
+ * Continuously compounded interest after one year: $171.828182845905
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.e, e
+ */
+ public static const E:Number = 2.71828182845905;
+
+ /**
+ * A mathematical constant for the natural logarithm of 10, expressed as loge10,
+ * with an approximate value of 2.302585092994046.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the natural logarithm of 10, expressed
+ * as loge10, with an approximate value of 2.302585092994046.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ln10, ln10, logarithm
+ */
+ public static const LN10:Number = 2.302585092994046;
+
+ /**
+ * A mathematical constant for the natural logarithm of 2, expressed as loge2,
+ * with an approximate value of 0.6931471805599453.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the natural logarithm of 2, expressed
+ * as loge2, with an approximate value of 0.6931471805599453.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ln2, ln2, natural logarithm
+ */
+ public static const LN2:Number = 0.6931471805599453;
+
+ /**
+ * A mathematical constant for the base-10 logarithm of the constant e (Math.E),
+ * expressed as log10e, with an approximate value of 0.4342944819032518.
+ *
The Math.log() method computes the natural logarithm of a number. Multiply the
+ * result of Math.log() by Math.LOG10E obtain the base-10 logarithm.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base-10 logarithm of the constant
+ * e, expressed as log10e, with an approximate value of 0.4342944819032518.
+ *
+ * @oldexample This example shows how to obtain the base-10 logarithm of a number:
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log10e, log10e, logarithm
+ */
+ public static const LOG10E:Number = 0.4342944819032518;
+
+ /**
+ * A mathematical constant for the base-2 logarithm of the constant e, expressed
+ * as log2e, with an approximate value of 1.442695040888963387.
+ *
+ *
The Math.log method computes the natural logarithm of a number. Multiply the
+ * result of Math.log() by Math.LOG2E obtain the base-2 logarithm.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the base-2 logarithm of the constant
+ * e, expressed as log2e, with an approximate value of 1.442695040888963387.
+ *
+ * @oldexample This example shows how to obtain the base-2 logarithm of a number:
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log2e, log2e, logarithm
+ */
+ public static const LOG2E:Number = 1.442695040888963387;
+
+ /**
+ * A mathematical constant for the ratio of the circumference of a circle to its diameter,
+ * expressed as pi, with a value of 3.141592653589793.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the ratio of the circumference of a
+ * circle to its diameter, expressed as pi, with a value of 3.141592653589793.
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi
+ * and the Drawing API.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.pi, pi
+ */
+ public static const PI:Number = 3.141592653589793;
+
+ /**
+ * A mathematical constant for the square root of one-half, with an approximate
+ * value of 0.7071067811865476.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the square root of one-half, with an
+ * approximate value of 0.7071067811865476.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt1_2, sqrt1_2, square root
+ */
+ public static const SQRT1_2:Number = 0.7071067811865476;
+
+ /**
+ * A mathematical constant for the square root of 2, with an approximate
+ * value of 1.4142135623730951.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext A mathematical constant for the square root of 2, with an
+ * approximate value of 1.4142135623730951.
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt2, sqrt2, square root
+ */
+ public static const SQRT2:Number = 1.4142135623730951;
+
+
+ /**
+ * Computes and returns an absolute value for the number specified by the
+ * parameter val.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the absolute value of the specified Number.
+ *
+ * @param val The Number whose absolute value is returned.
+ * @return The absolute value of the specified paramater.
+ *
+ * @oldexample The following example shows how Math.abs() returns
+ * the absolute value of a number and does not affect the value of the
+ * val
+ * parameter (called num in this example):
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.abs, abs, absolute
+ */
+ public native static function abs(val:Number):Number;
+
+ /**
+ * Computes and returns the arc cosine of the number specified in the
+ * parameter val, in radians.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the arc cosine, in radians, of the specified
+ * Number.
+ *
+ * @param val A number from -1.0 to 1.0.
+ *
+ * @return The arc cosine of the parameter val.
+ *
+ * @oldexample The following example displays the arc cosine for several values.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.acos, acos, arc cosine
+ */
+ public native static function acos(val:Number):Number;
+
+ /**
+ * Computes and returns the arc sine for the number specified in the
+ * parameter val, in radians.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value, in radians, of the arc sine of the specified
+ * Number parameter.
+ *
+ * @param val A Number from -1.0 to 1.0.
+ *
+ * @return A Number between negative pi divided by 2 and positive pi
+ * divided by 2.
+ *
+ * @oldexample The following example displays the arc sine for several values.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.asin, asin, arc sine
+ */
+ public native static function asin(val:Number):Number;
+
+ /**
+ * Computes and returns the value, in radians, of the angle whose tangent is
+ * specified in the parameter val. The return value is between
+ * negative pi divided by 2 and positive pi divided by 2.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the angle, in radians, whose tangent is specified by
+ * parameter val.
+ *
+ * @param val A Number that represents the tangent of an angle.
+ *
+ * @return A Number between negative pi divided by 2 and positive
+ * pi divided by 2.
+ *
+ * @oldexample The following example displays the angle value for several tangents.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.atan, atan, arc tangent
+ */
+ public native static function atan(val:Number):Number;
+
+ /**
+ * Computes and returns the angle of the point y/x in
+ * radians, when measured counterclockwise from a circle's x axis
+ * (where 0,0 represents the center of the circle). The return value is between
+ * positive pi and negative pi. Note that the first parameter to atan2 is always the y coordinate.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the angle of the point y/x in radians, when measured
+ * counterclockwise from a circle's x axis.
+ *
+ * @param y The y coordinate of the point.
+ * @param x The xcoordinate of the point.
+ *
+ * @return A number.
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#cos()
+ * @see Math#sin()
+ * @see Math#tan()
+ *
+ * @oldexample The following example returns the angle, in radians, of the point specified by the coordinates (0, 10), such that x = 0 and y = 10. Note that the first parameter to atan2 is always the y coordinate.
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.atan2, atan2, arc tangent
+ */
+ public native static function atan2(y:Number,x:Number):Number;
+
+ /**
+ * Returns the ceiling of the specified number or expression. The ceiling of a
+ * number is the closest integer that is greater than or equal to the number.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the ceiling of the specified number or expression.
+ *
+ * @param val A number or expression.
+ * @return An integer that is both closest to, and greater than or equal to, parameter
+ * val.
+ *
+ * @see Math#floor()
+ * @see Math#round()
+ *
+ * @oldexample The following code returns a value of 13:
+ *
+ * Math.ceil(12.5);
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.ceil, ceil, ceiling
+ */
+ public native static function ceil(val:Number):Number;
+
+ /**
+ * Computes and returns the cosine of the specified angle in radians. To
+ * calculate a radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the cosine of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return A number from -1.0 to 1.0.
+ *
+ * @oldexample The following example displays the cosine for several different angles.
+ *
Note: The cosine of a 90 degree angle is zero, but because of the inherent inaccuracy of decimal
+ * calculations using binary numbers, Flash Player will report a number extremely close to, but not exactly equal to, zero.
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#atan2()
+ * @see Math#sin()
+ * @see Math#tan()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.cos, cos, cosine
+ */
+ public native static function cos(angleRadians:Number):Number;
+
+ /**
+ * Returns the value of the base of the natural logarithm (e), to the
+ * power of the exponent specified in the parameter x. The
+ * constant Math.E can provide the value of e.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value of the base of the natural logarithm
+ * (e), to the power of the exponent specified in the parameter val.
+ *
+ * @param val The exponent; a number or expression.
+ * @return e to the power of parameter val.
+ *
+ * @see Math#E
+ * @helpid
+ * @refpath
+ * @keyword math.exp, exp, exponent
+ */
+ public native static function exp(val:Number):Number;
+
+ /**
+ * Returns the floor of the number or expression specified in the parameter
+ * val. The floor is the closest integer that is less than or equal
+ * to the specified number or expression.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the floor of the number or expression specified in the
+ * parameter val.
+ *
+ * @param val A number or expression.
+ * @return The integer that is both closest to, and less than or equal to, parameter
+ * val.
+ *
+ * @oldexample The following code returns a value of 12:
+ *
+ * Math.floor(12.5);
+ *
+ * The following code returns a value of -7:
+ * Math.floor(-6.5);
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.floor, floor
+ */
+ public native static function floor(val:Number):Number;
+
+ /**
+ * Returns the natural logarithm of parameter val.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the natural logarithm of parameter val.
+ *
+ * @param val A number or expression with a value greater than 0.
+ * @return The natural logarithm of parameter val.
+ *
+ * @oldexample The following example displays the logarithm for three numerical values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.log, log, logarithm
+ */
+ public native static function log(val:Number):Number;
+
+ /**
+ * Evaluates val1 and val2 (or more values) and returns the largest value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Evaluates parameters val1 and val2 and
+ * returns the larger value.
+ *
+ * @param val1 A number or expression.
+ * @param val2 A number or expression.
+ * @param ... A number or expression. Math.max() can accept multiple arguments.
+ * @return The largest of the parameters val1 and val2 (or more values).
+ *
+ * @oldexample The following example displays Thu Dec 30 00:00:00 GMT-0700 2004, which is the larger of the evaluated expressions.
+ *
+ * var date1:Date = new Date(2004, 11, 25);
+ * var date2:Date = new Date(2004, 11, 30);
+ * var maxDate:Number = Math.max(date1.getTime(), date2.getTime());
+ * trace(new Date(maxDate).toString());
+ *
+ *
+ * @see Math#min()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.max, max, maximum
+ */
+ public native static function max(val1:Number,val2:Number, ...rest):Number;
+
+ /**
+ * Evaluates val1 and val2 (or more values) and returns the smallest value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Evaluates parameters val1 and val2 and returns the smaller value.
+ *
+ * @param val1 A number or expression.
+ * @param val2 A number or expression.
+ * @param ... A number or expression. Math.min() can accept multiple arguments.
+ * @return The smallest of the parameters val1 and val2 (or more values).
+ *
+ * @oldexample The following example displays Sat Dec 25 00:00:00 GMT-0700 2004, which is the smaller of the evaluated expressions.
+ *
+ * var date1:Date = new Date(2004, 11, 25);
+ * var date2:Date = new Date(2004, 11, 30);
+ * var minDate:Number = Math.min(date1.getTime(), date2.getTime());
+ * trace(new Date(minDate).toString());
+ *
+ *
+ * @see Math#max()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.min, min, minimum
+ */
+ public native static function min(val1:Number,val2:Number, ... rest):Number;
+
+ /**
+ * Computes and returns val1 to the power of val2.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns val1 to the power of val2.
+ *
+ * @param val1 A number to be raised by the power of parameter val2.
+ * @param val2 A number specifying the power the parameter val2 is raised by.
+ * @return The value of parameter val1 raised to the power of parameter
+ * val2.
+ *
+ * @oldexample The following example uses Math.pow and Math.sqrt to calculate the length of a line.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.pow, pow, power
+ */
+ public native static function pow(val1:Number,val2:Number):Number;
+
+ /**
+ * Returns a pseudo-random number n, where 0 <= n < 1. The number returned is calculated in an undisclosed manner, and "pseudo-random" because the calculation inevitably contains some element of "non-randomness".
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns a pseudo-random number n, where 0 <= n < 1.
+ *
+ * @return A pseudo-random number.
+ *
+ * @oldexample The following example outputs 100 random integers between 4 and 11
+ * (inclusively):
+ *
+ * function randRange(min:Number, max:Number):Number {
+ * var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
+ * return randomNum;
+ * }
+ * for (var i = 0; i < 100; i++) {
+ * var n:Number = randRange(4, 11)
+ * trace(n);
+ * }
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.random, random
+ */
+ public native static function random():Number;
+
+ /**
+ * Rounds the value of the parameter val up or down to the nearest
+ * integer and returns the value. If parameter val is equidistant
+ * from its two nearest integers (that is, the number ends in .5), the value
+ * is rounded up to the next higher integer.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the value of parameter val rounded up or down to the
+ * nearest integer.
+ *
+ * @param val The number to round.
+ * @return Parameter val rounded to the nearest whole number.
+ *
+ * @oldexample The following example returns a random number between two specified integers.
+ *
+ * function randRange(min:Number, max:Number):Number {
+ * var randomNum:Number = Math.round(Math.random() * (max - min + 1) + (min - .5));
+ * return randomNum;
+ * }
+ * for (var i = 0; i<25; i++) {
+ * trace(randRange(4, 11));
+ * }
+ *
+ *
+ * @see Math#ceil()
+ * @see Math#floor()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.round, round
+ */
+ public native static function round(val:Number):Number;
+
+ /**
+ * Computes and returns the sine of the specified angle in radians. To
+ * calculate a radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the sine of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return A number; the sine of the specified angle (between -1.0 and 1.0).
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi, the sine of an angle, and the Drawing API.
+ *
+ *
+ * @see Math#acos()
+ * @see Math#asin()
+ * @see Math#atan()
+ * @see Math#atan2()
+ * @see Math#cos()
+ * @see Math#tan()
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sin, sin, sine
+ */
+ public native static function sin(angleRadians:Number):Number;
+
+ /**
+ * Computes and returns the square root of the specified number.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the square root of the specified number.
+ *
+ * @param val A number or expression greater than or equal to 0.
+ * @return A number if parameter val is greater than or equal to zero; NaN (not a number) otherwise.
+ *
+ * @oldexample The following example uses Math.pow and Math.sqrt to calculate the length of a line.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword math.sqrt, sqrt, square root
+ */
+ public native static function sqrt(val:Number):Number;
+
+ /**
+ * Computes and returns the tangent of the specified angle. To calculate a
+ * radian, see the overview of the Math class.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the tangent of the specified angle.
+ *
+ * @param angleRadians A number that represents an angle measured in radians.
+ * @return The tangent of parameter angleRadians.
+ *
+ * @oldexample The following example draws a circle using the mathematical constant pi, the tangent of an angle, and the Drawing API.
+ *
On a desktop machine, memory allocation failures are rare unless an allocation
+ * request is extremely large; a 32-bit Windows program can access only 2GB of
+ * address space, for example, so a request for 10 billion bytes is impossible.
+ *
+ *
By default, Flash Player does not impose a limit on how much memory an
+ * ActionScript program may allocate.
+ *
+ * @includeExample examples\MemoryErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class MemoryError extends Error {
+
+ /**
+ * Creates a new MemoryError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function MemoryError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+//
+// Namespace
+//
+
+// Based on the ECMA E4X spec, 1st Edition
+
+/**
+*
+* The Namespace class contains methods and properties for defining and working with namespaces.
+* There are three use cases for using namespaces:
+*
+*
+*
Namespaces of XML objects Namespaces associate a namespace prefix with a Uniform Resource Identifier (URI)
+* that identifies the namespace. The prefix is a string used to reference the namespace within an
+* XML object. If the prefix is undefined, when the XML is converted to a string, a prefix is
+* automatically generated.
+*
+*
+*
Namespace to differentiate methods Namespaces can differentiate methods with the same name to perform different tasks.
+* If two methods have the same name but separate namespaces, they can perform different tasks.
+*
+*
+*
Namespaces for access control
+* Namespaces can be used to control access to a group of
+* properties and methods in a class. If you place the
+* group of properties and methods into a private
+* namespace, those properties and methods are
+* unreachable by any code that does not have access to
+* that namespace. You can grant access to the group of
+* properties and methods by passing the namespace to
+* other classes, methods or functions.
+*
+*
+*
+*
This class (along with the XML, XMLList, and QName classes) implements
+* powerful XML-handling standards defined in ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2).
+*
+* @includeExample examples\NamespaceExample.1.as -noswf
+* @includeExample examples\NamespaceExample.2.as -noswf
+*
+* @tiptext The Namespace class contains methods and properties for defining and
+* working with namespaces of XML objects.
+*
+* @see XML
+* @see XMLList
+* @see QName
+* @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2)
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid
+* @refpath
+* @keyword Namespace
+*/
+public final class Namespace
+{
+
+ /**
+ * Creates a Namespace object given the uriValue parameter.
+ * The values assigned to the uri and prefix properties
+ * of the new Namespace object depend on the type of value passed for the uriValue parameter:
+ *
+ *
If no argument is passed, the prefix and uri properties are set to the empty string.
+ *
If the argument is a Namespace object, a copy of the object is created.
+ *
If the argument is a QName object, the uri property is set to the uri property of the QName object.
+ *
Otherwise, the argument is converted into a string and assigned to the uri property.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @tiptext Creates a Namespace object, given the uriValue.
+ *
+ * @param uriValue The Uniform Resource Identifier (URI) of the namespace.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function Namespace(uriValue:*);
+
+ /**
+ * The default number of arguments for the constructor. You can specify prefix or uri or both arguments. For details, see the Namespace() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Namespace()
+ */
+ public static const length:int = 2;
+
+ /**
+ * Creates a Namespace object, given the prefixValue and uriValue parameters.
+ * This constructor requires both parameters.
+ *
The value of the prefixValue parameter is assigned to the prefix
+ * property in the following manner:
+ *
+ *
If undefined is passed, prefix is set to undefined.
+ *
If the argument is a valid XML name, as determined by the isXMLName() function, it is converted to a string and assigned to the prefix property.
+ *
If the argument is not a valid XML name, the prefix property is set to undefined.
+ *
+ *
+ *
The value of the uriValue parameter is assigned to the uri
+ * property in the following manner:
+ *
+ *
If a QName object is passed for the uriValue parameter, the uri property is set to the value of the uri property of the QName object.
+ *
Otherwise, the uriValue parameter is converted to a string and assigned to the uri property.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @tiptext Creates a Namespace object, given the prefixValue and uriValue.
+ *
+ * @param prefixValue The prefix to use for the namespace.
+ *
+ * @param uriValue The Uniform Resource Identifier (URI) of the namespace.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function Namespace(prefixValue:*, uriValue:*);
+
+
+ /**
+ * Equivalent to the Namespace.uri property.
+ *
+ * @tiptext Equivalent to the Namespace.uri property.
+ *
+ * @return The Uniform Resource Identifier (URI) of the namespace, as a string.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.toString, toString
+ **/
+ public native function toString():String;
+
+ /**
+ * The prefix of the namespace.
+ *
+ * @tiptext The prefix of the namespace.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.prefix, prefix
+ **/
+ public native function get prefix():String;
+ public native function set prefix(value:String):void;
+
+ /**
+ * The Uniform Resource Identifier (URI) of the namespace.
+ *
+ * @tiptext The Uniform Resource Identifier (URI) of the namespace.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Namespace, Namespace.uri, uri
+ **/
+ public native function get uri():String;
+ public native function set uri(value:String):void;
+
+}
+
+}
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// Number object
+//****************************************************************************
+
+
+/**
+ * A data type representing an IEEE-754 double-precision floating-point number. You can manipulate primitive numeric
+ * values by using the methods and properties associated with the Number class. This class is identical to the
+ * JavaScript Number class.
+ *
The properties of the Number class are static, which means you do not need an object to use them, so you
+ * do not need to use the constructor.
+ *
The Number data type adheres to the double-precision IEEE-754 standard.
+ *
The Number data type is useful when you need to use floating-point values.
+ * Flash Player handles int and uint more efficiently than Number, but Number is
+ * useful in situations where the range of values required exceeds the valid range
+ * of the int and uint data types. The Number class can be used to
+ * represent integer values well beyond the valid range of the int and uint data types.
+ * The Number data type can use up to 53 bits to represent integer values, compared to
+ * the 32 bits available to int and uint. The default value of a variable typed as Number is NaN (Not a Number).
+ *
+ * @includeExample examples\NumberExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The Number class is a simple wrapper object for the Number
+ * data type.
+ *
+ * @see int.html int
+ * @see uint.html uint
+ * @helpid
+ * @refpath
+ * @keyword number object, number, built-in class
+ */
+public final class Number
+{
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Number() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Number()
+ */
+ public static const length:int = 1;
+
+ /**
+ * The largest representable number (double-precision IEEE-754). This number is
+ * approximately 1.79e+308.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The largest representable number (double-precision IEEE-754).
+ *
+ * @oldexample The following ActionScript displayswrites the largest and smallest representable numbers to the Output panelto the log file.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.max_value, max_value, max value
+ */
+ public static const MAX_VALUE:Number;
+
+ /**
+ * The smallest representable non-negative, non-zero, number (double-precision IEEE-754). This number is
+ * approximately 5e-324. The smallest representable number overall is actually -Number.MAX_VALUE.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The smallest representable number (double-precision IEEE-754).
+ *
+ * @oldexample The following ActionScript displayswrites the largest and smallest representable numbers to the Output panel to the log file.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:Number;
+
+ /**
+ * The IEEE-754 value representing Not a Number (NaN).
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext The IEEE-754 value representing Not a Number (NaN).
+ *
+ * @see package.html#isNaN() isNaN()
+ * @helpid
+ * @refpath
+ * @keyword number, number.nan, nan, not a number
+ */
+ public static const NaN:Number;
+
+ /**
+ * Specifies the IEEE-754 value representing negative infinity. The value of this property
+ * is the same as that of the constant -Infinity.
+ *
+ * Negative infinity is a special numeric value that is returned when a mathematical
+ * operation or function returns a negative value larger than can be
+ * represented.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the IEEE-754 value representing negative infinity.
+ *
+ * @oldexample This example compares the result of dividing the following values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.negative_infinity, negative_infinity, negative infinity, infinity
+ */
+ public static const NEGATIVE_INFINITY:Number;
+
+ /**
+ * Specifies the IEEE-754 value representing positive infinity. The value of this property
+ * is the same as that of the constant Infinity.
+ *
+ * Positive infinity is a special numeric value that is returned when a mathematical
+ * operation or function returns a value larger than can be represented.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Specifies the IEEE-754 value representing positive infinity.
+ *
+ * @oldexample This example compares the result of dividing the following values.
+ *
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.positive_infinity, positive_infinity, positive infinity, infinity
+ */
+ public static const POSITIVE_INFINITY:Number;
+
+ /**
+ * Creates a Number with the specified value. This constructor has the same effect
+ * as the Number() public native function that converts an object of a different type
+ * to a primitive numeric value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Creates a Number with the specified value.
+ *
+ * @param num The numeric value of the Number instance being created or a value
+ * to be converted to a Number. The default value is 0 if num is
+ * not specified. Using the constructor without specifying a num parameter is not
+ * the same as declaring a variable of type Number with no value assigned (such as var myNumber:Number), which
+ * defaults to NaN. A number with no value assigned is undefined and the equivalent of new Number(undefined).
+ *
+ * @oldexample The following code constructs new Number objects:
+ *
+ * var n1:Number = new Number(3.4);
+ * var n2:Number = new Number(-10);
+ *
+ *
+ *
+ * @see #toString() Number.toString()
+ * @see #valueOf() Number.valueOf()
+ * @helpid
+ * @refpath
+ * @keyword new number, constructor
+ */
+ public native function Number(num:Object);
+
+
+/**
+ */
+private static native function _convert(n:Number, precision:int, mode:int):String
+
+
+/**
+ * Returns the string representation of the specified Number object (myNumber).
+ * If the value of the Number object is a decimal number without a leading zero (such as .4),
+ * Number.toString() adds a leading zero (0.4).
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the string representation of this Number using the specified
+ * radix parameter as the numeric base.
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the number-to-string
+ * conversion. If you do not specify the radix parameter, the default value
+ * is 10.
+ *
+ * @return The numeric representation of this Number as a string.
+ *
+ * @oldexample The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9:
+ *
+ * The following example results in a hexadecimal value.
+ *
+ * var r:Number = new Number(250);
+ * var g:Number = new Number(128);
+ * var b:Number = new Number(114);
+ * var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
+ * trace(rgb);
+ * // output: rgb:0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.tostring, tostring
+ */
+ public native function toString(radix:Number = 10):String;
+
+/**
+ * Returns the primitive value type of the specified Number object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @tiptext Returns the primitive value type of the specified Number object.
+ *
+ * @return The primitive type value of this Number.
+ *
+ * @oldexample The following example results in the primative value of the numSocks object.
+ *
+ * var numSocks = new Number(2);
+ * trace(numSocks.valueOf()); // output: 2
+ *
+ *
+ * @helpid
+ * @refpath
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():Number;
+
+ /**
+ * Returns a string representation of the number in fixed-point notation.
+ * Fixed-point notation means that the string will contain a specific number of digits
+ * after the decimal point, as specified in the fractionDigits parameter.
+ * The valid range for the fractionDigits parameter is from 0 to 20.
+ * Specifying a value outside this range throws an exception.
+ *
+ * @param fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places.
+ * @throws RangeError Throws an exception if the fractionDigits argument is outside the range 0 to 20.
+ * @includeExample examples\Number.toFixed.1.as -noswf
+ * @includeExample examples\Number.toFixed.2.as -noswf
+ */
+ public native function toFixed(fractionDigits:uint):String;
+
+ /**
+ * Returns a string representation of the number in exponential notation. The string contains
+ * one digit before the decimal point and up to 20 digits after the decimal point, as
+ * specified by the fractionDigits parameter.
+ * @param fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places.
+ * @throws RangeError Throws an exception if the fractionDigits argument is outside the range 0 to 20.
+ * @includeExample examples\Number.toExponential.1.as -noswf
+ */
+ public native function toExponential(fractionDigits:uint):String;
+
+ /**
+ * Returns a string representation of the number either in exponential notation or in
+ * fixed-point notation. The string will contain the number of digits specified in the
+ * precision parameter.
+ * @param precision An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string.
+ * @throws RangeError Throws an exception if the precision argument is outside the range 1 to 21.
+ * @includeExample examples\Number.toPrecision.1.as -noswf
+ * @includeExample examples\Number.toPrecision.2.as -noswf
+ */
+ public native function toPrecision(precision:uint):String;
+}
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// Object object
+//****************************************************************************
+
+
+/**
+ * The Object class is at the root of the ActionScript class hierarchy. Objects are created by constructors using the
+ * new operator syntax, and can have properties assigned to them dynamically. Objects can also be created by
+ * assigning an object literal, as in:
+ * var obj:Object = {a:"foo", b:"bar"}
+ *
+ *
All classes that don't declare an explicit base class extend the built-in Object class.
+ *
You can use the Object class to create associative arrays. At its core, an associative array is an instance of the Object class, and each key-value pair is represented by a property and its value. Another reason to declare an associative array using the Object data type is that you can then use an object literal to populate your associative array (but only at the time you declare it). The following example creates an associative array using an object literal, accesses items using both the dot operator and the array access operator, and then adds a new key-value pair by creating a new property:
ActionScript 3.0 has two types of inheritance: "class inheritance" and "prototype inheritance":
+ *
Class inheritance - the primary inheritance mechanism, supports inheritance of fixed properties. A fixed property is a variable, constant or method declared as part of a class definition. Every class definition is now represented by a special class object that stores information about the class.
+ *
Prototype inheritance - the only inheritance mechanism in previous versions of ActionScript, serves as an alternate form of inheritance in ActionScript 3.0. Each class has an associated prototype object, and the properties of the prototype object are shared by all instances of the class. When a class instance is created, the new instance has a reference to its class's prototype object that serves as a link between an instance and its class's prototype object. At runtime, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate on up the hierarchy until Flash Player finds the property.
+ *
Both class inheritance and prototype inheritance can exist simultaneously, such as:
+ *
+ * class A {
+ * var x = 1
+ * prototype.px = 2
+ * }
+ * dynamic class B extends A {
+ * var y = 3
+ * prototype.py = 4
+ * }
+ *
+ * var b = new B()
+ * b.x // 1 via class inheritance
+ * b.px // 2 via prototype inheritance from A.prototype
+ * b.y // 3
+ * b.py // 4 via prototype inheritance from B.prototype
+ *
+ * B.prototype.px = 5
+ * b.px // now 5 because B.prototype hides A.prototype
+ *
+ * b.px = 6
+ * b.px // now 6 because b hides B.prototype
+ *
+ *
Using functions instead of classes, you can construct custom prototype inheritance trees. With classes, the prototype inheritance tree mirrors the class inheritance tree. However, since the prototype objects are dynamic, you can add and delete prototype-based properties at runtime.
+ *
+ * @playerversion Flash 9
+ *
+ * @includeExample examples\ObjectExample.as -noswf
+ *
+ * @helpid x20982
+ * @refpath Objects/Core/Object
+ * @keyword object, object object, built-in class
+ *
+ * @see #prototype
+ */
+public dynamic class Object
+{
+ /**
+ * A reference to the prototype object of a class or function object. The prototype property
+ * is automatically created and attached to any class or function object that you create. This property is
+ * static in that it is specific to the class or function that you create. For example, if you create a
+ * class, the value of the prototype property is shared by all instances of the class and is
+ * accessible only as a class property. Instances of your class cannot directly access
+ * the prototype property.
+ *
A class's prototype object is a special instance of that class that provides a mechanism for sharing state across all instances of a class. At runtime, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate on up the hierarchy until Flash Player finds the property.
+ *
Note: In ActionScript 3.0, prototype inheritance is not the primary mechanism for inheritance. Class inheritance, which drives the inheritance of fixed properties in class definitions, is the primary inheritance mechanism. For more information on class inheritance. Need XREF to Prog AS3
+ *
+ * @maelexample The following example creates a class named Shape and a subclass of Shape named Circle.
+ *
+ * // Shape class defined in external file named Shape.as
+ * class Shape {
+ * function Shape() {}
+ * }
+ *
+ * // Circle class defined in external file named Circle.as
+ * class Circle extends Shape{
+ * function Circle() {}
+ * }
+ *
+ * The Circle class can be used to create two instances of Circle:
+ *
+ * var oneCircle:Circle = new Circle();
+ * var twoCircle:Circle = new Circle();
+ *
+ * The following trace statement shows that the prototype property of the Circle class points to its superclass Shape. The identifier Shape refers to the constructor function of the Shape class.
+ *
+ * trace(Circle.prototype.constructor == Shape); // Output: true
+ *
+ * The following trace statement shows how you can use the prototype property and the __proto__ property together to move two levels up the inheritance hierarchy (or prototype chain). The Circle.prototype.__proto__ property contains a reference to the superclass of the Shape class.
+ *
+ * trace(Circle.prototype.__proto__ == Shape.prototype); // Output: true
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public static var prototype:Object;
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the Object() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #Object()
+ */
+ public static const length:int = 1;
+
+ /**
+ * A reference to the class object or constructor function for a given object instance.
+ * If an object is an instance of a class, the constructor
+ * property holds a reference to the class object.
+ * If an object is created with a constructor function, the constructor
+ * property holds a reference to the constructor function.
+ * Do not confuse a constructor function with a constructor method of a class.
+ * A constructor function is a Function object used to create objects, and is an
+ * alternative to using the class keyword for defining classes.
+ *
+ *
If you use the class keyword to define a class, the class's prototype object
+ * is assigned a property named constructor that holds a reference to the class object.
+ * An instance of the class inherits this property from the prototype object. For example,
+ * the following code creates a new class, A, and a class instance named myA:
+ *
+ * dynamic class A {}
+ * trace(A.prototype.constructor); // [class A]
+ * trace(A.prototype.constructor == A); // true
+ * var myA:A = new A();
+ * trace(myA.constructor == A); // true
+ *
+ *
Advanced users may choose to use the function keyword instead of the class
+ * keyword to define a Function object that can be used as a template for the creation of objects. Such a
+ * function is called a constructor function because you can use it in conjunction with the new
+ * operator to create new objects.
+ * If you use the function keyword to create a constructor function, its prototype object is assigned
+ * a property named constructor that holds a reference to the constructor function.
+ * If you then use the constructor function to create an new object, the object inherits the
+ * constructor property from the constructor function's prototype object. For example,
+ * the following code creates a new constructor function, f, and an object named myF:
+ *
+ * function f() {}
+ * trace(f.prototype.constructor); // function Function() {}
+ * trace(f.prototype.constructor == f); // true
+ * var myF = new f();
+ * trace(myF.constructor == f); // true
+ *
+ *
Note: The constructor property is writable, which means that user code can change
+ * its value with an assignment statement. Changing the value of the constructor property is not
+ * recommended, but if you write code that depends on the value of the constructor property, you should
+ * ensure that the value is not reset. The value can be changed only when the property is accessed through the prototype
+ * object (for example, className.prototype.constructor).
+ * @playerversion Flash 9
+ *
+ * @see Class
+ * @see Function
+ * @see #prototype
+ * @helpid
+ * @refpath
+ * @keyword Object, Object.constructor, constructor
+ */
+ var constructor:Object;
+
+
+ /**
+ * Creates an Object object and stores a reference to the object's constructor method in the object's constructor property.
+ *
+ * @version Flash Player 8.0
+ *
+ */
+ public native function Object();
+
+
+ /**
+ * Indicates whether an object has a specified property defined. This method returns true if the target object has
+ * a property that matches the string specified by the name parameter, and false otherwise.
+ * The following types of properties cause this method to return true for objects that are instances of a class (as opposed to class objects):
+ *
+ *
fixed instance properties—variables, constants, or methods defined by the object's class that are not static;
+ *
inherited fixed instance properties—variables, constants, or methods inherited by the object's class;
+ *
dynamic properties—properties added to an object after it is instantiated (outside of its class definition). To add dynamic properties, the object's defining class must be declared with the dynamic keyword.
+ *
+ *
The following types of properties cause this method to return false for objects that are instances of a class:
+ *
+ *
static properties—variables, constants, or methods defined with the static keyword in an object's defining class or any of its superclasses;
+ *
prototype properties—properties defined on a prototype object that is part of the object's prototype chain. In ActionScript 3.0, the prototype chain is not used for class inheritance, but still exists as an alternative form of inheritance. For example, an instance of the Array class can access the valueOf() method because it exists on Object.prototype, which is part of the prototype chain for the Array class. Although you can use valueOf() on an instance of Array, the return value of hasOwnProperty("valueOf") for that instance is false.
+ *
+ *
+ *
ActionScript 3.0 also has class objects, which are concrete representations of class definitions.
+ * When called on class objects, hasOwnProperty() returns true only if a property
+ * is a static property defined on that class object. For example, if you create a subclass of Array named
+ * CustomArray, and define a static property in CustomArray named foo, a call to
+ * CustomArray.hasOwnProperty("foo") returns true.
+ * For the static property DESCENDING defined in the Array class, however, a call to
+ * CustomArray.hasOwnProperty("DESCENDING") returns false.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function hasOwnProperty():Boolean instead of using an override of the base class.
+ *
+ * @param name The property of the object.
+ * @return If the target object has the property specified by the name
+ * parameter this value is true, otherwise false.
+ *
+ * @category Method
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function hasOwnProperty(name:String):Boolean;
+
+ /**
+ * Indicates whether the specified property exists and is enumerable. If true, then the property exists and
+ * can be enumerated in a for..in loop. The property must exist on the target object because this method does not
+ * check the target object's prototype chain.
+ *
+ *
Properties that you create are enumerable, but built-in properties are generally not enumerable.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function propertyIsEnumerable():Boolean instead of using an override of the base class.
+ *
+ * @param name The property of the object.
+ * @return If the property specified by the name parameter is enumerable this value is true, otherwise false.
+ *
+ * @maelexample The following example creates a generic object, adds a property to the object, then checks whether the object is enumerable. By way of contrast, the example also shows that a built-in property, the Array.length property, is not enumerable.
+ *
+ * var myObj:Object = new Object();
+ * myObj.prop1 = "hello";
+ * trace(myObj.propertyIsEnumerable("prop1")); // Output: true
+ *
+ * var myArray = new Array();
+ * trace(myArray.propertyIsEnumerable("length")); // Output: false
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function propertyIsEnumerable(name:String):Boolean;
+
+ /**
+ * Indicates whether an instance of the Object class is in the prototype chain of the object specified
+ * as the parameter. This method returns true if the object is in the prototype chain of the
+ * object specified by the theClass parameter. The method returns false
+ * if the target object is absent from the prototype chain of the theClass object,
+ * and also if the theClass parameter is not an object.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function isPrototypeOf():Boolean instead of using an override of the base class.
+ *
+ * @param theClass The class to which the specified object may refer.
+ *
+ * @return If the object is in the prototype chain of the object
+ * specified by the theClass parameter this value is true, otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function isPrototypeOf(theClass:Object):Boolean;
+
+ /**
+ * Sets the availability of a dynamic property for loop operations. The property must exist on the target object because this method does not check the target object's prototype chain.
+ * @param name The property of the object.
+ * @param isEnum If set to false, the dynamic property will not show up in for..in loops, and the method propertyIsEnumerable() will return false.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #propertyIsEnumerable()
+ */
+ public native function setPropertyIsEnumerable(name:String, isEnum:Boolean=true):void;
+
+ /**
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ */
+ public native function toLocaleString():String;
+
+ /**
+ * Returns the string representation of the specified object.
+ *
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function toString():String instead of using an override of the base class.
+ *
+ * @playerversion Flash 9
+ *
+ * @return A string representation of the object.
+ *
+ * @oldexample This example shows the return value for toString() on a generic object:
+ *
+ * var myObject:Object = new Object();
+ * trace(myObject.toString()); // output: [object Object]
+ *
+ *
This method can be overridden to return a more meaningful value. The following examples show that this method has been overridden for the built-in classes Date, Array, and Number:
+ *
+ * // Date.toString() returns the current date and time
+ * var myDate:Date = new Date();
+ * trace(myDate.toString()); // output: [current date and time]
+ *
+ * // Array.toString() returns the array contents as a comma-delimited string
+ * var myArray:Array = new Array("one", "two");
+ * trace(myArray.toString()); // output: one,two
+ *
+ * // Number.toString() returns the number value as a string
+ * // Because trace() won't tell us whether the value is a string or number
+ * // we will also use typeof() to test whether toString() works.
+ * var myNumber:Number = 5;
+ * trace(typeof (myNumber)); // output: number
+ * trace(myNumber.toString()); // output: 5
+ * trace(typeof (myNumber.toString())); // output: string
+ *
+ *
The following example shows how to override toString() in a class. First create a text file named Vehicle.as that contains only the Vehicle class definition and place it into your Classes folder inside your Configuration folder.
+ *
+ * // contents of Vehicle.as
+ * class Vehicle {
+ * var numDoors:Number;
+ * var color:String;
+ * function Vehicle(param_numDoors:Number, param_color:String) {
+ * this.numDoors = param_numDoors;
+ * this.color = param_color;
+ * }
+ * function toString():String {
+ * var doors:String = "door";
+ * if (this.numDoors > 1) {
+ * doors += "s";
+ * }
+ * return ("A vehicle that is " + this.color + " and has " + this.numDoors + " " + doors);
+ * }
+ * }
+ *
+ * // code to place into a FLA file
+ * var myVehicle:Vehicle = new Vehicle(2, "red");
+ * trace(myVehicle.toString());
+ * // output: A vehicle that is red and has 2 doors
+ *
+ * // for comparison purposes, this is a call to valueOf()
+ * // there is no primitive value of myVehicle, so the object is returned
+ * // giving the same output as toString().
+ * trace(myVehicle.valueOf());
+ * // output: A vehicle that is red and has 2 doors
+ *
+ *
+ *
+ * @helpid x20983
+ * @refpath Objects/Core/Object/Methods/toString
+ * @keyword object, object.tostring, tostring
+ */
+ public native function toString():String;
+
+ /**
+ * Returns the primitive value of the specified object. If this object
+ * does not have a primitive value, the object itself is returned.
+ *
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function valueOf():Object instead of using an override of the base class.
+ *
+ * @playerversion Flash 9
+ *
+ * @return The primitive value of this object or the object itself.
+ *
+ * @oldexample The following example shows the return value of valueOf() for a generic object (which does not have a primitive value) and compares it to the return value of toString():
+ *
+ * // Create a generic object
+ * var myObject:Object = new Object();
+ * trace(myObject.valueOf()); // output: [object Object]
+ * trace(myObject.toString()); // output: [object Object]
+ *
+ *
The following examples show the return values for the built-in classes Date and Array, and compares them to the return values of Object.toString():
+ *
+ * // Create a new Date object set to February 1, 2004, 8:15 AM
+ * // The toString() method returns the current time in human-readable form
+ * // The valueOf() method returns the primitive value in milliseconds
+ * var myDate:Date = new Date(2004,01,01,8,15);
+ * trace(myDate.toString()); // output: Sun Feb 1 08:15:00 GMT-0800 2004
+ * trace(myDate.valueOf()); // output: 1075652100000
+ *
+ * // Create a new Array object containing two simple elements
+ * // In this case both toString() and valueOf() return the same value: one,two
+ * var myArray:Array = new Array("one", "two");
+ * trace(myArray.toString()); // output: one,two
+ * trace(myArray.valueOf()); // output: one,two
+ *
+ *
+ *
See the example for Object.toString() for an example of the return value
+ * of Object.valueOf() for a class that overrides toString().
+ *
+ * @see Object#toString()
+ *
+ * @helpid x20984
+ * @refpath Objects/Core/Object/Methods/valueOf
+ * @keyword object, object.valueof, valueof
+ */
+ public native function valueOf():Object;
+}
+
+}
+package {
+//
+// QName
+//
+
+// Based on the ECMA E4X spec, 1st Edition
+
+/**
+*
+* QName objects represent qualified names of XML elements and attributes. Each
+* QName object has a local name and a namespace Uniform Resource Identifier (URI).
+* When the value of the namespace URI is null, the QName object matches any namespace.
+* Use the QName constructor to create a new QName object that is either a copy of another QName
+* object or a new QName object with a uri from a Namespace object and a
+* localName from a QName object.
+*
+*
+*
Methods specific to E4X can use QName objects interchangeably with strings.
+* E4X methods are in the QName, Namespace, XML, and XMLList classes.
+* These E4X methods, which take a string, can also take a QName object.
+* This interchangeability is how namespace support works with, for example,
+* the XML.child() method.
+*
+*
The QName class (along with the XML, XMLList, and Namespace classes) implements
+* powerful XML-handling standards defined in ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2).
+*
+*
A qualified identifier evaluates to a QName object. If the QName object of an XML element is
+* specified without identifying a namespace, the uri
+* property of the associated QName object is set to the global default namespace. If the QName object of an XML
+* attribute is specified without identifying a namespace, the uri property is set to
+* an empty string.
+*
+* @includeExample examples\QNameExample.as -noswf
+*
+* @see XML
+* @see XMLList
+* @see Namespace
+* @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+* (E4X) specification (ECMA-357 edition 2)
+*
+* @playerversion Flash 9
+* @langversion 3.0
+* @helpid
+* @refpath
+* @keyword QName
+*/
+public final class QName
+{
+
+ /**
+ * Creates a QName object with a uri from a Namespace object and a localName from a QName object.
+ * If either parameter is not the expected data type, the parameter is converted to a string and
+ * assigned to the corresponding property of the new QName object.
+ * For example, if both parameters are strings, a new QName object is returned with a uri property set
+ * to the first parameter and a localName property set to the second parameter.
+ * In other words, the following permutations, along with many others, are valid forms of the constructor:
+
If the parameter passed as the uri parameter is the null value,
+ * the uri property of the new QName property is set to the null value.
+ *
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ * @param uri A Namespace object from which to copy the uri value. A parameter of any other type is converted to a string.
+ * @param localName A QName object from which to copy the localName value. A parameter of any other type is converted to a string.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName
+ **/
+ public native function QName(uri:Namespace, localName:String);
+
+ // Note [M.Shepherd 10/30/06] - this file "global.as" is created by a perl script that runs on the original files
+ // found in flashfarm perforce at //depot/main/player/FlashPlayer/avmglue/ASDocs/AS3/system_classes/*
+ // According to Dave Jacowitz
+ // "The 'system_classes' are duplicate ASDoc-only files that are not actually used
+ // in the Flash Player builds. They are for doc purposes only. The real Flash Player equivalents are in
+ // //depot/main/player/FlashPlayer/avmplus/core. The system_classes files are owned by the doc team,
+ // and we make an effort to keep them in relative sync with the real 'core' files.
+ // So I guess that from time to time, the FlexBuilder team needs to run the perl script, (which can be
+ // found somewhere in zorn.codemodel) and check in a new copy of global.as.
+ //
+ // Anyway, system_classes/QName.as contains several versions of the constructor, because this is
+ // what they want for the ASDocs. Flexbuilder, however, only recognizes one constructor, because
+ // that is all that is legal in ActionScript 3. So I've edited this file (global.as) to make the
+ // first constructor in this class be the one that we want to code hint.
+ //
+ // If you ever update global.as with a new version, make sure you preserve this change.
+
+ public native function QName(uri:Namespace, localName:QName);
+
+ /**
+ * Creates a QName object that is a copy of another QName object. If the parameter passed
+ * to the constructor is a QName object, a copy of the QName object is created. If the parameter
+ * is not a QName object, the parameter is converted to a string and assigned to the
+ * localName property of the new QName instance.
+ * If the parameter is undefined or unspecified, a new QName object
+ * is created with the localName property set to the empty string.
+ *
Note: This class shows two constructor method entries because the constructor accepts
+ * variable types of arguments. The constructor behaves differently depending on the type and number of
+ * arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading.
+ *
+ *
+ * @param qname The QName object to be copied. Objects of any other type are
+ * converted to a string that is assigned to the localName property
+ * of the new QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ **/
+ public native function QName(qname:QName);
+
+
+ /**
+ * Returns a string composed of the URI, and the local name for the
+ * QName object, separated by "::".
+ *
+ *
The format depends on the uri property of the QName object:
+ * If uri == ""
+ * toString returns localName
+ * else if uri == null
+ * toString returns ~~::localName
+ * else
+ * toString returns uri::localName
+ *
+ *
+ * @return The qualified name, as a string.
+ *
+ * @oldexample
+ *
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.toString, toString
+ **/
+ public native function toString():String;
+
+ /**
+ * The local name of the QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.localName, localName
+ **/
+ public native function get localName():String;
+
+ /**
+ * The Uniform Resource Identifier (URI) of the QName object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword QName, QName.uri, uri
+ **/
+ public native function get uri():String;
+
+}
+}
+package {
+
+/**
+ * A RangeError exception is thrown when a numeric value is outside the acceptable range. When working with Arrays,
+ * referring to an index position of an array item that does not exist will throw a RangeError exception. Number.toExponential(),
+ * Number.toPrecision(), and Number.toFixed() will throw a RangeError exception in cases
+ * where the arguments are outside the acceptable range of numbers. You can extend Number.toExponential(),
+ * Number.toPrecision(), and Number.toFixed() to avoid throwing a RangeError.
+ * In addition, this exception
+ * will be thrown when:
+ *
+ *
Any Flash Player API that expects a depth number is invoked with an invalid depth
+ * number.
+ *
Any Flash Player API that expects a frame number is invoked with an invalid frame
+ * number.
+ *
Any Flash Player API that expects a layer number is invoked with an invalid layer
+ * number.
+ *
+ *
+ * @includeExample examples\RangeErrorExample.as -noswf
+ *
+ * @see Number#toExponential()
+ * @see Number#toPrecision()
+ * @see Number#toFixed()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, RangeError
+ */
+public dynamic class RangeError extends Error
+{
+ /**
+ * Creates a new RangeError object.
+ * @param message Contains the message associated with the RangeError object.
+ */
+ public native function RangeError(message:String = "");
+}
+
+
+}
+package {
+
+/**
+ * A ReferenceError exception is thrown when a reference to an undefined property is
+ * attempted on a sealed (nondynamic) object. References to undefined variables will
+ * result in ReferenceError exceptions to inform you of potential bugs and help you troubleshoot
+ * application code.
+ *
However, you can refer to undefined properties of a dynamic class without having a ReferenceError thrown. For more information, see the dynamic keyword.
+ *
+ * @includeExample examples\ReferenceErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, ReferenceError
+ * @see statements.html#dynamic dynamic keyword
+ */
+public dynamic class ReferenceError extends Error
+{
+ /**
+ * Creates a new ReferenceError object.
+ * @param message Contains the message associated with the ReferenceError object.
+ */
+ public native function ReferenceError(message:String = "");
+
+}
+
+
+}
+package {
+// RegExp class
+
+/**
+ *
+ * The RegExp class lets you work with regular expressions, which are patterns that you can use
+ * to perform searches in strings and to replace text in strings.
+ *
+ *
You can create a new RegExp object by using the new RegExp() constructor or by
+ * assigning a RegExp literal to a variable:
+ *
+ * var pattern1:RegExp = new RegExp("test-\d", "i");
+ * var pattern2:RegExp = /test-\d/i;
+ *
+ *
+ *
For more information, see "Using Regular Expressions" in Programming
+ * ActionScript 3.0.
+ *
+ * @includeExample examples\RegExpExample.as -noswf
+ *
+ * @see String#match()
+ * @see String#replace()
+ * @see String#search()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ **/
+public dynamic class RegExp {
+
+ /**
+ * Lets you construct a regular expression from two strings. One string defines the pattern of the
+ * regular expression, and the other defines the flags used in the regular expression.
+ *
+ * @param re The pattern of the regular expression (also known as the constructor string). This is the
+ * main part of the regular expression (the part that goes within the "/" characters).
+ *
+ *
Note: Do not include the starting and trailing "/" characters; use these only when defining a regular expression
+ * literal without using the constructor.
+ *
+ * @param flags The modifiers of the regular expression. These can include the following:
+ *
+ *
+ *
+ *
g When using the replace() method of the String class,
+ * specify this modifier to replace all matches, rather than only the first one.
+ * This modifier corresponds to the global property of the RegExp instance.
+ *
i The regular expression is evaluated without case
+ * sensitivity. This modifier corresponds to the ignoreCase property of the RegExp instance.
+ *
s The dot (.) character matches new-line characters. Note
+ * This modifier corresponds to the dotall property of the RegExp instance.
+ *
m The caret (^) character and dollar sign ($) match
+ * before and after new-line characters. This modifier corresponds to the
+ * multiline property of the RegExp instance.
+ *
x White space characters in the re string are ignored,
+ * so that you can write more readable constructors. This modifier corresponds to the
+ * extended property of the RegExp instance.
+ *
+ *
+ *
+ *
All other characters in the flags string are ignored.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.attribute, attribute
+ **/
+ public native function RegExp (re:String, flags:String);
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the RegExp() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #RegExp()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Performs a search for the regular expression on the given string str.
+ *
+ *
If the g (global) flag is not set for the regular
+ * expression, then the search starts
+ * at the beginning of the string (at index position 0); the search ignores
+ * the lastIndex property of the regular expression.
+ *
+ *
If the g (global) flag is set for the regular
+ * expression, then the search starts
+ * at the index position specified by the lastIndex property of the regular expression.
+ * If the search matches a substring, the lastIndex property changes to match the position
+ * of the end of the match.
+ *
+ * @param str The string to search.
+ *
+ * @return If there is no match, null; otherwise, an object with the following properties:
+ *
+ *
+ *
+ *
An array, in which element 0 contains the complete matching substring, and
+ * other elements of the array (1 through n) contain substrings that match parenthetical groups
+ * in the regular expression
+ *
+ *
index The character position of the matched substring within
+ * the string
+ *
+ *
input The string (str)
+ *
+ *
+ *
+ *
+ * @example When the g (global) flag is not set in the regular expression, then you can
+ * use exec() to find the first match in the string:
+ *
+ *
+ * var myPattern:RegExp = /(\w~~)sh(\w~~)/ig;
+ * var str:String = "She sells seashells by the seashore";
+ * var result:Object = myPattern.exec(str);
+ * trace(result);
+ *
+ *
+ *
The result object is set to the following:
+ *
+ *
+ *
+ *
result[0] is set to "She" (the complete
+ * match).
+ *
+ *
result[1] is set to an empty string (the first matching
+ * parenthetical group).
+ *
+ *
result[2] is set to "e" (the second matching
+ * parenthetical group).
+ *
+ *
result.index is set to 0.
+ *
+ *
result.input is set to the input string: "She sells seashells
+ * by the seashore".
+ *
+ *
+ *
+ *
+ *
+ *
In the following example, the g (global) flag is set in the regular
+ * expression, so you can use exec() repeatedly to find multiple matches:
+ *
+ *
+ * var myPattern:RegExp = /(\w~~)sh(\w~~)/ig;
+ * var str:String = "She sells seashells by the seashore";
+ * var result:Object = myPattern.exec(str);
+ *
+ * while (result != null) {
+ * trace ( result.index, "\t", result);
+ * result = myPattern.exec(str);
+ * }
+ *
+ *
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.exec, exec
+ * @see String#match()
+ * @see String#search()
+ */
+ public native function exec (str:String):Object;
+
+ /**
+ * Tests for the match of the regular expression in the given string str.
+ *
+ *
If the g (global) flag is not set for the regular expression,
+ * then the search starts at the beginning of the string (at index position 0); the search ignores
+ * the lastIndex property of the regular expression.
+ *
+ *
If the g (global) flag is set for the regular expression, then the search starts
+ * at the index position specified by the lastIndex property of the regular expression.
+ * If the search matches a substring, the lastIndex property changes to match the
+ * position of the end of the match.
+ *
+ * @param str The string to test.
+ *
+ * @return If there is a match, true; otherwise, false.
+ *
+ * @includeExample examples\RegExp.test.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.test, test
+ */
+ public native function test(str:String):Boolean;
+
+ /**
+ * Specifies whether the dot character (.) in a regular expression pattern matches
+ * new-line characters. Use the s flag when constructing
+ * a regular expression to set dotall = true.
+ *
+ * @includeExample examples\RegExp.dotall.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp, RegExp.dotall, dotall
+ */
+ public native function get dotall():Boolean;
+
+ /**
+ * Specifies whether to use extended mode for the regular expression.
+ * When a RegExp object is in extended mode, white space characters in the constructor
+ * string are ignored. This is done to allow more readable constructors.
+ *
+ *
Use the x flag when constructing a regular expression to set
+ * extended = true.
+ *
+ * @includeExample examples\RegExp.extended.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.extended, extended
+ */
+ public native function get extended():Boolean;
+
+ /**
+ * Specifies whether to use global matching for the regular expression. When
+ * global == true, the lastIndex property is set after a match is
+ * found. The next time a match is requested, the regular expression engine starts from
+ * the lastIndex position in the string. Use the g flag when
+ * constructing a regular expression to set global to true.
+ *
+ * @includeExample examples\RegExp.global.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.global, global
+ */
+ public native function get global():Boolean;
+
+ /**
+ * Specifies whether the regular expression ignores case sensitivity. Use the
+ * i flag when constructing a regular expression to set
+ * ignoreCase = true.
+ *
+ * @includeExample examples\RegExp.ignoreCase.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.ignoreCase, ignoreCase
+ **/
+ public native function get ignoreCase():Boolean;
+
+ /**
+ * Specifies the index position in the string at which to start the next search. This property
+ * affects the exec() and test() methods of the RegExp class.
+ * However, the match(), replace(), and search() methods
+ * of the String class ignore the lastIndex property and start all searches from
+ * the beginning of the string.
+ *
+ *
When the exec() or test() method finds a match and the g
+ * (global) flag is set to true for the regular expression, the method
+ * automatically sets the lastIndex property to the index position of the character
+ * after the last character in the matching substring of the last match. If the
+ * g (global) flag is set to false, the method does not
+ * set the lastIndexproperty.
+ *
+ *
You can set the lastIndex property to adjust the starting position
+ * in the string for regular expression matching.
+ *
+ * @includeExample examples\RegExp.lastIndex.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.lastIndex, lastIndex
+ */
+ public native function get lastIndex():Number;
+ public native function set lastIndex(value:Number):void;
+
+ /**
+ * Specifies whether the m (multiline) flag is set. If it is set,
+ * the caret (^) and dollar sign ($) in a regular expression
+ * match before and after new lines.
+ * Use the m flag when constructing a regular expression to set
+ * multiline = true.
+ *
+ * @includeExample examples\RegExp.multiline.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.multiline, multiline
+ */
+ public native function get multiline():Boolean;
+
+ /**
+ * Specifies the pattern portion of the regular expression.
+ *
+ * @includeExample examples\RegExp.source.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword RegExp
+ * @keyword RegExp, RegExp.source, source
+ */
+ public native function get source():String;
+
+}
+}
+package flash.errors
+{
+ /**
+ * The ScriptTimeoutError exception is thrown when the script timeout interval is reached.
+ * The script timeout interval is 15 seconds. There are two XML attributes
+ * that you can add to the mx:Application tag: scriptTimeLimit
+ * (the number of seconds until script timeout) and scriptRecursionLimit
+ * (the depth of recursive calls permitted).
+ *
+ *
Two ScriptTimeoutError exceptions are thrown. The first exception you can catch and exit
+ * cleanly. If there is no exception handler, the uncaught exception terminates execution. The
+ * second exception is thrown but cannot be caught by user code; it goes to the uncaught
+ * exception handler. It is uncatchable to prevent Flash Player from hanging
+ * indefinitely.
+ *
+ * @includeExample examples\ScriptTimeoutErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class ScriptTimeoutError extends Error {
+ /**
+ * Creates a new ScriptTimeoutError object.
+ *
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function ScriptTimeoutError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+
+/**
+ * The SecurityError exception is thrown when some type of security violation
+ * takes place.
+ *
+ * Examples of security errors:
+ *
+ *
An unauthorized property access or method call is made across a security sandbox
+ * boundary.
+ *
An attempt was made to access a URL not permitted by the security sandbox.
+ *
A socket connection was attempted to an unauthorized port number, e.g. a port below
+ * 1024 without a policy file present.
+ *
An attempt was made to access the user's camera or microphone, and the request to
+ * access the device was denied by the user.
+ *
+ *
+ * @includeExample examples\SecurityErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, SecurityError
+ *
+ */
+public dynamic class SecurityError extends Error
+{
+ /**
+ * Creates a new SecurityError object.
+ */
+ public native function SecurityError(message:String = "");
+
+}
+
+
+}
+package flash.errors
+{
+ /**
+ * ActionScript throws a StackOverflowError exception when the stack available to the script
+ * is exhausted. ActionScript uses a stack to store information about each method call made in
+ * a script, such as the local variables that the method uses. The amount of stack space
+ * available varies from system to system.
+ *
+ *
A StackOverflowError exception might indicate that infinite recursion has occurred, in
+ * which case a termination case needs to be added to the function. It also might indicate
+ * that the recursive algorithm has a proper terminating condition but has exhausted the stack
+ * anyway. In this case, try to express the algorithm iteratively instead.
+ *
+ * @includeExample examples\StackOverflowErrorExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ */
+ public dynamic class StackOverflowError extends Error {
+ /**
+ * Creates a new StackOverflowError object.
+ * @param message A string associated with the error object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword
+ **/
+ function StackOverflowError(message:String = "") {
+ super(message);
+ }
+ }
+}
+package {
+/**
+ * A StackTraceElement provides programmatic access to the elements of the call stack.
+ * A string representation of StackTraceElement objects is returned by the Error.getStackTrace() method.
+ *
+ *
The StackTraceElement class is useful for writing custom exception handlers
+ * that need to display the call stack to the developer.
+ *
+ * @includeExample examples\StackTraceElementExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see Error#getStackTrace()
+ */
+
+public class StackTraceElement
+ {
+ /**
+ * The fully qualified name of the class containing the
+ * execution point represented by this stack trace
+ * element, or null if the execution point is not
+ * within a class.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var className:String;
+
+ /**
+ * The name of method or function containing the execution
+ * point represented by this stack trace element, or
+ * null if the execution point is not within a method.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var methodName:String;
+
+ /**
+ * The name of the ActionScript file containing the execution point
+ * represented by this stack trace element, or null if
+ * this information is not available.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var fileName:String;
+
+ /**
+ * Line number of the execution point in the source file
+ * specified by fileName, or null if this information
+ * is not available.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var lineNumber:Integer;
+
+ /**
+ * The nativeMethod property value is true if the execution point is within a native method and
+ * false otherwise.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public var nativeMethod:Boolean;
+
+ /**
+ * Returns the string representation of this stack
+ * trace element. Such as:
+ *
+ * MyClass.method(MyClass.as:100)
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ */
+ public native function toString():String;
+ }
+}
+package {
+
+//****************************************************************************
+// ActionScript Standard Library
+// String object
+//****************************************************************************
+
+
+/**
+ * The String class is a data type that represents a string of characters. The String class
+ * provides methods and properties that let you manipulate primitive string value types.
+ * You can convert the value of any object into a String data type object using the String()
+ * function.
+ *
+ * All the methods of the String class, except for concat(),
+ * fromCharCode(), slice(), and substr(), are
+ * generic, which means the methods call toString() before performing their
+ * operations, and you can use these methods with other non-String objects.
+ *
+ * Because all string indexes are zero-based, the index of the last character
+ * for any string x is x.length - 1.
+ *
+ * You can call any of the methods of the String class whether you use the constructor method
+ * new String() to create a new string variable or simply assign a string literal value.
+ * Unlike previous versions of ActionScript, it makes no difference whether you use the constructor,
+ * the global function, or simply assign a string literal value. The following lines of code are equivalent:
+ *
+ *
+ * var str:String = new String("foo");
+ * var str:String = "foo";
+ * var str:String = String("foo");
+ *
When setting a string variable to undefined, Flash Player coerces undefined
+ * to null. So, the statement:
+ *
+ * var s:String = undefined;
+ * sets the value to null instead of undefined. Use the String()
+ * function if you need to use undefined.
+ * @includeExample examples\StringExample.as -noswf
+ *
+ * @playerversion Flash 9
+ *
+ * @see package.html#String() String Function
+ * @refpath Objects/Core/String
+ * @keyword string, string object, built-in class
+ */
+public final class String
+{
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the String() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #String()
+ */
+ public static const length:int = 1;
+
+ /**
+ * An integer specifying the number of characters in the specified String object.
+ *
+ * Because all string indexes are zero-based, the index of the last character for any
+ * string x is x.length - 1.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @oldexample The following example creates a new String object and uses String.length to count the number of characters:
+ *
The following example loops from 0 to my_str.length.
+ *
+ * The code checks the characters
+ * within a string, and if the string contains the @ character, true displays in the Output panel.
+ *
+ * The code checks the characters within a string, and if the string contains the @ character,
+ * true writes to the log file.
+ *
+ * If it does not contain the @ character,
+ * false displays in the Output panel.
+
+ * If it does not contain the @ character,
+ * then false writes to the log file.
+ *
+ *
+ * @helpid x209C5
+ * @refpath Objects/Core/String/Properties/length
+ * @keyword string, string.length, length
+ */
+ public native function get length():int
+
+
+ /**
+ * Returns a string comprising the characters represented by the Unicode character codes
+ * in the parameters.
+ *
+ * @playerversion Flash 9
+ *
+ * @param ...charCodes A series of decimal integers that represent Unicode values.
+ *
+ * @return The string value of the specified Unicode character codes.
+ *
+ * @oldexample The following example uses fromCharCode() to insert an @ character in the e-mail address:
+ *
+ *
+ *
+ * @helpid x209BE
+ * @refpath Objects/Core/String/Methods/fromCharCode
+ * @keyword string, string.fromcharcode, fromcharcode, from character code
+ */
+ public native static function fromCharCode(...charCodes):String;
+
+ /**
+ * Creates a new String object initialized to the specified string.
+ *
+ *
+ * Note: Because string literals use less overhead than String
+ * objects and are generally easier to use, you should use string literals instead of the
+ * String class unless you have a good reason to use a String object rather than a string literal.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The initial value of the new String object.
+ *
+ * @return A reference to a String object.
+ *
+ *
+ * @helpid x209C8
+ * @refpath Objects/Core/String/new String
+ * @keyword string, new string, new, constructor
+ */
+ public native function String(val:String);
+
+
+ /**
+ * Returns the character in the position specified by the index parameter.
+ * If index is not a number from 0 to string.length - 1, an
+ * empty string is returned.
+ *
+ * This method is similar to String.charCodeAt() except that the returned
+ * value is a character, not a 16-bit integer character code.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param index An integer specifying the position of a character in the string. The first
+ * character is indicated by 0, and the last character is indicated by
+ * my_str.length - 1.
+ *
+ * @return The character at the specified index. Or an empty string if the
+ * specified index is outside the range of this string's indices.
+ *
+ * @oldexample In the following example, this method is called on the first letter of the string "Chris":
+ *
+ * var my_str:String = "Chris";
+ * var firstChar_str:String = my_str.charAt(0);
+ * trace(firstChar_str); // output: C
+ *
+ *
+ *
+ * @see #charCodeAt()
+ * @helpid x209BA
+ * @refpath Objects/Core/String/Methods/charAt
+ * @keyword string, string.charat, charat, character at
+ */
+ public native function charAt(index:Number = 0):String;
+
+ /**
+ * Returns the numeric Unicode character code of the character at the specified
+ * index. If index is not a number from 0 to
+ * string.length - 1, NaN is returned.
+ *
+ * This method is similar to String.charAt() except that the returned
+ * value is a 16-bit integer character code, not the actual character.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param index An integer that specifies the position of a character in the string. The
+ * first character is indicated by 0, and the last character is indicated by
+ * my_str.length - 1.
+ *
+ * @return The Unicode character code of the character at the specified index. Or
+ * NaN if the index is outside the range of this string's indices.
+ *
+ * @oldexample In the following example, this method is called on the first letter of the string "Chris":
+ *
+ * var my_str:String = "Chris";
+ * var firstChar_num:Number = my_str.charCodeAt(0);
+ * trace(firstChar_num); // output: 67
+ *
+ *
+ *
+ * @see #charAt()
+ * @helpid x209BB
+ * @refpath Objects/Core/String/Methods/charCodeAt
+ * @keyword string, string.charcodeat, charcodeat, character code at
+ */
+ public native function charCodeAt(index:Number = 0):Number;
+
+ /**
+ * Appends the supplied arguments to the end of the String object, converting them to strings if
+ * necessary, and returns the resulting string. The original value of the source String object
+ * remains unchanged.
+ *
+ * @playerversion Flash 9
+ *
+ * @param ...args Zero or more values to be concatenated.
+ *
+ * @return A new string consisting of this string concatenated
+ * with the specified parameters.
+ *
+ * @oldexample The following example creates two strings and combines them using String.concat():
+ *
+ * var stringA:String = "Hello";
+ * var stringB:String = "World";
+ * var combinedAB:String = stringA.concat(" ", stringB);
+ * trace(combinedAB); // output: Hello World
+ *
+ *
+ *
+ * @helpid x209BC
+ * @refpath Objects/Core/String/Methods/concat
+ * @keyword string, string.concat, concat, concatenate
+ */
+ public native function concat(...args):String;
+
+ /**
+ * Searches the string and returns the position of the first occurrence of val
+ * found at or after startIndex within the calling string. This index is zero-based,
+ * meaning that the first character in a string is considered to be at index 0--not index 1. If
+ * val is not found, the method returns -1.
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The substring for which to search.
+ *
+ * @param startIndex An optional integer specifying the starting index of the search.
+ *
+ * @return The index of the first occurrence of the specified substring or -1.
+ *
+ * @oldexample The following examples use indexOf() to return the index of characters and substrings:
+ *
+ * var searchString:String = "Lorem ipsum dolor sit amet.";
+ * var index:Number;
+ *
+ * index = searchString.indexOf("L");
+ * trace(index); // output: 0
+ *
+ * index = searchString.indexOf("l");
+ * trace(index); // output: 14
+ *
+ * index = searchString.indexOf("i");
+ * trace(index); // output: 6
+ *
+ * index = searchString.indexOf("ipsum");
+ * trace(index); // output: 6
+ *
+ * index = searchString.indexOf("i", 7);
+ * trace(index); // output: 19
+ *
+ * index = searchString.indexOf("z");
+ * trace(index); // output: -1
+ *
+ *
+ *
+ * @see #lastIndexOf()
+ * @helpid x209C2
+ * @refpath Objects/Core/String/Methods/indexOf
+ * @keyword string, string.indexof, indexof, index
+ */
+ public native function indexOf(val:String = "undefined", startIndex:Number = 0):int;
+
+ /**
+ * Searches the string from right to left and returns the index of the last occurrence
+ * of val found before startIndex. The index is zero-based,
+ * meaning that the first character is at index 0, and the last is at string.length
+ * - 1. If val is not found, the method returns -1.
+ *
+ * @playerversion Flash 9
+ *
+ * @param val The string for which to search.
+ *
+ * @param startIndex An optional integer specifying the starting index from which to
+ * search for val. The default is the maximum value allowed for an index.
+ * If startIndex is not specified, the search starts at the last item in the string.
+ *
+ * @return The position of the last occurrence of the specified substring or -1 if not found.
+ *
+ * @oldexample The following example shows how to use lastIndexOf() to return the index of a certain character:
+ *
+ * var searchString:String = "Lorem ipsum dolor sit amet.";
+ * var index:Number;
+ *
+ * index = searchString.lastIndexOf("L");
+ * trace(index); // output: 0
+ *
+ * index = searchString.lastIndexOf("l");
+ * trace(index); // output: 14
+ *
+ * index = searchString.lastIndexOf("i");
+ * trace(index); // output: 19
+ *
+ * index = searchString.lastIndexOf("ipsum");
+ * trace(index); // output: 6
+ *
+ * index = searchString.lastIndexOf("i", 18);
+ * trace(index); // output: 6
+ *
+ * index = searchString.lastIndexOf("z");
+ * trace(index); // output: -1
+ *
+ *
+ *
+ * @see #indexOf()
+ * @helpid x209C3
+ * @refpath Objects/Core/String/Methods/lastIndexOf
+ * @keyword string, string.lastindexof, lastindexof, last index of
+ */
+ public native function lastIndexOf(val:String = "undefined", startIndex:Number=0x7FFFFFFF):int;
+
+ /**
+ * Compares the sort order of two or more strings and returns the result of the comparison as an integer. While this
+ * method is intended to handle the comparison in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from other string comparisons such as the equality (==) or
+ * inequality (!=) operators.
+ * If the strings are equivalent, the return value is 0.
+ * If the original string value precedes the string value specified by other,
+ * the return value is a negative integer, the absolute value of which represents
+ * the number of characters that separates the two string values.
+ * If the original string value comes after other,
+ * the return value is a positive integer, the absolute value of which represents
+ * the number of characters that separates the two string values.
+ *
+ * @param other A string value to compare.
+ * @param ...values Optional set of more strings to compare.
+ * @return The value 0 if the strings are equal. Otherwise, a negative integer if the original
+ * string precedes the string argument and a positive integer if the string argument precedes
+ * the original string. In both cases the absolute value of the number represents the difference
+ * between the two strings.
+ */
+ public native function localeCompare(other:String, ...values):int;
+
+ /**
+ * Matches the specifed pattern against the string and returns a new string
+ * in which the first match of pattern is replaced with the content specified by repl.
+ * The pattern parameter can be a string or a regular expression. The repl parameter
+ * can be a string or a function; if it is a function, the string returned
+ * by the function is inserted in place of the match. The original string is not modified.
+ *
+ *
In the following example, only the first instance of "sh" (case-sensitive)
+ * is replaced:
+ *
+ *
+ * var myPattern:RegExp = /sh/;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // She sells seaschells by the seashore.
+ *
+ *
In the following example, all instances of "sh" (case-sensitive)
+ * are replaced because the g (global) flag is set in the regular expression:
+ *
+ *
+ * var myPattern:RegExp = /sh/g;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // She sells seaschells by the seaschore.
+ *
+ *
In the following example, all instance of "sh"
+ * are replaced because the g (global) flag is set in the regular expression
+ * and the matches are not case-sensitive becuase the i (ignoreCase) flag is set:
+ *
+ *
+ * var myPattern:RegExp = /sh/gi;
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.replace(myPattern, "sch"));
+ * // sche sells seaschells by the seaschore.
+ *
+ * @param pattern The pattern to match, which can be any type of object, but it is typically
+ * either a string or a regular expression. If you specify a pattern parameter
+ * that is any object other than a string or a regular expression, the toString() method is
+ * applied to the parameter and the replace() method executes using the resulting string
+ * as the pattern.
+ *
+ * @param repl Typically, the string that is inserted in place of the matching content. However, you can
+ * also specify a function as this parameter. If you specify a function, the string returned
+ * by the function is inserted in place of the matching content.
+ *
+ *
When you specify a string as the repl parameter and specify a regular expression
+ * as the pattern parameter, you can use the following special $ replacement codes
+ * in the repl string:
+ *
+ *
+ *
+ *
+ *
+ *
$ Code
+ *
+ *
+ *
Replacement Text
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$$
+ *
+ *
+ *
$
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$&
+ *
+ *
+ *
The matched substring.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$`
+ *
+ *
+ *
The portion of the string that precedes the matched substring.
+ * Note that this code uses the straight left single quote character (`),
+ * not the straight single quote character (') or the left curly single quote
+ * character ().
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$'
+ *
+ *
+ *
The portion of string that follows the matched substring.
+ * Note that this code uses the straight single quote character (').
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$n
+ *
+ *
+ *
The nth captured parenthetical group match, where n is a single
+ * digit 1-9 and $n is not followed by a decimal digit.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
$nn
+ *
+ *
+ *
The nnth captured parenthetical group match, where nn is a two-digit
+ * decimal number (01-99). If the nnth capture is undefined, the replacement text
+ * is an empty string.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
For example, the following shows the use of the $2 and $1
+ * replacement codes, which represent the first and second capturing group matched:
When you specify a function as the repl, the replace() method
+ * passes the following parameters to the function:
+ *
+ *
+ *
+ *
+ *
+ * The matching portion of the string.
+ *
+ *
+ *
+ * Any captured parenthetical group matches are provided as the next arguments. The number of arguments passed
+ * this way will vary depending on the number of parenthetical matches. You can determine the
+ * number of parenthetical matches by checking arguments.length - 3 within the function
+ * code.
+ *
+ *
+ *
+ * The index position in the string where the match begins.
+ *
The call to the replace() method uses a function as the repl
+ * parameter. The regular expression (/([a-z]*)([0-9]*)/g) is matched twice. The
+ * first time, the pattern matches the substring "abc12", and the following list
+ * of arguments is passed to the function:
+ *
The second time, the pattern matches the substring "def23", and the
+ * following list of arguments is passed to the function:
+ *
+ *
+ *
+ * {"def34", "def", "34", 6, "abc123 def34"}
+ *
+ *
+ * @return The resulting string. Note that the source string remains unchanged.
+ *
+ * @see RegExp
+ */
+ public native function replace(pattern:*, repl:Object):String;
+
+ /**
+ * Matches the specifed pattern against the
+ * string.
+ *
+ * @param pattern The pattern to match, which can be any type of object, but it is typically
+ * either a string or a regular expression. If the pattern is not a regular expression
+ * or a string, then the method converts it to a string before executing.
+ *
+ * @return An array of strings consisting of all substrings in
+ * the string that match the specified pattern.
+ *
+ *
If pattern is a regular expression, in order to return an array with
+ * more than one matching substring, the g (global) flag must be set
+ * in the regular expression:
+ *
+ *
+ *
+ *
If the g (global) flag is not set,
+ * the return array will contain no more than one match, and the lastIndex
+ * property of the regular expression remains unchanged.
+ *
+ *
If the g (global) flag is set, the method starts the search at
+ * the beginning of the string (index position 0). If a matching substring is an empty string (which
+ * can occur with a regular expression such as /x~~/), the method adds that
+ * empty string to the array of matches, and then continues searching at the next index position.
+ * The lastIndex property of the regular expression is set to 0 after the
+ * method completes.
+ *
+ *
+ *
+ *
If no match is found, the method returns null. If you pass
+ * no value (or an undefined value) as the pattern parameter,
+ * the method returns null.
+ *
+ *
+ * @oldexample
+ * var myPattern:RegExp = /sh./g;
+ * // The dot (.) matches any character.
+ * var str:String = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: she,sho
+ *
+ * myPattern = /sh./gi;
+ * // This time, make it case insensitive (with the i flag).
+ * str = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: She,she,sho
+ *
+ * myPattern = RegExp = new RegExp("sh(.)", "gi")
+ * // Note the grouping parentheses.
+ * str = "She sells seashells by the seashore.";
+ * trace(str.match(myPattern));
+ *
+ * // Output: She,e,she,e,sho,o
+ * // Note that the result array is
+ * // [[She,e],[she,e],[sho,o]]
+ *
+ *
+ * @see RegExp
+ */
+ public native function match(pattern:*):Array;
+
+ /**
+ * Searches for the specifed pattern and returns the index of
+ * the first matching substring. If there is no matching substring, the method returns
+ * -1.
+ *
+ * @param pattern The pattern to match, which can be any type of object but is typically
+ * either a string or a regular expression.. If the pattern is not a regular expression
+ * or a string, then the method converts it to a string before executing.
+ * Note that if you specify a regular expression, the method ignores the global flag ("g") of the
+ * regular expression, and it ignores the lastIndex property of the regular
+ * expression (and leaves it unmodified). If you pass an undefined value (or no value),
+ * the method returns -1.
+ *
+ * @return The index of the first matching substring, or -1 if
+ * there is no match. Note that the string is zero-indexed; the first character of
+ * the string is at index 0, the last is at string.length - 1.
+ *
+ * @oldexample
+ * var str:String = "She sells seashells by the seashore.";
+ * var myPattern:RegExp = /sh/;
+ * // This time, make it case insensitive (with the i flag).
+ * trace(str.match(myPattern));
+ *
+ * // Output: 13
+ * // (The substring match starts at character position 13.)
+ *
+ * var myPattern:RegExp = /sh/i;
+ * trace(str.match(myPattern));
+ *
+ * // Output: 0
+ * // (The substring match starts at character position 0
+ * // -- the first character of the source string.)
+ *
+ *
+ * @see RegExp
+ */
+ public native function search(pattern:*):int;
+
+ /**
+ * Returns a string that includes the startIndex character
+ * and all characters up to, but not including, the endIndex character. The original String object is not modified.
+ * If the endIndex parameter is not specified, then the end of the
+ * substring is the end of the string. If the character indexed by startIndex is the same as or to the right of the
+ * character indexed by endIndex, the method returns an empty string.
+ *
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex The zero-based index of the starting point for the slice. If
+ * startIndex is a negative number, the slice is created from right-to-left, where
+ * -1 is the last character.
+ *
+ * @param endIndex An integer that is one greater than the index of the ending point for
+ * the slice. The character indexed by the endIndex parameter is not included in the extracted
+ * string.
+ * If endIndex is a negative number, the ending point is determined by
+ * counting back from the end of the string, where -1 is the last character.
+ * The default is the maximum value allowed for an index. If this parameter is omitted, String.length is used.
+ *
+ * @return A substring based on the specified indices.
+ *
+ * @oldexample The following example creates a variable, my_str, assigns it a String value, and then calls
+ * the slice() method using a variety of values for both the start and end
+ * parameters.
+ * Each call to slice() is wrapped in a trace() statement that displays
+ * the output in the Output panel.
+ * Each call to the slice() method is wrapped in a
+ * trace() statement that sends the output to the log file.
+ *
+ *
+ * // Index values for the string literal
+ * // positive index: 0 1 2 3 4
+ * // string: L o r e m
+ * // negative index: -5 -4 -3 -2 -1
+ *
+ * var my_str:String = "Lorem";
+ *
+ * // slice the first character
+ * trace("slice(0,1): "+my_str.slice(0, 1)); // output: slice(0,1): L
+ * trace("slice(-5,1): "+my_str.slice(-5, 1)); // output: slice(-5,1): L
+ *
+ * // slice the middle three characters
+ * trace("slice(1,4): "+my_str.slice(1, 4)); // slice(1,4): ore
+ * trace("slice(1,-1): "+my_str.slice(1, -1)); // slice(1,-1): ore
+ *
+ * // slices that return empty strings because start is not to the left of end
+ * trace("slice(1,1): "+my_str.slice(1, 1)); // slice(1,1):
+ * trace("slice(3,2): "+my_str.slice(3, 2)); // slice(3,2):
+ * trace("slice(-2,2): "+my_str.slice(-2, 2)); // slice(-2,2):
+ *
+ * // slices that omit the end parameter use String.length, which equals 5
+ * trace("slice(0): "+my_str.slice(0)); // slice(0): Lorem
+ * trace("slice(3): "+my_str.slice(3)); // slice(3): em
+ *
+ *
An example is also in the Strings.fla file in the HelpExamples folder.
+ * The following list gives typical paths to this folder:
+ *
+ *
+ *
+ *
+ * @see #substr()
+ * @see #substring()
+ * @helpid x209CB
+ * @refpath Objects/Core/String/Methods/slice
+ * @keyword string, string.slice, slice
+ */
+ public native function slice(startIndex:Number = 0, endIndex:Number = 0x7fffffff):String;
+
+ /**
+ * Splits a String object into an array of substrings
+ * by dividing it wherever the specified delimiter parameter
+ * occurs.
+ *
+ *
If the delimiter parameter is a regular expression, only
+ * the first match at a given position of the string is considered,
+ * even if backtracking could find a nonempty substring match at that
+ * position. For example:
If the delimiter parameter is a regular expression
+ * containing grouping parentheses, then each time the
+ * delimiter is matched, the results (including any
+ * undefined results) of the grouping parentheses are spliced into the
+ * output array. For example
+ *
+ *
+ * var str:String = "Thi5 is a tricky-66 example.";
+ * var re:RegExp = /(\d+)/;
+ * var results:Array = str.split(re);
+ * // results == ["Thi","5"," is a tricky-","66"," example."]
+ *
+ *
+ *
If the limit parameter is specified, then
+ * the returned array will have no more than the specified
+ * number of elements.
+ *
If the delimiter is an empty string, an empty
+ * regular expression, or a regular expression that can match an empty
+ * string, each single character in the string
+ * is ouput as an element in the array.
+ *
+ *
If the delimiter parameter is undefined, the entire
+ * string is placed into the first element of the returned
+ * array.
+ *
+ * @playerversion Flash 9
+ *
+ * @param delimiter The pattern that specifies where to split this string. This can be any type of
+ * object but is typically either a string or a regular expression. If the delimiter
+ * is not a regular expression or string, then the method converts it to a string before executing.
+ *
+ * @param limit The maximum number of items to place into the array.
+ * The default is the maximum value allowed.
+ *
+ *
+ * @return An array of substrings.
+ *
+ *
+ *
+ * @see Array#join()
+ * @see RegExp
+ * @helpid x209CC
+ * @refpath Objects/Core/String/Methods/split
+ * @keyword string, string.split, split
+ */
+ public native function split(delimiter:*, limit:Number = 0x7fffffff):Array;
+
+ /**
+ * Returns a substring consisting of the characters that start at the specified
+ * startIndex and with a length specified by len. The original
+ * string is unmodified.
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex An integer that specified the index of the first character to be
+ * used to create the substring. If startIndex is a negative number, the
+ * starting index is determined from the end of the string, where -1 is the
+ * last character.
+ *
+ * @param len The number of characters in the substring being created.
+ * The default value is the maximum value allowed. If len
+ * is not specified, the substring includes all the characters from startIndex
+ * to the end of the string.
+ *
+ * @return A substring based on the specified parameters.
+ *
+ * @oldexample The following example creates a new string, my_str and uses substr() to return the second word in the string; first, using a positive start parameter, and then using a negative start parameter:
+ *
+ * var my_str:String = new String("Hello world");
+ * var mySubstring:String = new String();
+ * mySubstring = my_str.substr(6,5);
+ * trace(mySubstring); // output: world
+ *
+ * mySubstring = my_str.substr(-5,5);
+ * trace(mySubstring); // output: world
+ *
+ *
An example is also in the Strings.fla file in the HelpExamples folder. The following list gives typical paths to this folder:
+ *
+ *
+ * @helpid x209CD
+ * @refpath Objects/Core/String/Methods/substr
+ * @keyword string, string.substr, substr, substring
+ */
+ public native function substr(startIndex:Number = 0, len:Number = 0x7fffffff):String;
+
+ /**
+ * Returns a string consisting of the character specified by startIndex
+ * and all characters up to endIndex - 1. If endIndex is not
+ * specified, String.length is used. If the value of startIndex
+ * equals the value of endIndex, the method returns an empty string.
+ * If the value of startIndex is greater than the value of
+ * endIndex, the parameters are automatically swapped before the function
+ * executes. The original string is unmodified.
+ *
+ * @playerversion Flash 9
+ *
+ * @param startIndex An integer specifying the index of the first character used to create
+ * the substring. Valid values for startIndex are 0 through
+ * String.length. If startIndex is a negative value, 0
+ * is used.
+ *
+ * @param endIndex An integer that is one greater than the index of the last character in the
+ * extracted substring. Valid values for endIndex are 0 through
+ * String.length. The character at endIndex is not included in
+ * the substring. The default is the maximum value allowed for an index.
+ * If this parameter is omitted, String.length is used. If
+ * this parameter is a negative value, 0 is used.
+ *
+ * @return A substring based on the specified parameters.
+ *
+ * @oldexample The following example shows how to use substring():
+ *
+ * var my_str:String = "Hello world";
+ * var mySubstring:String = my_str.substring(6,11);
+ * trace(mySubstring); // output: world
+ *
+ *
The following example shows what happens if a negative start parameter is used:
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all uppercase characters converted
+ * to lowercase.
+ *
+ * @see #toUpperCase()
+ * @helpid x209CF
+ * @refpath Objects/Core/String/Methods/toLowerCase
+ * @keyword string, string.tolowercase, tolowercase, to lowercase
+ */
+ public native function toLowerCase():String;
+
+ /**
+ * Returns a copy of this string, with all uppercase characters converted
+ * to lowercase. The original string is unmodified. While this
+ * method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from the toLowerCase() method.
+ *
+ * @return A copy of this string with all uppercase characters converted
+ * to lowercase.
+ *
+ * @see #toLowerCase()
+ */
+ public native function toLocaleLowerCase():String;
+
+
+ /**
+ * Returns a copy of this string, with all lowercase characters converted
+ * to uppercase. The original string is unmodified.
+ *
+ *
This method converts all characters (not simply a-z) for which Unicode uppercase
+ * equivalents exist:
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all lowercase characters converted
+ * to uppercase.
+ *
+ *
+ * @see #toLowerCase()
+ * @helpid x209D0
+ * @refpath Objects/Core/String/Methods/toUpperCase
+ * @keyword string, string.touppercase, touppercase, to uppercase
+ */
+ public native function toUpperCase():String;
+
+ /**
+ * Returns a copy of this string, with all lowercase characters converted
+ * to uppercase. The original string is unmodified. While this
+ * method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation
+ * does not produce a different result from the toUpperCase() method.
+ *
+ * @playerversion Flash 9
+ *
+ * @return A copy of this string with all lowercase characters converted
+ * to uppercase.
+ *
+ * @see #toUpperCase()
+ */
+ public native function toLocaleUpperCase():String;
+
+ /**
+ * Returns the primitive value of a String instance. This method is designed to
+ * convert a String object into a primitive string value. Because Flash Player
+ * automatically calls valueOf() when necessary,
+ * you rarely need to explicitly call this method.
+ *
+ * @playerversion Flash 9
+ *
+ * @return The value of the string.
+ *
+ * @oldexample The following example creates a new instance of the String class
+ * and then shows that the valueOf method returns
+ * the primitive value, rather than a reference to the new instance.
+ *
+ *
+ * var str:String = new String("Hello World");
+ * var value:String = str.valueOf();
+ * trace(str instanceof String); // true
+ * trace(value instanceof String); // false
+ * trace(str === value); // false
+ *
+ *
+ * @langversion 3.0
+ */
+ public native function valueOf():String;
+}
+
+
+}
+package {
+/**
+ * A SyntaxError exception is thrown when a parsing error occurs.
+ *
+ *
ActionScript does not support the eval function or the Function
+ * constructor, two features that require an ActionScript compiler to be present to work.
+ * Therefore, ActionScript cannot throw SyntaxError exceptions in the cases
+ * described in the ECMA-262 specification.
+ *
ActionScript throws SyntaxError exceptions when an invalid
+ * regular expression is parsed by the RegExp class.
+ *
ActionScript throws SyntaxError exceptions when invalid XML is
+ * parsed by the XML class.
+ *
SyntaxError exceptions are thrown in accordance with the E4X
+ * specification; for instance, Section 10.3.1
+ *
+ *
+ *
+ * @see RegExp RegExp class
+ * @see XML XML class
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, SyntaxError
+ */
+public dynamic class SyntaxError extends Error
+{
+ /**
+ * Creates a new SyntaxError object.
+ */
+ public native function SyntaxError(message:String = "");
+
+}
+
+
+}
+package {
+
+/**
+ * A TypeError exception is thrown when the actual type of an operand is different
+ * from the expected type.
+ *
+ * In addition, this exception is thrown when:
+ *
+ *
An actual parameter to a function or method could not be coerced to the formal
+ * parameter type.
+ *
A value is assigned to a variable and cannot be coerced to the variable's type.
+ *
The right side of the is or instanceof operator is not a valid type.
+ *
The super keyword is used illegally.
+ *
A property lookup results in more than one binding, and is therefore ambiguous.
+ *
A method is invoked on an incompatible object. For example, a TypeError
+ * exception is thrown if a RegExp method is "grafted" onto a generic object
+ * and then invoked.
+ *
+ *
+ *
+ * @see operators.html#is is operator
+ * @see operators.html#instanceof instanceof operator
+ * @see statements.html#super super statement
+ * @see RegExp RegExp class
+ * @includeExample examples\TypeErrorExample.as -noswf
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, TypeError
+ *
+ */
+public dynamic class TypeError extends Error
+{
+ /**
+ * Creates a new TypeError object.
+ */
+ public native function TypeError(message:String = "");
+
+}
+
+
+}
+package {
+/**
+ * The uint class provides methods for working with a data type representing a 32-bit unsigned integer. Because an unsigned integer can only be
+ * positive, its maximum value is twice that of the int class.
+ *
The range of values represented by the uint class is 0 to 4,294,967,295 (2^32-1).
+ *
You can create a uint object by declaring a variable of type uint and assigning the variable a literal value. The default value of a variable of type uint is 0.
+ *
The uint class is primarily useful for pixel color values (ARGB and RGBA) and other situations where
+ * the int data type does not work well. For example, the number 0xFFFFFFFF, which
+ * represents the color value white with an alpha value of 255, can't be represented
+ * using the int data type because it is not within the valid range of the int values.
+ *
+ *
The following example creates a uint object and calls the
+ * toString() method:
+ *
+ * @helpid x2096B
+ * @refpath Objects/Core/uint/Constants/MIN_VALUE
+ * @keyword uint, uint.min_value, min_value, min value
+ */
+ public static const MIN_VALUE:uint = 0;
+
+ /**
+ * Creates a new uint object. You can create a variable of uint type and assign it a literal value. The new uint() constructor is primarily used
+ * as a placeholder. A uint object is not the same as the
+ * uint() function, which converts a parameter to a primitive value.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @param num The numeric value of the uint object being created,
+ * or a value to be converted to a number. If num is not provided,
+ * the default value is 0.
+ *
+ * @return A reference to a uint object.
+ *
+ * @example The following code constructs two new uint objects; the first by assigning a literal value, and the second by using the constructor function:
+ *
+ * var n1:uint = 3;
+ * var n2:uint = new uint(10);
+ *
+ *
+ * @helpid x2097C
+ * @refpath Objects/Core/uint/new uint
+ * @keyword new number, constructor
+ */
+ public native function uint(num:Object);
+
+ /**
+ * Returns the string representation of a uint object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @usage myuint.toString(radix:uint) : String
+ *
+ * @param radix Specifies the numeric base (from 2 to 36) to use for the
+ * number-to-string conversion. If you do not specify the radix
+ * parameter, the default value is 10.
+ *
+ * @return The string representation of the uint object.
+ *
+ * @example The following example uses 2 and 8 for the radix
+ * parameters and returns a string value with the corresponding
+ * representation of the number 9:
+ *
+ * The following example creates hexadecimal values:
+ *
+ * var r:uint = 250;
+ * var g:uint = 128;
+ * var b:uint = 114;
+ * var rgb:String = "0x" + r.toString(16) + g.toString(16) + b.toString(16);
+ * trace(rgb); // output: 0xFA8072 (Hexadecimal equivalent of the color 'salmon')
+ *
+ *
+ * @helpid x2097E
+ * @refpath Objects/Core/uint/Methods/toString
+ * @keyword uint, uint.tostring, tostring
+ */
+ public native function toString(radix:uint):String;
+
+ /**
+ * Returns the primitive uint type value of the specified
+ * uint object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ *
+ * @return The primitive uint type value of this uint
+ * object.
+ *
+ * @example The following example outputs the primitive value of the
+ * numSocks object.
+ *
+ *
+ * @helpid x20A24
+ * @refpath Objects/Core/uint/Methods/valueOf
+ * @keyword number, number.valueof, valueof, value of
+ */
+ public native function valueOf():uint;
+}
+
+}
+package {
+
+/**
+ * A URIError exception is thrown when one of the global URI handling functions is used
+ * in a way that is incompatible with its definition. This exception is thrown when an invalid
+ * URI is specified to a Flash
+ * Player API function that expects a valid URI, such as the Socket.connect()
+ * method or the XML.load() method.
+ *
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid x20ACB
+ * @refpath
+ * @keyword Error, URIError
+ *
+ * @see flash.net.Socket#connect()
+ * @see XML#load()
+ */
+public dynamic class URIError extends Error
+{
+ /**
+ * Creates a new URIError object.
+ * @param message Contains the message associated with the URIError object.
+ */
+ public native function URIError(message:String = "");
+
+}
+
+}
+package {
+//****************************************************************************
+// ActionScript Standard Library
+// VerifyError object
+//****************************************************************************
+/**
+ * The VerifyError class represents an error that occurs when a malformed
+ * or corrupted SWF file is encountered.
+ *
+ * @tiptext An VerifyError is thrown when a malformed or corrupted SWF File is encountered.
+ *
+ * @includeExample
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword Error
+ * @see flash.display.Loader Loader class
+ */
+public dynamic class VerifyError extends Error
+{
+ /**
+ * Creates a new VerifyError object.
+ * @param message Contains the message associated with the VerifyError object.
+ */
+ public native function VerifyError(message:String = "");
+}
+
+
+}
+package {
+//
+// XML
+//
+
+// Based on the ECMA E4X Specification, 2nd Edition
+
+ /**
+ * The XML class contains methods and properties for working with XML objects. The XML class
+ * (along with the XMLList, Namespace, and QName classes) implements the
+ * powerful XML-handling standards defined in ECMAScript for XML
+ * (E4X) specification (ECMA-357 edition 2).
+ *
+ *
Use the toXMLString() method to return a string representation of the XML object
+ * regardless of whether the XML object has simple content or complex content.
+ *
+ *
Note: The XML class (along with related classes) from ActionScript 2.0 has been
+ * renamed XMLDocument and moved into the flash.xml package.
+ * It is included in ActionScript 3.0 for backward compatibility.
+ *
+ *
+ * @includeExample examples\XMLExample.as -noswf
+ *
+ * @see Namespace
+ * @see QName
+ * @see XMLList
+ * @see XML#toXMLString()
+ * @see http://www.ecma-international.org/publications/standards/Ecma-357.htm ECMAScript for XML
+ * (E4X) specification (ECMA-357 edition 2)
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML
+*/
+public final dynamic class XML extends Object
+{
+
+ /**
+ * The default number of arguments for the constructor. You can specify 1 or no arguments. For details, see the XML() constructor function.
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @see #XML()
+ */
+ public static const length:int = 1;
+
+ /**
+ * Creates a new XML object. You must use the constructor to create an
+ * XML object before you call any of the methods of the XML class.
+ *
+ *
Use the toXMLString() method to return a string representation of the XML object
+ * regardless of whether the XML object has simple content or complex content.
+ *
+ * @param value Any object that can be converted to XML with the top-level
+ * XML() function.
+ *
+ * @see package.html#XML() top-level XML() function
+ * @see XML#toXMLString()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML
+ **/
+ public native function XML(value:Object);
+
+ /**
+ * Adds a namespace to the set of in-scope namespaces for the XML object. If the namespace already
+ * exists in the in-scope namespaces for the XML object (with a prefix matching that of the given
+ * parameter), then the prefix of the existing namespace is set to undefined. If the input parameter
+ * is a Namespace object, it's used directly. If it's a QName object, the input parameter's
+ * URI is used to create a new namespace; otherwise, it's converted to a String and a namespace is created from
+ * the String.
+ *
+ * @param ns The namespace to add to the XML object.
+ *
+ * @return The new XML object, with the namespace added.
+ *
+ * @includeExample examples\XML.addNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.addNamespace, addNamespace
+ **/
+ public native function addNamespace (ns:Object):XML;
+
+ /**
+ * Appends the given child to the end of the XML object's properties.
+ * The appendChild() method takes an XML object, an XMLList object, or
+ * any other data type that is then converted to a String.
+ *
+ * @return The resulting XML object.
+ *
+ * @param child The XML object to append.
+ *
+ * @oldexample Consider the following:
+ *
+ * var grp = <orchestra>
+ * <musician id="0" ><name>George</name><instrument>cello</instrument></musician>
+ * <musician id="1" ><name>Sam</name></musician>
+ * </orchestra>;
+ *
+ *
+ *
Add a new instrument element to the end of musician element for Sam:
+ *
grp.musician.(name == "George").appendChild(<instrument>cello</instrument>);
+ * Here is the resulting XML, which the method returns:
+ * var grp = <orchestra>
+ * <musician id="0" ><name>George</name><instrument>cello</instrument></musician>
+ * <musician id="1" ><<name>Sam</name><instrument>cello</instrument></musician>
+ * </orchestra>;
+ *
+ *
+ *
+ * @includeExample examples\XML.appendChild.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.appendChild, appendChild
+ **/
+ public native function appendChild ( child:Object ):XML;
+
+ /**
+ * Returns the XML value of the attribute that has the name matching the attributeName
+ * parameter. Attributes are found within XML elements.
+ * In the following example, the element has an attribute named "gender"
+ * with the value "boy": <first gender="boy">John</first>.
+ *
+ *
The attributeName parameter can be any data type; however,
+ * String is the most common data type to use. When passing any object other than a QName object,
+ * the attributeName parameter uses the toString() method
+ * to convert the parameter to a string.
+ *
+ *
If you need a qualified name reference, you can pass in a QName object. A QName object
+ * defines a namespace and the local name, which you can use to define the qualified name of an
+ * attribute. Therefore calling attribute(qname) is not the same as calling
+ * attribute(qname.toString()).
+ *
+ * @includeExample examples\XMLAttributeExample1.as -noswf
+ * @includeExample examples\XMLAttributeExample2.as -noswf
+ *
+ * @param attributeName The name of the attribute.
+ *
+ * @return An XMLList object or an empty XMLList object. Returns an empty XMLList object
+ * when an attribute value has not been defined.
+ *
+ * @see XML#attributes()
+ * @see QName
+ * @see Namespace
+ * @see XML#elements()
+ * @see operators.html#attribute_identifier attribute identifier (@) operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.attribute, attribute
+ **/
+ public native function attribute (attributeName:*):XMLList;
+
+ /**
+ * Returns a list of attribute values for the given XML object. Use the name()
+ * method with the attributes() method to return the name of an attribute.
+ * Use @~~ to return the names of all attributes.
+ *
+ * @return The list of attribute values.
+ *
+ * @includeExample examples\XMLAttributesExample1.as -noswf
+ * @includeExample examples\XMLAttributesExample2.as -noswf
+ *
+ * @see XML#attribute()
+ * @see XML#name()
+ * @see operators.html#attribute_identifier @ operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.attributes, attributes
+ **/
+ public native function attributes():XMLList;
+
+ /**
+ * Lists the children of an XML object. An XML child is an XML element, text node, comment,
+ * or processing instruction.
+ *
+ *
Use the propertyName parameter to list the
+ * contents of a specific XML child. For example, to return the contents of a child named
+ * <first>, use child.name("first"). You can generate the same result
+ * by using the child's index number. The index number identifies the child's position in the
+ * list of other XML children. For example, name.child(0) returns the first child
+ * in a list.
+ *
+ *
Use an asterisk (~~) to output all the children in an XML document.
+ * For example, doc.child("~~").
+ *
+ *
Use the length() method with the asterisk (~~) parameter of the
+ * child() method to output the total number of children. For example,
+ * numChildren = doc.child("~~").length().
+ *
+ * @param propertyName The element name or integer of the XML child.
+ *
+ * @return An XMLList object of child nodes that match the input parameter.
+ *
+ * @includeExample examples\XML.child.1.as -noswf
+ *
+ * @see XML#elements()
+ * @see XMLList XMLList class
+ * @see XML#length()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.child, child
+ **/
+ public native function child(propertyName:Object):XMLList;
+
+ /**
+ * Identifies the zero-indexed position of this XML object within the context of its parent.
+ *
+ * @return The position of the object. Returns -1 as well as positive integers.
+ *
+ * @includeExample examples\XML.childIndex.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.childindex, childindex
+ **/
+ public native function childIndex():int;
+
+ /**
+ * Lists the children of the XML object in the sequence in which they appear. An XML child
+ * is an XML element, text node, comment, or processing instruction.
+ *
+ * @return An XMLList object of the XML object's children.
+ *
+ * @includeExample examples\XML.children.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.children, children
+ **/
+ public native function children():XMLList;
+
+ /**
+ * Lists the properties of the XML object that contain XML comments.
+ *
+ * @return An XMLList object of the properties that contain comments.
+ *
+ * @includeExample examples\XML.comments.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.comments, comments
+ **/
+ public native function comments():XMLList;
+
+ /**
+ * Compares the XML object against the given value parameter.
+ *
+ * @param value A value to compare against the current XML object.
+ *
+ * @return If the XML object matches the value parameter, then true; otherwise false.
+ *
+ * @includeExample examples\XML.contains.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.contains, contains
+ **/
+ public native function contains (value:XML):Boolean;
+
+ /**
+ * Returns a copy of the given XML object. The copy is a duplicate of the entire tree of nodes.
+ * The copied XML object has no parent and returns null if you attempt to call the
+ * parent() method.
+ *
+ * @return The copy of the object.
+ *
+ * @includeExample examples\XML.copy.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.copy, copy
+ **/
+ public native function copy():XML;
+
+ /**
+ * Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the
+ * XML object that have the given name parameter. The name parameter
+ * is optional. The name parameter can be a QName object, a String data type
+ * or any other data type that is then converted to a String data type.
+ *
+ *
To return all descendants, use the "~~" parameter. If no parameter is passed,
+ * the string "~~" is passed and returns all descendants of the XML object.
+ *
+ * @param name The name of the element to match.
+ *
+ * @return An XMLList object of matching descendants. If there are no descendants, returns an
+ * empty XMLList object.
+ *
+ * @includeExample examples\XMLDescendantsExample1.as -noswf
+ *
+ * @see operators.html#descendant_accessor descendant accessor (..) operator
+ *
+ * @includeExample examples\XML.descendants.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.descendants, descendants
+ **/
+ public native function descendants (name:Object="*"):XMLList;
+
+ /**
+ * Returns an object with the following properties set to the default values: ignoreComments,
+ * ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and
+ * prettyPrinting. The default values are as follows:
+ *
+ *
+ *
ignoreComments = true
+ *
ignoreProcessingInstructions = true
+ *
ignoreWhitespace = true
+ *
prettyIndent = 2
+ *
prettyPrinting = true
+ *
+ *
+ *
Note: You do not apply this method to an instance of the XML class; you apply it to
+ * XML, as in the following code: var df:Object = XML.defaultSettings().
+ *
+ * @return An object with properties set to the default settings.
+ *
+ * @includeExample examples\XML.defaultSettings.1.as -noswf
+ *
+ * @see XML#ignoreComments
+ * @see XML#ignoreProcessingInstructions
+ * @see XML#ignoreWhitespace
+ * @see XML#prettyIndent
+ * @see XML#prettyPrinting
+ * @see XML#setSettings()
+ * @see XML#settings()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.defaultSettings, defaultSettings
+ **/
+ public native static function defaultSettings ():Object;
+
+ /**
+ * Lists the elements of an XML object. An element consists of a start and an end tag;
+ * for example <first></first>. The name parameter
+ * is optional. The name parameter can be a QName object, a String data type,
+ * or any other data type that is then converted to a String data type. Use the name parameter to list a specific element. For example,
+ * the element "first" returns "John" in this example:
+ * <first>John</first>.
+ *
+ *
To list all elements, use the asterisk (~~) as the
+ * parameter. The asterisk is also the default parameter.
+ *
+ *
Use the length() method with the asterisk parameter to output the total
+ * number of elements. For example, numElement = addressbook.elements("~~").length().
+ *
+ * @param name The name of the element. An element's name is surrounded by angle brackets.
+ * For example, "first" is the name in this example:
+ * <first></first>.
+ *
+ * @return An XMLList object of the element's content. The element's content falls between the start and
+ * end tags. If you use the asterisk (~~) to call all elements, both the
+ * element's tags and content are returned.
+ *
+ * @includeExample examples\XML.elements.1.as -noswf
+ *
+ * @includeExample examples\XMLElementsExample1.as -noswf
+ *
+ * @see XML#child()
+ * @see XMLList XMLList class
+ * @see XML#length()
+ * @see XML#attribute()
+ * @see operators.html#dot_(XML) XML dot (.) operator
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.elements, elements
+ **/
+ public native function elements ( name:Object="*" ):XMLList;
+
+ /**
+ * Checks to see whether the object has the property specified by the p parameter.
+ *
+ * @param p The property to match.
+ *
+ * @return If the property exists, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasOwnProperty.1.as -noswf
+ *
+ * @includeExample examples\XML.hasOwnProperty.2.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasOwnProperty, hasOwnProperty
+ **/
+ public native function hasOwnProperty ( p:String ):Boolean;
+
+ /**
+ * Checks to see whether the XML object contains complex content. An XML object contains complex content if
+ * it has child elements. XML objects that representing attributes, comments, processing instructions,
+ * and text nodes do not have complex content. However, an object that contains these can
+ * still be considered to contain complex content (if the object has child elements).
+ *
+ * @return If the XML object contains complex content, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasComplexContent.1.as -noswf
+ *
+ * @see XML#hasSimpleContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasComplexContent, hasComplexContent
+ **/
+ public native function hasComplexContent( ):Boolean;
+
+ /**
+ * Checks to see whether the XML object contains simple content. An XML object contains simple content
+ * if it represents a text node, an attribute node, or an XML element that has no child elements.
+ * XML objects that represent comments and processing instructions do not contain simple
+ * content.
+ *
+ * @return If the XML object contains simple content, true; otherwise false.
+ *
+ * @includeExample examples\XML.hasComplexContent.1.as -noswf
+ *
+ * @see XML#hasComplexContent()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.hasSimpleContent, hasSimpleContent
+ **/
+ public native function hasSimpleContent( ):Boolean;
+
+ /**
+ * Lists the namespaces for the XML object, based on the object's parent.
+ *
+ * @return An array of Namespace objects.
+ *
+ * @includeExample examples\XML.inScopeNamespaces.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.inScopeNamespaces, inScopeNamespaces
+ **/
+ public native function inScopeNamespaces( ):Array;
+
+ /**
+ * Inserts the given child2 parameter after the child1 parameter in this XML object and returns the
+ * resulting object. If the child1 parameter is null, the method
+ * inserts the contents of child2before all children of the XML object
+ * (in other words, after none). If child1 is provided, but it does not
+ * exist in the XML object, the XML object is not modified and undefined is
+ * returned.
+ *
+ *
If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on)
+ * undefined is returned.
+ *
+ * @param child1 The object in the source object that you insert before child2.
+ * @param child2 The object to insert.
+ *
+ * @return The resulting XML object or undefined.
+ *
+ * @includeExample examples\XML.insertChildAfter.1.as -noswf
+ *
+ * @see XML#insertChildBefore()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.insertChildAfter, insertChildAfter
+ **/
+ public native function insertChildAfter ( child1:Object , child2:Object):*;
+
+ /**
+ * Inserts the given child2 parameter before the child1 parameter
+ * in this XML object and returns the resulting object. If the child1 parameter
+ * is null, the method inserts the contents of
+ * child2after all children of the XML object (in other words, before
+ * none). If child1 is provided, but it does not exist in the XML object,
+ * the XML object is not modified and undefined is returned.
+ *
+ *
If you call this method on an XML child that is not an element (text, attributes,
+ * comments, pi, and so on) undefined is returned.
+ *
+ * @param child1 The object in the source object that you insert after child2.
+ * @param child2 The object to insert.
+ *
+ * @return The resulting XML object or undefined.
+ *
+ * @includeExample examples\XML.insertChildBefore.1.as -noswf
+ *
+ * @see XML#insertChildAfter()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.insertChildBefore, insertChildBefore
+ **/
+ public native function insertChildBefore ( child1:Object , child2:Object):*;
+
+ /**
+ * For XML objects, this method always returns the integer 1.
+ * The length() method of the XMLList class returns a value of 1 for
+ * an XMLList object that contains only one value.
+ *
+ * @return Always returns 1 for any XML object.
+ *
+ * @includeExample examples\XML.length.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.length, length
+ **/
+ public native function length ( ):int;
+
+ /**
+ * Gives the local name portion of the qualified name of the XML object.
+ *
+ * @return The local name as either a String or null.
+ *
+ * @includeExample examples\XML.localName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.localName, localName
+ **/
+ public native function localName ( ):Object;
+
+ /**
+ * Gives the qualified name for the XML object.
+ *
+ * @return The qualified name is either a QName or null.
+ *
+ * @includeExample examples\XML.name.1.as -noswf
+ *
+ * @includeExample examples\XML.name.2.as -noswf
+ *
+ * @see XML#attributes()
+ * @see operators.html#attribute_identifier
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.name, name
+ **/
+ public native function name ( ):Object;
+
+ /**
+ * If no parameter is provided, gives the namespace associated with the qualified name of
+ * this XML object. If a prefix parameter is specified, the method returns the namespace
+ * that matches the prefix parameter and that is in scope for the XML object. If there is no
+ * such namespace, the method returns undefined.
+ *
+ * @param prefix The prefix you want to match.
+ *
+ * @return Returns null, undefined, or a namespace.
+ *
+ * @includeExample examples\XML.namespace.1.as -noswf
+ *
+ * @includeExample examples\XML.namespace.2.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.namespace, namespace
+ **/
+ public native function namespace ( prefix:String = null ):*;
+
+ /**
+ * Lists namespace declarations associated with the XML object in the context of its parent.
+ *
+ * @return An array of Namespace objects.
+ *
+ * @includeExample examples\XML.namespaceDeclarations.1.as -noswf
+ *
+ * @see XML#namespace()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.namespaceDeclarations, namespaceDeclarations
+ **/
+ public native function namespaceDeclarations ( ): Array;
+
+ /**
+ * Specifies the type of node: text, comment, processing-instruction,
+ * attribute, or element.
+ *
+ * @return The node type used.
+ *
+ * @includeExample examples\XMLNodeKindExample1.as -noswf
+ *
+ * @see Operators.html#attribute_identifier
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.nodeKind, nodeKind
+ **/
+ public native function nodeKind ( ):String;
+
+ /**
+ * For the XML object and all descendant XML objects, merges adjacent text nodes and
+ * eliminates empty text nodes.
+ *
+ * @return The resulting normalized XML object.
+ *
+ * @includeExample examples\XML.normalize.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.normalize, normalize
+ **/
+ public native function normalize ( ):XML;
+
+ /**
+ * Returns the parent of the XML object. If the XML object has no parent, the method returns
+ * undefined.
+ *
+ * @return The parent XML object. Returns either a String or undefined.
+ *
+ * @includeExample examples\XML.parent.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.parent, parent
+ **/
+ public native function parent ( ):*;
+
+ /**
+ * If a name parameter is provided, lists all the children of the XML object
+ * that contain processing instructions with that name. With no parameters, the method
+ * lists all the children of the XML object that contain any processing instructions.
+ *
+ * @param name The name of the processing instructions to match.
+ *
+ * @return A list of matching child objects.
+ *
+ * @includeExample examples\XML.processingInstructions.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.processingInstructions, processingInstructions
+ **/
+ public native function processingInstructions ( name:String = "*" ):XMLList;
+
+ /**
+ * Inserts a copy of the provided child object into the XML element before any existing XML
+ * properties for that element.
+ *
+ * @param value The object to insert.
+ *
+ * @return The resulting XML object.
+ *
+ * @includeExample examples\XML.prependChild.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.prependChild, prependChild
+ **/
+ public native function prependChild ( value:Object ):XML;
+
+ /**
+ * Checks whether the property p is in the set of properties that can be iterated in a
+ * for..in statement applied to the XML object. Returns true only
+ * if toString(p) == "0".
+ *
+ * @param p The property that you want to check.
+ *
+ * @return If the property can be iterated in a for..in statement, true;
+ * otherwise, false.
+ *
+ * @includeExample examples\XML.propertyIsEnumerable.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.propertyIsEnumerable, propertyIsEnumerable
+ **/
+ public native function propertyIsEnumerable ( p:String ):Boolean;
+
+ /**
+ * Removes the given namespace for this object and all descendants. The removeNamespaces()
+ * method does not remove a namespace if it is referenced by the object's qualified name or the
+ * qualified name of the object's attributes.
+ *
+ * @param ns The namespace to remove.
+ *
+ * @return A copy of the resulting XML object.
+ *
+ * @includeExample examples\XML.removeNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.removeNamespace, removeNamespace
+ **/
+ public native function removeNamespace ( ns:Namespace ):XML;
+
+ /**
+ * Replaces the properties specified by the propertyName parameter
+ * with the given value parameter.
+ * If no properties match propertyName, the XML object is left unmodified.
+ *
+ * @param propertyName Can be a
+ * numeric value, an unqualified name for a set of XML elements, a qualified name for a set of
+ * XML elements, or the asterisk wildcard ("*").
+ * Use an unqualified name to identify XML elements in the default namespace.
+ *
+ * @param value The replacement value. This can be an XML object, an XMLList object, or any value
+ * that can be converted with toString().
+ *
+ * @return The resulting XML object, with the matching properties replaced.
+ *
+ * @includeExample examples\XML.replace.1.as -noswf
+ *
+ * @includeExample examples\XML.replace.2.as -noswf
+ *
+ * @includeExample examples\XML.replace.3.as -noswf
+ *
+ * @includeExample examples\XML.replace.4.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.replace, replace
+ **/
+ public native function replace ( propertyName:Object , value:XML ):XML
+
+ /**
+ * Replaces the child properties of the XML object with the specified set of XML properties,
+ * provided in the value parameter.
+ *
+ * @param value The replacement XML properties. Can be a single XML object or an XMLList object.
+ *
+ * @return The resulting XML object.
+ *
+ * @includeExample examples\XML.setChildren.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setChildren, setChildren
+ **/
+ public native function setChildren ( value:Object ):XML;
+
+ /**
+ * Changes the local name of the XML object to the given name parameter.
+ *
+ * @param name The replacement name for the local name.
+ *
+ * @includeExample examples\XML.setLocalName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setLocalName, setLocalName
+ **/
+ public native function setLocalName ( name:String ):void;
+
+ /**
+ * Sets the name of the XML object to the given qualified name or attribute name.
+ *
+ * @param name The new name for the object.
+ *
+ * @includeExample examples\XML.setName.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setName, setName
+ **/
+ public native function setName ( name:String ):void;
+
+ /**
+ * Sets the namespace associated with the XML object.
+ *
+ * @param ns The new namespace.
+ *
+ * @includeExample examples\XML.setNamespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.setNamespace, setNamespace
+ **/
+ public native function setNamespace ( ns:Namespace ):void;
+
+ /**
+ * Sets values for the following XML properties: ignoreComments,
+ * ignoreProcessingInstructions, ignoreWhitespace,
+ * prettyIndent, and prettyPrinting.
+ *
+ * The following are the default settings, which are applied if no setObj parameter
+ * is provided:
+ *
+ *
+ *
XML.ignoreComments = true
+ *
XML.ignoreProcessingInstructions = true
+ *
XML.ignoreWhitespace = true
+ *
XML.prettyIndent = 2
+ *
XML.prettyPrinting = true
+ *
+ *
+ *
Note: You do not apply this method to an instance of the XML class; you apply it to
+ * XML, as in the following code: XML.setSettings().
+ *
+ * @param rest An object with each of the following properties:
+ *
+ *
+ *
+ * @includeExample examples\XML.defaultSettings.1.as -noswf
+ *
+ * @see XML#ignoreComments
+ * @see XML#ignoreProcessingInstructions
+ * @see XML#ignoreWhitespace
+ * @see XML#prettyIndent
+ * @see XML#prettyPrinting
+ * @see XML#defaultSettings()
+ * @see XML#setSettings()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.settings, settings
+ **/
+ public native static function settings ():Object;
+
+ /**
+ * Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.
+ *
+ * @return The list of properties.
+ *
+ * @includeExample examples\XML.text.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.text, text
+ **/
+ public native function text ( ):XMLList;
+
+ /**
+ * Returns a string representation of the XML object. The rules for this conversion depend on whether
+ * the XML object has simple content or complex content:
+ *
+ *
+ *
If the XML object has simple content, toString() returns the String contents of the
+ * XML object with the following stripped out: the start tag, attributes, namespace declarations, and
+ * end tag.
+ *
+ *
+ *
+ *
If the XML object has complex content, toString() returns an XML encoded String
+ * representing the entire XML object, including the start tag, attributes, namespace declarations,
+ * and end tag.
+ *
+ *
+ *
To return the entire XML object every time, use toXMLString().
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XMLToStringExample1.as -noswf
+ * @includeExample examples\XMLToStringExample2.as -noswf
+ *
+ * @see XML#hasSimpleContent()
+ * @see XML#hasComplexContent()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toString, toString
+ *
+ **/
+ public native function toString():String;
+
+ /**
+ * Returns a string representation of the XML object. Unlike the toString() method,
+ * the toXMLString() method always returns the start tag, attributes,
+ * and end tag of the XML object, regardless of whether the XML object has simple content or complex
+ * content. (The toString() method strips out these items for XML objects that contain
+ * simple content.)
+ *
+ * @oldexample The following XML object has simple content:
+ *
+ * <item>wiper blade</item>
+ *
+ *
The toString() method for this object returns the following String:
+ *
<item>wiper blade</item>
+ *
+ *
+ *
+ * The following XML object has complex content:
+ *
+ * Note: The white space formatting of the returned String depends on the setting of the
+ * prettyPrintingproperty of the XML class. In this example, prettyPrinting
+ * is set to false.
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XML.toXMLString.1.as -noswf
+ *
+ * @see XML#toString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toXMLString, toXMLString
+ **/
+ public native function toXMLString ( ):String;
+
+ /**
+ * Returns the XML object.
+ *
+ * @return Returns the primitive value of an XML instance.
+ *
+ * @includeExample examples\XML.valueOf.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.valueOf, valueOf
+ **/
+ public native function valueOf ( ):XML;
+
+
+
+ /**
+ * Determines whether XML comments are ignored
+ * when XML objects parse the source XML data. By default, the comments are ignored
+ * (true). To include XML comments, set this property to false.
+ * The ignoreComments property is used only during the XML parsing, not during
+ * the call to any method such as myXMLObject.child(~~).toXMLString().
+ * If the source XML includes comment nodes, they are kept or discarded during the XML parsing.
+ *
+ * @includeExample examples\XML.ignoreComments.1.as -noswf
+ *
+ * @see XML#child()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreComments, ignoreComments
+ **/
+ public native static function get ignoreComments():Boolean;
+ public native static function set ignoreComments(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether XML
+ * processing instructions are ignored when XML objects parse the source XML data.
+ * By default, the processing instructions are ignored (true). To include XML
+ * processing instructions, set this property to false. The
+ * ignoreProcessingInstructions property is used only during the XML parsing,
+ * not during the call to any method such as myXMLObject.child(~~).toXMLString().
+ * If the source XML includes processing instructions nodes, they are kept or discarded during
+ * the XML parsing.
+ *
+ * @includeExample examples\XML.ignoreProcessingInstructions.1.as -noswf
+ *
+ * @see XML#child()
+ * @see XML#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreProcessingInstructions, ignoreProcessingInstructions
+ **/
+ public native static function get ignoreProcessingInstructions():Boolean;
+ public native static function set ignoreProcessingInstructions(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether white space characters
+ * at the beginning and end of text nodes are ignored during parsing. By default,
+ * white space is ignored (true). If a text node is 100% white space and the
+ * ignoreWhitespace property is set to true, then the node is not created.
+ * To show white space in a text node, set the ignoreWhitespace property to
+ * false.
+ *
+ * @includeExample examples\XML.ignoreWhitespace.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.ignoreWhitespace, ignoreWhitespace
+ **/
+ public native static function get ignoreWhitespace():Boolean;
+ public native static function set ignoreWhitespace(newIgnore:Boolean):void;
+
+ /**
+ * Determines whether the toString()
+ * and toXMLString() methods normalize white space characters between some tags.
+ * The default value is true.
+ *
+ * @includeExample examples\XML.prettyPrinting.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @see #prettyIndent
+ * @see #toString()
+ * @see #toXMLString()
+ * @keyword XML, XML.prettyPrinting, prettyPrinting
+ **/
+ public native static function get prettyPrinting():Boolean;
+ public native static function set prettyPrinting(newPretty:Boolean):void;
+
+ /**
+ * Determines the amount of indentation applied by
+ * the toString() and toXMLString() methods when
+ * the XML.prettyPrinting property is set to true.
+ * Indentation is applied with the space character, not the tab character.
+ *
+ * The default value is 2.
+ *
+ * @includeExample examples\XML.prettyIndent.1.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @see #prettyPrinting
+ * @see #toString()
+ * @see #toXMLString()
+ * @keyword XML, XML.prettyIndent, prettyIndent
+ **/
+ public native static function get prettyIndent():int;
+ public native static function set prettyIndent(newIndent:int):void;
+}
+}
+package {
+//
+// XMLList
+//
+// Based on the ECMA E4X Specification, 1st Edition.
+
+/**
+ * An XMLList object is an ordered collection of properties. An XMLList object represents an
+ * XML document, an XML fragment, or an arbitrary collection of XML objects.
+ *
+ *
An XMLList object with one XML element is treated the same as an XML object.
+ * When there is one XML element, all methods that are available
+ * for the XML object are also available for the XMLList object.
+ *
+ *
In the following example, example.two is an XMLList object of length 1,
+ * so you can call any XML method on it.
The following table lists the XML methods that are not included in the XMLList class, but
+ * that you can use when your XMLList object has only one XML element. If you attempt to use these
+ * methods with anything other than one XML element (zero or more than one
+ * element), an exception is thrown.
+ *
+ *
+ *
XML methods
+ *
addNamespace()
+ *
appendChild()
+ *
childIndex()
+ *
inScopeNamespace()
+ *
insertChildAFter()
+ *
insertChildBefore()
+ *
name()
+ *
namespace()
+ *
localName()
+ *
namespaceDeclarations()
+ *
nodeKind()
+ *
prependChild()
+ *
removeNamespace()
+ *
replace()
+ *
setChildren()
+ *
setLocalName()
+ *
setName()
+ *
setNamespace()
+ *
+ *
+ *
This class (along with the XML, Namespace, and QName classes) implements powerful XML-handling
+ * standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2).
+ *
+ * @includeExample examples\XMLListExample.as -noswf
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList
+ * @see XML
+ * @see Namespace
+ * @see QName
+ */
+
+public final dynamic class XMLList
+{
+ /**
+ * Creates a new XMLList object.
+ *
+ * @param value Any object that can be converted to an XMLList object by using the top-level XMLList() function.
+ *
+ * @return If no arguments are included, the constructor returns an empty XMLList. If an XMLList object is included as
+ * the parameter, the constructor returns a shallow copy of the XMLList object. If the parameter is an object of a type
+ * other than XMLList, the constructor converts the object to an XMLList object and returns that object.
+ *
+ * @see global#XMLList() top-level XMLList() function
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList
+ **/
+ public native function XMLList (value:Object);
+
+ /**
+ * Calls the attribute() method of each XML object and returns an XMLList object
+ * of the results. The results match the given attributeName parameter. If there is no
+ * match, the attribute() method returns an empty XMLList object.
+ *
+ * @param attributeName The name of the attribute that you want to include in an XMLList object.
+ *
+ * @return An XMLList object of matching XML objects or an empty XMLList object.
+ *
+ * @see XML#attribute()
+ * @see XML#attributes()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.attribute, attribute
+ **/
+ public native function attribute (attributeName:* ):XMLList;
+
+ /**
+ * Calls the attributes() method of each XML object and
+ * returns an XMLList object of attributes for each XML object.
+ *
+ * @return An XMLList object of attributes for each XML object.
+ *
+ * @see XML#attribute()
+ * @see XML#attributes()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.attributes, attributes
+ **/
+ public native function attributes ( ):XMLList;
+
+ /**
+ * Calls the child() method of each XML object and returns an XMLList object that
+ * contains the results in order.
+ *
+ * @param propertyName The element name or integer of the XML child.
+ *
+ * @return An XMLList object of child nodes that match the input parameter.
+ *
+ * @see XML#child()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.child, child
+ **/
+ public native function child ( propertyName:Object ):XMLList;
+
+ /**
+ * Calls the children() method of each XML object and
+ * returns an XMLList object that contains the results.
+ *
+ * @return An XMLList object of the children in the XML objects.
+ *
+ * @oldexample The following sets a variable to an XMLList of children of all the items in the catalog XMLList:
+ *
+ *
var allitemchildren:XMLList = catalog.item.children();
+
+ * @oldexample The following sets a variable to an XMLList of all grandchildren of all the items in the catalog XMLList that
+ * have the name size:
+ *
+ *
var grandchildren:XMLList = catalog.item.children().size;
+ *
+ * @see XML#children()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.children, children
+ **/
+ public native function children ( ):XMLList;
+
+ /**
+ * Calls the comments() method of each XML object and returns
+ * an XMLList of comments.
+ *
+ * @return An XMLList of the comments in the XML objects.
+ *
+ * @see XML#comments()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.comments, comments
+ **/
+ public native function comments ( ):XMLList;
+
+ /**
+ * Checks whether the XMLList object contains an XML object that is equal to the given
+ * value parameter.
+ *
+ * @param value An XML object to compare against the current XMLList object.
+ *
+ * @return If the XMLList contains the XML object declared in the value parameter,
+ * then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.contains, contains
+ **/
+ public native function contains ( value:XML ):Boolean;
+
+ /**
+ * Returns a copy of the given XMLList object. The copy is a duplicate of the entire tree of nodes.
+ * The copied XML object has no parent and returns null if you attempt to call the parent() method.
+ *
+ * @return The copy of the XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.copy, copy
+ **/
+ public native function copy ( ):XMLList;
+
+ /**
+ * Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object
+ * that have the given name parameter. The name parameter can be a
+ * QName object, a String data type, or any other data type that is then converted to a String
+ * data type.
+ *
+ *
To return all descendants, use
+ * the asterisk (~~) parameter. If no parameter is passed,
+ * the string "~~" is passed and returns all descendants of the XML object.
+ *
+ * @return An XMLList object of the matching descendants (children, grandchildren, and so on) of the XML objects
+ * in the original list. If there are no descendants, returns an empty XMLList object.
+ *
+ * @param name The name of the element to match.
+ *
+ * @see XML#descendants()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.descendants, descendants
+ **/
+ public native function descendants (name:Object="*"):XMLList;
+
+ /**
+ * Calls the elements() method of each XML object. The name parameter is
+ * passed to the descendants() method. If no parameter is passed, the string "~~" is passed to the
+ * descendants() method.
+ *
+ * @param name The name of the elements to match.
+ *
+ * @return An XMLList object of the matching child elements of the XML objects.
+ *
+ * @see XML#elements()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.elements, elements
+ **/
+ public native function elements (name:Object="*"):XMLList;
+
+ /**
+ * Checks for the property specified by p.
+ *
+ * @param p The property to match.
+ *
+ * @return If the parameter exists, then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasOwnProperty, hasOwnProperty
+ **/
+ public native function hasOwnProperty(p:String):Boolean;
+
+ /**
+ * Checks whether the XMLList object contains complex content. An XMLList object is
+ * considered to contain complex content if it is not empty and either of the following conditions is true:
+ *
+ *
+ *
The XMLList object contains a single XML item with complex content.
+ *
The XMLList object contains elements.
+ *
+ *
+ * @return If the XMLList object contains complex content, then true; otherwise false.
+ *
+ * @see XML#hasComplexContent()
+ * @see XML#hasSimpleContent()
+ * @see #hasSimpleContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasComplexContent, hasComplexContent
+ **/
+ public native function hasComplexContent( ):Boolean;
+
+ /**
+ * Checks whether the XMLList object contains simple content. An XMLList object is
+ * considered to contain simple content if one or more of the following
+ * conditions is true:
+ *
+ *
The XMLList object is empty
+ *
The XMLList object contains a single XML item with simple content
+ *
The XMLList object contains no elements
+ *
+ *
+ * @return If the XMLList contains simple content, then true; otherwise false.
+ *
+ * @see XML#hasComplexContent()
+ * @see XML#hasSimpleContent()
+ * @see #hasComplexContent()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.hasSimpleContent, hasSimpleContent
+ **/
+ public native function hasSimpleContent( ):Boolean;
+
+ /**
+ * Returns the number of properties in the XMLList object.
+ *
+ * @return The number of properties in the XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.length, length
+ **/
+ public native function length ( ):int;
+
+ /**
+ * Merges adjacent text nodes and eliminates empty text nodes for each
+ * of the following: all text nodes in the XMLList, all the XML objects
+ * contained in the XMLList, and the descendants of all the XML objects in
+ * the XMLList.
+ *
+ * @return The normalized XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.normalize, normalize
+ **/
+ public native function normalize ( ):XMLList;
+
+ /**
+ * Returns the parent of the XMLList object if all items in the XMLList object have the same parent.
+ * If the XMLList object has no parent or different parents, the method returns undefined.
+ *
+ * @return Returns the parent XML object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.parent, parent
+ **/
+ public native function parent ( ):Object;
+
+ /**
+ * If a name parameter is provided, lists all the children of the XMLList object that
+ * contain processing instructions with that name. With no parameters, the method lists all the
+ * children of the XMLList object that contain any processing instructions.
+ *
+ * @param name The name of the processing instructions to match.
+ *
+ * @return An XMLList object that contains the processing instructions for each XML object.
+ *
+ * @see XML#processingInstructions()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.processingInstructions, processingInstructions
+ **/
+ public native function processingInstructions ( name:String = "*"):XMLList;
+
+ /**
+ * Checks whether the property p is in the set of properties that can be iterated in a for..in statement
+ * applied to the XMLList object. This is true only if toNumber(p) is greater than or equal to 0
+ * and less than the length of the XMLList object.
+ *
+ * @param p The index of a property to check.
+ *
+ * @return If the property can be iterated in a for..in statement, then true; otherwise false.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.propertyIsEnumerable, propertyIsEnumerable
+ **/
+ public native function propertyIsEnumerable ( p:String ):Boolean;
+
+ /**
+ * Calls the text() method of each XML
+ * object and returns an XMLList object that contains the results.
+ *
+ * @return An XMLList object of all XML properties of the XMLList object that represent XML text nodes.
+ *
+ * @see XML#text()
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.text, text
+ **/
+ public native function text ( ):XMLList;
+
+ /**
+ * Returns a string representation of all the XML objects in an XMLList object. The rules for
+ * this conversion depend on whether the XML object has simple content or complex content:
+ *
+ *
+ *
If the XML object has simple content, toString() returns the string contents of the
+ * XML object with the following stripped out: the start tag, attributes, namespace declarations, and
+ * end tag.
+ *
+ *
+ *
+ *
If the XML object has complex content, toString() returns an XML encoded string
+ * representing the entire XML object, including the start tag, attributes, namespace declarations,
+ * and end tag.
+ *
+ *
+ *
To return the entire XML object every time, use the toXMLString() method.
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @includeExample examples\XMLToStringExample1.as -noswf
+ * @includeExample examples\XMLToStringExample2.as -noswf
+ *
+ * @see XMLList#hasSimpleContent()
+ * @see XMLList#hasComplexContent()
+ * @see XMLList#toXMLString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toString, toString
+ *
+ **/
+ public native function toString( ):String;
+
+ /**
+ * Returns a string representation of all the XML objects in an XMLList object.
+ * Unlike the toString() method, the toXMLString()
+ * method always returns the start tag, attributes,
+ * and end tag of the XML object, regardless of whether the XML object has simple content
+ * or complex content. (The toString() method strips out these items for XML
+ * objects that contain simple content.)
+ *
+ *
+ * @return The string representation of the XML object.
+ *
+ * @see XMLList#toString()
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XML, XML.toXMLString, toXMLString
+ **/
+ public native function toXMLString( ):String;
+
+ /**
+ * Returns the XMLList object.
+ *
+ * @return Returns the current XMLList object.
+ *
+ * @playerversion Flash 9
+ * @langversion 3.0
+ * @helpid
+ * @refpath
+ * @keyword XMLList, XMLList.valueOf, valueOf
+ **/
+ public native function valueOf( ):XMLList;
+
+}
+}
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/OpenPyroExample.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/OpenPyroExample.cache
new file mode 100644
index 0000000..f8e8ad3
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/OpenPyroExample.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache
new file mode 100644
index 0000000..c9f1d8e
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/namespaceManifests.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache
new file mode 100644
index 0000000..679cb56
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/common/projectUnits.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_CIM_logging_1.4.swc_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_CIM_logging_1.4.swc_0.cache
new file mode 100644
index 0000000..6552c6b
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_CIM_logging_1.4.swc_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_TweenMax.swc_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_TweenMax.swc_0.cache
new file mode 100644
index 0000000..00dc47b
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_TweenMax.swc_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache
new file mode 100644
index 0000000..7fad70b
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_flex.swc_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache
new file mode 100644
index 0000000..dddaefd
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_playerglobal.swc_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache
new file mode 100644
index 0000000..d586ff0
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/library_utilities.swc_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache
new file mode 100644
index 0000000..ee53130
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_extraClassPath_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache
new file mode 100644
index 0000000..6f797d4
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_0.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_1.cache b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_1.cache
new file mode 100644
index 0000000..844f41b
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/projects/projectUnits/source_src_1.cache differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments.gen differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1 b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1
new file mode 100644
index 0000000..7cd435f
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/segments_1 differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/write.lock b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/ASReferenceIndex.index/write.lock
new file mode 100644
index 0000000..e69de29
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments.gen differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1 b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1
new file mode 100644
index 0000000..7befade
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/segments_1 differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/write.lock b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/CSSIndex.index/write.lock
new file mode 100644
index 0000000..e69de29
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..63a7ec9
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments.gen differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1 b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1
new file mode 100644
index 0000000..d9bf509
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/segments_1 differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/write.lock b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/MXMLReferenceIndex.index/write.lock
new file mode 100644
index 0000000..e69de29
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen
new file mode 100644
index 0000000..225a55b
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments.gen differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2 b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2
new file mode 100644
index 0000000..dc125e8
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/segments_2 differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/write.lock b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/SWCReferenceIndex.index/write.lock
new file mode 100644
index 0000000..e69de29
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml
new file mode 100644
index 0000000..d798bc4
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.codemodel/searchCache/catalog.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml
new file mode 100644
index 0000000..5ca0b77
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.actionscript/dialog_settings.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml
new file mode 100644
index 0000000..4d25e6b
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.editors.common/dialog_settings.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExample/metadata.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExample/metadata.xml
new file mode 100644
index 0000000..1ecc591
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/.projects/OpenPyroExample/metadata.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/history.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..587fd51
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection-with-history/index.template.html
@@ -0,0 +1,80 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html
new file mode 100644
index 0000000..0540f73
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/client-side-detection/index.template.html
@@ -0,0 +1,77 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/history.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..3c046a7
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/index.template.html
@@ -0,0 +1,107 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation-with-history/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html
new file mode 100644
index 0000000..cb89d8c
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/index.template.html
@@ -0,0 +1,104 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/express-installation/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm
new file mode 100644
index 0000000..be404f3
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js
new file mode 100644
index 0000000..7d37ea6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.js
@@ -0,0 +1,48 @@
+// $Revision: 1.49 $
+// Vars
+Vars = function(qStr) {
+ this.numVars = 0;
+ if(qStr != null) {
+ var nameValue, name;
+ var pairs = qStr.split('&');
+ var pairLen = pairs.length;
+ for(var i = 0; i < pairLen; i++) {
+ var pair = pairs[i];
+ if( (pair.indexOf('=')!= -1) && (pair.length > 3) ) {
+ var nameValue = pair.split('=');
+ var name = nameValue[0];
+ var value = nameValue[1];
+ if(this[name] == null && name.length > 0 && value.length > 0) {
+ this[name] = value;
+ this.numVars++;
+ }
+ }
+ }
+ }
+}
+Vars.prototype.toString = function(pre) {
+ var result = '';
+ if(pre == null) { pre = ''; }
+ for(var i in this) {
+ if(this[i] != null && typeof(this[i]) != 'object' && typeof(this[i]) != 'function' && i != 'numVars') {
+ result += pre + i + '=' + this[i] + '&';
+ }
+ }
+ if(result.length > 0) result = result.substr(0, result.length-1);
+ return result;
+}
+function getSearch(wRef) {
+ var searchStr = '';
+ if(wRef.location.search.length > 1) {
+ searchStr = new String(wRef.location.search);
+ searchStr = searchStr.substring(1, searchStr.length);
+ }
+ return searchStr;
+}
+var lc_id = Math.floor(Math.random() * 100000).toString(16);
+if (this != top)
+{
+ top.Vars = Vars;
+ top.getSearch = getSearch;
+ top.lc_id = lc_id;
+}
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf
new file mode 100644
index 0000000..e6e03ec
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/history.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..ffb8e68
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection-with-history/index.template.html
@@ -0,0 +1,53 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..6482d16
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/AC_OETags.js
@@ -0,0 +1,269 @@
+// Flash Player Version Detection - Rev 1.5
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ if ( descArray[3] != "" ) {
+ tempArrayMinor = descArray[3].split("r");
+ } else {
+ tempArrayMinor = descArray[4].split("r");
+ }
+ var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ if (src.indexOf('?') != -1)
+ return src.replace(/\?/, ext+'?');
+ else
+ return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html
new file mode 100644
index 0000000..d6cec74
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 2.0.1/no-player-detection/index.template.html
@@ -0,0 +1,50 @@
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd
new file mode 100644
index 0000000..88f8b27
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.1.xsd
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd
new file mode 100644
index 0000000..24d2235
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/Descriptor.1.5.xsd
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml
new file mode 100644
index 0000000..b19d93f
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/air/descriptor-template.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ v1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html
new file mode 100644
index 0000000..6de8d75
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/RunTimeLoading.html
@@ -0,0 +1,54 @@
+
+
+
+
+FlexApp
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat
new file mode 100644
index 0000000..c600a4f
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/build.bat
@@ -0,0 +1,3 @@
+SET OPTS=-include-libraries+=..\..\frameworks\libs\automation.swc;..\..\frameworks\libs\automation_agent.swc;..\..\frameworks\libs\automation_dmv.swc;..\..\frameworks\libs\automation_flashflexkit.swc;..\..\frameworks\libs\qtp.swc
+
+..\..\bin\mxmlc.exe %OPTS% runtimeloading.mxml
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml
new file mode 100644
index 0000000..03af971
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/automation-runtimeloading-files/runtimeloading.mxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..50fcbb3
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection-with-history/index.template.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html
new file mode 100644
index 0000000..a1dc36b
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/client-side-detection/index.template.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..20ee809
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/index.template.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation-with-history/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html
new file mode 100644
index 0000000..bb1f7ed
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/index.template.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/express-installation/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css
new file mode 100644
index 0000000..dbc47c6
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js
new file mode 100644
index 0000000..3279a53
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..07e3806
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..7ac650d
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection-with-history/index.template.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html
new file mode 100644
index 0000000..d16ac8c
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex 3.2/no-player-detection/index.template.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd
new file mode 100644
index 0000000..94b0d99
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.1.xsd
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd
new file mode 100644
index 0000000..d932f99
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/Descriptor.1.5.xsd
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml
new file mode 100644
index 0000000..e389ad8
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/air/descriptor-template.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ v1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html
new file mode 100644
index 0000000..8af9492
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection-with-history/index.template.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html
new file mode 100644
index 0000000..1c5ce79
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/client-side-detection/index.template.html
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html
new file mode 100644
index 0000000..a8b3b64
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/index.template.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation-with-history/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html
new file mode 100644
index 0000000..3cf5fc4
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/index.template.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf
new file mode 100644
index 0000000..bdc3437
Binary files /dev/null and b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/express-installation/playerProductInstall.swf differ
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css
new file mode 100644
index 0000000..664ea26
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.css
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js
new file mode 100644
index 0000000..8ba2d51
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/history.js
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+ addEvent: function(elm, evType, fn, useCapture) {
+ useCapture = useCapture || false;
+ if (elm.addEventListener) {
+ elm.addEventListener(evType, fn, useCapture);
+ return true;
+ }
+ else if (elm.attachEvent) {
+ var r = elm.attachEvent('on' + evType, fn);
+ return r;
+ }
+ else {
+ elm['on' + evType] = fn;
+ }
+ }
+}
+
+BrowserHistory = (function() {
+ // type of browser
+ var browser = {
+ ie: false,
+ firefox: false,
+ safari: false,
+ opera: false,
+ version: -1
+ };
+
+ // if setDefaultURL has been called, our first clue
+ // that the SWF is ready and listening
+ //var swfReady = false;
+
+ // the URL we'll send to the SWF once it is ready
+ //var pendingURL = '';
+
+ // Default app state URL to use when no fragment ID present
+ var defaultHash = '';
+
+ // Last-known app state URL
+ var currentHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHref = document.location.href;
+
+ // Initial URL (used only by IE)
+ var initialHash = document.location.hash;
+
+ // History frame source URL prefix (used only by IE)
+ var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+ // History maintenance (used only by Safari)
+ var currentHistoryLength = -1;
+
+ var historyHash = [];
+
+ var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+ var backStack = [];
+ var forwardStack = [];
+
+ var currentObjectId = null;
+
+ //UserAgent detection
+ var useragent = navigator.userAgent.toLowerCase();
+
+ if (useragent.indexOf("opera") != -1) {
+ browser.opera = true;
+ } else if (useragent.indexOf("msie") != -1) {
+ browser.ie = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+ } else if (useragent.indexOf("safari") != -1) {
+ browser.safari = true;
+ browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+ } else if (useragent.indexOf("gecko") != -1) {
+ browser.firefox = true;
+ }
+
+ if (browser.ie == true && browser.version == 7) {
+ window["_ie_firstload"] = false;
+ }
+
+ // Accessor functions for obtaining specific elements of the page.
+ function getHistoryFrame()
+ {
+ return document.getElementById('ie_historyFrame');
+ }
+
+ function getAnchorElement()
+ {
+ return document.getElementById('firefox_anchorDiv');
+ }
+
+ function getFormElement()
+ {
+ return document.getElementById('safari_formDiv');
+ }
+
+ function getRememberElement()
+ {
+ return document.getElementById("safari_remember_field");
+ }
+
+ // Get the Flash player object for performing ExternalInterface callbacks.
+ // Updated for changes to SWFObject2.
+ function getPlayer(id) {
+ if (id && document.getElementById(id)) {
+ var r = document.getElementById(id);
+ if (typeof r.SetVariable != "undefined") {
+ return r;
+ }
+ else {
+ var o = r.getElementsByTagName("object");
+ var e = r.getElementsByTagName("embed");
+ if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ }
+ }
+ else {
+ var o = document.getElementsByTagName("object");
+ var e = document.getElementsByTagName("embed");
+ if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+ return e[0];
+ }
+ else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+ return o[0];
+ }
+ else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+ return o[1];
+ }
+ }
+ return undefined;
+ }
+
+ function getPlayers() {
+ var players = [];
+ if (players.length == 0) {
+ var tmp = document.getElementsByTagName('object');
+ players = tmp;
+ }
+
+ if (players.length == 0 || players[0].object == null) {
+ var tmp = document.getElementsByTagName('embed');
+ players = tmp;
+ }
+ return players;
+ }
+
+ function getIframeHash() {
+ var doc = getHistoryFrame().contentWindow.document;
+ var hash = String(doc.location.search);
+ if (hash.length == 1 && hash.charAt(0) == "?") {
+ hash = "";
+ }
+ else if (hash.length >= 2 && hash.charAt(0) == "?") {
+ hash = hash.substring(1);
+ }
+ return hash;
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function getHash() {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ var idx = document.location.href.indexOf('#');
+ return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+ }
+
+ /* Get the current location hash excluding the '#' symbol. */
+ function setHash(hash) {
+ // It would be nice if we could use document.location.hash here,
+ // but it's faulty sometimes.
+ if (hash == '') hash = '#'
+ document.location.hash = hash;
+ }
+
+ function createState(baseUrl, newUrl, flexAppUrl) {
+ return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+ }
+
+ /* Add a history entry to the browser.
+ * baseUrl: the portion of the location prior to the '#'
+ * newUrl: the entire new URL, including '#' and following fragment
+ * flexAppUrl: the portion of the location following the '#' only
+ */
+ function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+ //delete all the history entries
+ forwardStack = [];
+
+ if (browser.ie) {
+ //Check to see if we are being asked to do a navigate for the first
+ //history entry, and if so ignore, because it's coming from the creation
+ //of the history iframe
+ if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+ currentHref = initialHref;
+ return;
+ }
+ if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+ newUrl = baseUrl + '#' + defaultHash;
+ flexAppUrl = defaultHash;
+ } else {
+ // for IE, tell the history frame to go somewhere without a '#'
+ // in order to get this entry into the browser history.
+ getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+ }
+ setHash(flexAppUrl);
+ } else {
+
+ //ADR
+ if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+ initialState = createState(baseUrl, newUrl, flexAppUrl);
+ } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+ backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+ }
+
+ if (browser.safari) {
+ // for Safari, submit a form whose action points to the desired URL
+ if (browser.version <= 419.3) {
+ var file = window.location.pathname.toString();
+ file = file.substring(file.lastIndexOf("/")+1);
+ getFormElement().innerHTML = '';
+ //get the current elements and add them to the form
+ var qs = window.location.search.substring(1);
+ var qs_arr = qs.split("&");
+ for (var i = 0; i < qs_arr.length; i++) {
+ var tmp = qs_arr[i].split("=");
+ var elem = document.createElement("input");
+ elem.type = "hidden";
+ elem.name = tmp[0];
+ elem.value = tmp[1];
+ document.forms.historyForm.appendChild(elem);
+ }
+ document.forms.historyForm.submit();
+ } else {
+ top.location.hash = flexAppUrl;
+ }
+ // We also have to maintain the history by hand for Safari
+ historyHash[history.length] = flexAppUrl;
+ _storeStates();
+ } else {
+ // Otherwise, write an anchor into the page and tell the browser to go there
+ addAnchor(flexAppUrl);
+ setHash(flexAppUrl);
+ }
+ }
+ backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+ }
+
+ function _storeStates() {
+ if (browser.safari) {
+ getRememberElement().value = historyHash.join(",");
+ }
+ }
+
+ function handleBackButton() {
+ //The "current" page is always at the top of the history stack.
+ var current = backStack.pop();
+ if (!current) { return; }
+ var last = backStack[backStack.length - 1];
+ if (!last && backStack.length == 0){
+ last = initialState;
+ }
+ forwardStack.push(current);
+ }
+
+ function handleForwardButton() {
+ //summary: private method. Do not call this directly.
+
+ var last = forwardStack.pop();
+ if (!last) { return; }
+ backStack.push(last);
+ }
+
+ function handleArbitraryUrl() {
+ //delete all the history entries
+ forwardStack = [];
+ }
+
+ /* Called periodically to poll to see if we need to detect navigation that has occurred */
+ function checkForUrlChange() {
+
+ if (browser.ie) {
+ if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+ //This occurs when the user has navigated to a specific URL
+ //within the app, and didn't use browser back/forward
+ //IE seems to have a bug where it stops updating the URL it
+ //shows the end-user at this point, but programatically it
+ //appears to be correct. Do a full app reload to get around
+ //this issue.
+ if (browser.version < 7) {
+ currentHref = document.location.href;
+ document.location.reload();
+ } else {
+ if (getHash() != getIframeHash()) {
+ // this.iframe.src = this.blankURL + hash;
+ var sourceToSet = historyFrameSourcePrefix + getHash();
+ getHistoryFrame().src = sourceToSet;
+ }
+ }
+ }
+ }
+
+ if (browser.safari) {
+ // For Safari, we have to check to see if history.length changed.
+ if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+ //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+ // If it did change, then we have to look the old state up
+ // in our hand-maintained array since document.location.hash
+ // won't have changed, then call back into BrowserManager.
+ currentHistoryLength = history.length;
+ var flexAppUrl = historyHash[currentHistoryLength];
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ _storeStates();
+ }
+ }
+ if (browser.firefox) {
+ if (currentHref != document.location.href) {
+ var bsl = backStack.length;
+
+ var urlActions = {
+ back: false,
+ forward: false,
+ set: false
+ }
+
+ if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+ urlActions.back = true;
+ // FIXME: could this ever be a forward button?
+ // we can't clear it because we still need to check for forwards. Ugg.
+ // clearInterval(this.locationTimer);
+ handleBackButton();
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if (forwardStack.length > 0) {
+ if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+ urlActions.forward = true;
+ handleForwardButton();
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if ((bsl >= 2) && (backStack[bsl - 2])) {
+ if (backStack[bsl - 2].flexAppUrl == getHash()) {
+ urlActions.back = true;
+ handleBackButton();
+ }
+ }
+
+ if (!urlActions.back && !urlActions.forward) {
+ var foundInStacks = {
+ back: -1,
+ forward: -1
+ }
+
+ for (var i = 0; i < backStack.length; i++) {
+ if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.back = i;
+ }
+ }
+ for (var i = 0; i < forwardStack.length; i++) {
+ if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+ arbitraryUrl = true;
+ foundInStacks.forward = i;
+ }
+ }
+ handleArbitraryUrl();
+ }
+
+ // Firefox changed; do a callback into BrowserManager to tell it.
+ currentHref = document.location.href;
+ var flexAppUrl = getHash();
+ if (flexAppUrl == '') {
+ //flexAppUrl = defaultHash;
+ }
+ //ADR: to fix multiple
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ pl[i].browserURLChange(flexAppUrl);
+ }
+ } else {
+ getPlayer().browserURLChange(flexAppUrl);
+ }
+ }
+ }
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+ function addAnchor(flexAppUrl)
+ {
+ if (document.getElementsByName(flexAppUrl).length == 0) {
+ getAnchorElement().innerHTML += "" + flexAppUrl + "";
+ }
+ }
+
+ var _initialize = function () {
+ if (browser.ie)
+ {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+ }
+ }
+ historyFrameSourcePrefix = iframe_location + "?";
+ var src = historyFrameSourcePrefix;
+
+ var iframe = document.createElement("iframe");
+ iframe.id = 'ie_historyFrame';
+ iframe.name = 'ie_historyFrame';
+ //iframe.src = historyFrameSourcePrefix;
+ try {
+ document.body.appendChild(iframe);
+ } catch(e) {
+ setTimeout(function() {
+ document.body.appendChild(iframe);
+ }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ var rememberDiv = document.createElement("div");
+ rememberDiv.id = 'safari_rememberDiv';
+ document.body.appendChild(rememberDiv);
+ rememberDiv.innerHTML = '';
+
+ var formDiv = document.createElement("div");
+ formDiv.id = 'safari_formDiv';
+ document.body.appendChild(formDiv);
+
+ var reloader_content = document.createElement('div');
+ reloader_content.id = 'safarireloader';
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0, s; s = scripts[i]; i++) {
+ if (s.src.indexOf("history.js") > -1) {
+ html = (new String(s.src)).replace(".js", ".html");
+ }
+ }
+ reloader_content.innerHTML = '';
+ document.body.appendChild(reloader_content);
+ reloader_content.style.position = 'absolute';
+ reloader_content.style.left = reloader_content.style.top = '-9999px';
+ iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+ if (document.getElementById("safari_remember_field").value != "" ) {
+ historyHash = document.getElementById("safari_remember_field").value.split(",");
+ }
+
+ }
+
+ if (browser.firefox)
+ {
+ var anchorDiv = document.createElement("div");
+ anchorDiv.id = 'firefox_anchorDiv';
+ document.body.appendChild(anchorDiv);
+ }
+
+ //setTimeout(checkForUrlChange, 50);
+ }
+
+ return {
+ historyHash: historyHash,
+ backStack: function() { return backStack; },
+ forwardStack: function() { return forwardStack },
+ getPlayer: getPlayer,
+ initialize: function(src) {
+ _initialize(src);
+ },
+ setURL: function(url) {
+ document.location.href = url;
+ },
+ getURL: function() {
+ return document.location.href;
+ },
+ getTitle: function() {
+ return document.title;
+ },
+ setTitle: function(title) {
+ try {
+ backStack[backStack.length - 1].title = title;
+ } catch(e) { }
+ //if on safari, set the title to be the empty string.
+ if (browser.safari) {
+ if (title == "") {
+ try {
+ var tmp = window.location.href.toString();
+ title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+ } catch(e) {
+ title = "";
+ }
+ }
+ }
+ document.title = title;
+ },
+ setDefaultURL: function(def)
+ {
+ defaultHash = def;
+ def = getHash();
+ //trailing ? is important else an extra frame gets added to the history
+ //when navigating back to the first page. Alternatively could check
+ //in history frame navigation to compare # and ?.
+ if (browser.ie)
+ {
+ window['_ie_firstload'] = true;
+ var sourceToSet = historyFrameSourcePrefix + def;
+ var func = function() {
+ getHistoryFrame().src = sourceToSet;
+ window.location.replace("#" + def);
+ setInterval(checkForUrlChange, 50);
+ }
+ try {
+ func();
+ } catch(e) {
+ window.setTimeout(function() { func(); }, 0);
+ }
+ }
+
+ if (browser.safari)
+ {
+ currentHistoryLength = history.length;
+ if (historyHash.length == 0) {
+ historyHash[currentHistoryLength] = def;
+ var newloc = "#" + def;
+ window.location.replace(newloc);
+ } else {
+ //alert(historyHash[historyHash.length-1]);
+ }
+ //setHash(def);
+ setInterval(checkForUrlChange, 50);
+ }
+
+
+ if (browser.firefox || browser.opera)
+ {
+ var reg = new RegExp("#" + def + "$");
+ if (window.location.toString().match(reg)) {
+ } else {
+ var newloc ="#" + def;
+ window.location.replace(newloc);
+ }
+ setInterval(checkForUrlChange, 50);
+ //setHash(def);
+ }
+
+ },
+
+ /* Set the current browser URL; called from inside BrowserManager to propagate
+ * the application state out to the container.
+ */
+ setBrowserURL: function(flexAppUrl, objectId) {
+ if (browser.ie && typeof objectId != "undefined") {
+ currentObjectId = objectId;
+ }
+ //fromIframe = fromIframe || false;
+ //fromFlex = fromFlex || false;
+ //alert("setBrowserURL: " + flexAppUrl);
+ //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+ var pos = document.location.href.indexOf('#');
+ var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+ var newUrl = baseUrl + '#' + flexAppUrl;
+
+ if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+ currentHref = newUrl;
+ addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+ currentHistoryLength = history.length;
+ }
+
+ return false;
+ },
+
+ browserURLChange: function(flexAppUrl) {
+ var objectId = null;
+ if (browser.ie && currentObjectId != null) {
+ objectId = currentObjectId;
+ }
+ pendingURL = '';
+
+ if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+ var pl = getPlayers();
+ for (var i = 0; i < pl.length; i++) {
+ try {
+ pl[i].browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+ } else {
+ try {
+ getPlayer(objectId).browserURLChange(flexAppUrl);
+ } catch(e) { }
+ }
+
+ currentObjectId = null;
+ }
+
+ }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+ document.location.href = url;
+}
+
+function backButton()
+{
+ history.back();
+}
+
+function forwardButton()
+{
+ history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+ history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+ var u =navigator.userAgent;var e=/*@cc_on!@*/false;
+ var st = setTimeout;
+ if(/webkit/i.test(u)){
+ st(function(){
+ var dr=document.readyState;
+ if(dr=="loaded"||dr=="complete"){i()}
+ else{st(arguments.callee,10);}},10);
+ } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+ document.addEventListener("DOMContentLoaded",i,false);
+ } else if(e){
+ (function(){
+ var t=document.createElement('doc:rdy');
+ try{t.doScroll('left');
+ i();t=null;
+ }catch(e){st(arguments.callee,0);}})();
+ } else{
+ window.onload=i;
+ }
+})( function() {BrowserHistory.initialize();} );
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html
new file mode 100644
index 0000000..aebb8d8
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/history/historyFrame.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Hidden frame for Browser History support.
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html
new file mode 100644
index 0000000..13a33b7
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection-with-history/index.template.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js
new file mode 100644
index 0000000..ba5d24a
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html
new file mode 100644
index 0000000..0885430
--- /dev/null
+++ b/examples/.metadata/.plugins/com.adobe.flexbuilder.project/html-templates/Flex Builder Default/no-player-detection/index.template.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+${title}
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/10cd582fc211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/10cd582fc211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..86f98c0
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/10cd582fc211001e1d7df1eab75b47a2
@@ -0,0 +1,338 @@
+package
+{
+ import org.openPyro.aurora.AuroraContainerSkin;
+ import org.openPyro.controls.List;
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.core.*;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.layout.*;
+ import org.openPyro.painters.FillPainter;
+ import org.openPyro.painters.GradientFillPainter;
+ import org.openPyro.utils.GlobalTimer;
+ import org.openPyro.examples.HaloTrackSkin;
+ import org.openPyroExamples.SimpleButtonSkin;
+
+ import flash.display.Sprite;
+ import flash.events.*;
+
+ import net.comcast.logging.Logger;
+ import net.comcast.logging.consoles.LogBookConsole;
+
+ [SWF(frameRate="30", backgroundColor="#8899aa")]
+ public class TestList extends Sprite
+ {
+
+ private var list:List;
+ private var container:UIContainer;
+
+ public function TestList()
+ {
+ stage.scaleMode = "noScale"
+ stage.align = "TL"
+
+ Logger.addConsole(new LogBookConsole('_test'))
+ Logger.debug(this, "Init")
+
+ //testSimpleChildren()
+ //testSimpleScroll()
+ testListInLayout()
+
+ stage.addEventListener(Event.RESIZE, onStageResize)
+ var globalTimer:GlobalTimer = new GlobalTimer(stage);
+ globalTimer.start()
+
+ stage.addEventListener(MouseEvent.CLICK, onStageClick);
+ }
+
+ private function onStageClick(event:MouseEvent):void
+ {
+ }
+
+ private function testSimpleScroll():void{
+
+ container = new UIContainer();
+ container.name = "rootContainer";
+ container.addEventListener(PyroEvent.UPDATE_COMPLETE,onContainerUpdate);
+ container.width = stage.stageWidth/3
+ container.height = stage.stageHeight/3;
+ addChild(container);
+ container.backgroundPainter = new FillPainter(0xcccccc)
+ container.skin = new AuroraContainerSkin();
+ //createScrollBarFromStyle2();
+
+
+ container.x = 100
+ container.y = 100;
+
+ var spacer:UIControl = new UIControl();
+ spacer.setSize(800,400)
+ spacer.backgroundPainter = new FillPainter(0xff0000);
+ container.addChild(spacer);
+
+ }
+
+ private var uic:UIControl
+ private function testSimpleChildren():void{
+ uic = new UIControl()
+ uic.name = "uic1"
+ uic.backgroundPainter = new FillPainter(0xcdcdcd);
+ this.uic.width = stage.stageWidth/4;
+ this.uic.height = stage.stageHeight/4;
+ addChild(uic)
+
+
+ uic.x = uic.y = 100;
+
+ var uic2:UIControl = new UIControl()
+ uic2.name = "uic2"
+ uic2.backgroundPainter = new FillPainter(0x00ff00);
+ uic2.percentUnusedWidth = 50
+ uic2.percentUnusedHeight = 50;
+ uic.addChild(uic2)
+
+ uic.addEventListener(PyroEvent.UPDATE_COMPLETE, onContainerUpdate);
+ }
+
+ private var s1:UIControl
+ private var s2:UIControl;
+ private function testListInLayout():void
+ {
+ createList()
+ createContainer();
+
+
+ container.addChild(list);
+ s1 = createShape(0xff0000);
+ container.addChild(s1);
+ //stage.addEventListener(MouseEvent.CLICK, onMouseClick);
+
+ s2 = createShape(0x00ff00);
+ s2.name = "green";
+ container.addChild(s2);
+
+ //container.validateSize()
+ container.layout = new HLayout(0);
+ }
+
+ private function onMouseClick(event:Event):void
+ {
+ stage.removeEventListener(MouseEvent.CLICK, onMouseClick);
+ var s1:UIControl = new UIControl()
+ s1.backgroundPainter = new GradientFillPainter([0xff0000,0x0000ff])
+ s1.width = container.width+100
+ s1.height = container.height+100
+ s1.name = "red"
+ container.addChild(s1);
+
+ stage.dispatchEvent(new Event(Event.RESIZE));
+ }
+
+ private function createContainer():void{
+ container = new UIContainer();
+ container.name = "rootContainer";
+ container.addEventListener(PyroEvent.UPDATE_COMPLETE,onContainerUpdate);
+ container.width = stage.stageWidth/3;
+ container.height = stage.stageHeight/3;
+ addChild(container);
+ container.backgroundPainter = new FillPainter(0xcccccc)
+ container.skin = new AuroraContainerSkin();
+ //createScrollBarFromStyle2();
+
+
+ container.x = 100
+ container.y = 100;
+
+
+
+ }
+
+ private function onContainerUpdate(event:PyroEvent):void
+ {
+// trace("[container]"+container.height, container.measuredHeight)
+ /*
+ trace("Container w/h : "+container.width, container.height)
+ if(list){
+ trace("list w/h: ", list.width, list.height)
+ }
+ if(s1){
+ trace("S1 w/h: ", s1.width, s1.height)
+ }
+
+ if(s2){
+ trace("s2 w/h: ", s2.width, s2.height)
+ }
+ */
+
+ }
+
+ private function createShape(color:uint):UIControl
+ {
+ var spacer:UIControl = new UIControl();
+ spacer.setSize("60%","100%")
+ spacer.backgroundPainter = new FillPainter(color);
+ return spacer;
+ }
+
+ private function createList():List{
+ list = new List();
+ list.addEventListener(MouseEvent.CLICK, onListClick)
+ list.width = 200
+ list.percentUnusedHeight = 100;
+
+ var layout:VLayout = new VLayout(0);
+ list.layout = layout;
+
+ var rendererFactory:ClassFactory = new ClassFactory(Renderer);
+ rendererFactory.properties = {width:500, height:30}
+ list.itemRenderer = rendererFactory;
+ list.dataProvider = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
+
+ list.skin = new AuroraContainerSkin()
+ return list;
+ }
+
+ private function onListClick(event:MouseEvent):void
+ {
+ //container.horizontalScrollBar.visible = false;
+ //trace('list height: '+list.height, 'list measuredht: '+list.measuredHeight, 'hScrollBar y'+list.horizontalScrollBar.y)
+ }
+
+ public function onStageResize(event:Event):void{
+ //trace(container.width, container.height)
+ if(uic){
+ this.uic.width = stage.stageWidth/4;
+ this.uic.height = stage.stageHeight/4;
+ }
+ if(!container) return;
+ container.width = stage.stageWidth/3;
+ container.height = stage.stageHeight/3;
+ }
+
+ private function createScrollBarFromStyle():void
+ {
+ /*var vSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin());
+ var vScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(vSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var hSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin(Math.PI/2));
+ var hScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(hSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var listSkin:UIContainerSkin = new UIContainerSkin(vScrollBarSkin,hScrollBarSkin);
+
+ list.skin = listSkin;
+ */
+ }
+
+ private function createScrollBarFromStyle2():void
+ {
+ /*var vSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin());
+ var vScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(vSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var hScrubberSkin:SimpleButtonSkin = new SimpleButtonSkin()
+ hScrubberSkin.name = "hScrubber"
+ var hSliderSkin:SliderSkin = new SliderSkin(hScrubberSkin, new HaloTrackSkin(Math.PI/2));
+ var hScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(hSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var listSkin:UIContainerSkin = new UIContainerSkin(vScrollBarSkin,hScrollBarSkin);
+
+ container.skin = listSkin;
+ */
+ }
+
+ private function createVScrollBar():ScrollBar{
+
+ var verticalScrollBar:ScrollBar = new ScrollBar(Direction.VERTICAL);
+ verticalScrollBar.width = 15;
+ verticalScrollBar.height = 300;
+ addChild(verticalScrollBar)
+
+ verticalScrollBar.slider.trackSkin = new HaloTrackSkin()
+ verticalScrollBar.slider.thumbSkin = new SimpleButtonSkin()
+ verticalScrollBar.incrementButtonSkin = new SimpleButtonSkin()
+ verticalScrollBar.decrementButtonSkin = new SimpleButtonSkin();
+ return verticalScrollBar
+
+ }
+ }
+}
+
+
+import flash.display.Sprite;
+import flash.display.Graphics;
+import org.openPyro.core.UIControl;
+import flash.text.TextField;
+import net.comcast.logging.Logger;
+import net.comcast.logging.consoles.TraceConsole;
+import org.openPyro.core.IDataRenderer;
+import flash.events.MouseEvent;
+
+internal class Renderer extends UIControl implements IDataRenderer{
+
+ private var txt:TextField;
+
+ public function Renderer(){
+
+ //Logger.addConsole(new TraceConsole());
+
+ txt = new TextField()
+ //txt.border=true;
+ addChild(txt);
+ txt.autoSize = "left";
+ txt.wordWrap=true;
+ txt.selectable=false;
+ //this.addEventListener(MouseEvent.CLICK, onMouseClick)
+ //this.height = 30;
+ }
+
+
+ private var addHt:Number = 0
+ private function onMouseClick(event:MouseEvent):void{
+ addHt = 100;
+ this.invalidateSize();
+ }
+
+ public function set data(d:Object):void{
+ this.txt.text = String(d)
+ invalidateSize();
+ }
+
+ private var _data:String
+ public function set label(s:String):void{
+ _data = s;
+ this.txt.text = s;
+ this.invalidateSize()
+ }
+
+ override public function measure():void{
+ super.measure()
+
+ //if(this.txt.text == "1"){
+ //trace(this.txt.text + ':measuring height: '+ _measuredHeight);
+ //}
+ //this.invalidateDisplayList()
+ //trace('[ ROOT set height ]'+_measuredHeight)
+ }
+
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ if(this.txt.text == "1"){
+ //trace('updating dl: '+unscaledHeight);
+ }
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ txt.width = unscaledWidth-20
+ txt.x = 10
+ txt.y = 10
+ txt.height = 20
+
+ var gr:Graphics = this.graphics;
+ gr.clear()
+ gr.lineStyle(1, 0x6ab0f7)
+ gr.beginFill(0xcccccc)
+ gr.drawRect(0,0,unscaledWidth,unscaledHeight);
+ gr.endFill();
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/70034afec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/70034afec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..8ae3b36
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/70034afec011001e1d7df1eab75b47a2
@@ -0,0 +1,25 @@
+package com.cimians.openPyro.events
+{
+ import flash.events.Event;
+
+ public class PyroEvent extends Event
+ {
+ public static const CREATION_COMPLETE:String = "creationComplete";
+ public static const PROPERTY_CHANGE:String = "propertyChange";
+ public static const PREINITIALIZE:String = "preInitialize";
+ public static const INITIALIZE:String = "initialize";
+ public static const SIZE_INVALIDATED:String = "sizeInvalidated";
+ public static const SIZE_VALIDATED:String = "sizeValidated";
+ public static const SIZE_CHANGED:String = "sizeChanged";
+ public static const SCROLLBARS_CHANGED:String = "scrollBarsChanged"
+ public static const UPDATE_COMPLETE:String="updateComplete";
+
+ public static const ENTER:String = "enter"
+
+ public function PyroEvent(type:String)
+ {
+ super(type);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/a0a2c6fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/a0a2c6fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..2aa2c14
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/10/a0a2c6fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,139 @@
+package com.cimians.openPyro.controls
+{
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.utils.StringUtil;
+
+ import flash.text.TextField;
+ import flash.text.TextFormat;
+
+ public class Label extends UIControl
+ {
+ protected var _textField:TextField;
+
+ public function Label()
+ {
+ super();
+ }
+
+ override protected function createChildren():void{
+ _textField = new TextField();
+ setTextFieldProperties()
+ addChild(_textField);
+
+ if(_format){
+ _textField.defaultTextFormat = _format;
+ }
+ if(_text){
+ _textField.text = _text
+ }
+ }
+
+ protected function setTextFieldProperties():void{
+ _textField.selectable = false;
+ //_textField.border = true;
+ }
+
+ /**
+ * Returns the raw textfield used to render
+ * the text
+ */
+ public function get textField():TextField
+ {
+ return _textField;
+ }
+
+ protected var _format:TextFormat;
+
+ /**
+ * Sets the TextFormat on the
+ * label.
+ *
+ * @see flash.text.TextFormat
+ */
+ public function set textFormat(tf:TextFormat):void
+ {
+ _format = tf;
+ if(!_textField)return;
+
+ _textField.defaultTextFormat = tf;
+ if(_text){
+ this.text = _text;
+ }
+ }
+
+ public function get textFormat():TextFormat{
+ return _format
+ }
+
+
+ protected var _text:String = "";
+
+ /**
+ * Sets the string that will be displayed
+ * on the label
+ */
+ public function set text(str:String):void
+ {
+ if(_text == str) return;
+ this._text = str;
+ if(!_textField)return;
+ this.invalidateSize();
+ this.forceInvalidateDisplayList=true
+ this.invalidateDisplayList();
+ }
+
+ public function get text():String{
+ return _text;
+ }
+
+ override protected function doChildBasedValidation():void
+ {
+ //
+ // Set the _textField's text so that we can measure based on
+ // the textWidths
+ //
+ if(!_textField) return;
+ _textField.text = _text;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ var computedWidth:Number = this._textField.textWidth+5 + _padding.left + _padding.right;
+ if(!isNaN(_maximumWidth)){
+ computedWidth = Math.min(computedWidth, _maximumWidth);
+ }
+ super.measuredWidth = computedWidth;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ var computedHeight:Number = this._textField.textHeight+5 + _padding.top + _padding.bottom;
+ if(!isNaN(_maximumHeight)){
+ computedHeight = Math.min(computedHeight, _maximumHeight)
+ }
+ super.measuredHeight = computedHeight;
+ }
+
+ //
+ // Measured Width and height may not have changed so updateDisplaylist may not
+ // be called. So do the text truncation again (may be redundant though)
+ //
+ if(_textField.textWidth > _textField.width){
+
+ StringUtil.omitWordsToFit(_textField);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ _textField.x = this._padding.left;
+ _textField.y = this._padding.top;
+ _textField.width = unscaledWidth - _padding.left - _padding.right;
+ _textField.height = unscaledHeight - _padding.top - _padding.bottom;
+ _textField.text = _text;
+ if(_textField.textWidth > _textField.width){
+ StringUtil.omitWordsToFit(_textField);
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/19/30d44aaabf11001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/19/30d44aaabf11001e1d7df1eab75b47a2
new file mode 100644
index 0000000..e9365a8
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/19/30d44aaabf11001e1d7df1eab75b47a2
@@ -0,0 +1,202 @@
+package com.cimians.openPyro.aurora
+{
+ import com.cimians.openPyro.controls.Button;
+ import com.cimians.openPyro.controls.Label;
+ import com.cimians.openPyro.controls.events.ButtonEvent;
+ import com.cimians.openPyro.core.IStateFulClient;
+ import com.cimians.openPyro.core.Padding;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.painters.IPainter;
+
+ import flash.display.DisplayObject;
+ import flash.text.TextFormat;
+
+ public class AuroraPainterButtonSkin extends UIControl implements IStateFulClient
+ {
+ /**
+ * A skin for buttons using different painters.
+ * Note: Only padding left and padding top are respected if align is set to
+ * left
+ */
+ public function AuroraPainterButtonSkin()
+ {
+ this.mouseChildren=false;
+ this._padding = new Padding(0,10, 0,0);
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ if(skinnedControl)
+ {
+ skinnedControl.removeEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ }
+ super.skinnedControl = uic;
+ skinnedControl.addEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ if(uic is Button)
+ {
+ this.changeState(null, Button(uic).currentState);
+ updateLabel();
+ }
+ this.buttonMode = true;
+ this.useHandCursor = true;
+
+ }
+
+ protected function onSkinnedControlPropertyChange(event:PyroEvent):void
+ {
+ if(skinnedControl is Button)
+ {
+ updateLabel();
+ }
+ }
+
+ /////////////////// ICON /////////////////
+
+ protected var _icon:DisplayObject;
+ public function set icon(icn:DisplayObject):void
+ {
+ _icon = icn;
+ addChild(_icon);
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ ////////////////// LABEL /////////////////
+
+ protected var _labelFormat:TextFormat = new TextFormat("Arial",11, 0x111111,true);
+
+ public function set labelFormat(fmt:TextFormat):void
+ {
+ _labelFormat = fmt;
+ if(label)
+ {
+ label.textFormat = fmt;
+ }
+ if(skinnedControl)
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ public function get labelFormat():TextFormat
+ {
+ return _labelFormat;
+ }
+
+ protected var label:Label;
+
+ public function updateLabel():void{
+ if(this.skinnedControl is Button){
+ var bttn:Button = Button(this.skinnedControl);
+ if(!bttn.label) return;
+ if(!label){
+ label = new Label();
+ label.textFormat = _labelFormat;
+ addChild(label);
+
+ }
+
+ if(bttn.label != label.text){
+ label.text = bttn.label;
+ }
+ }
+ //this.invalidateDisplayList();
+ }
+
+ private var _labelAlign:String = "center";
+ public function set labelAlign(direction:String):void
+ {
+ _labelAlign = direction;
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ //////////// Colors ///////////////
+
+ public var upPainter:IPainter;
+ public var overPainter:IPainter;
+ public var downPainter:IPainter;
+
+ public function set painters(painter:IPainter):void{
+ upPainter = overPainter = downPainter = painter;
+ this.invalidateDisplayList();
+ }
+
+/* public function set stroke(str:Stroke):void
+ {
+ _stroke = str;
+ this.invalidateDisplayList();
+ } */
+
+
+ ///////////////// Button Behavior ////////
+
+ public function changeState(fromState:String, toState:String):void
+ {
+ if(toState==ButtonEvent.UP)
+ {
+ this.backgroundPainter = upPainter;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ this.backgroundPainter = overPainter;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ this.backgroundPainter = downPainter;
+ }
+ else
+ {
+ this.backgroundPainter = upPainter;
+ }
+ }
+
+ override public function dispose():void
+ {
+ if(this.parent)
+ {
+ this.parent.removeChild(this);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(label){
+
+ label.textField.autoSize = "left";
+ label.y = (unscaledHeight-label.height)/2+_padding.top;
+
+ if(this._labelAlign == "center"){
+ label.x = (unscaledWidth-label.width)/2;
+ }
+ else if(_labelAlign == "left"){
+ label.x = _padding.left;
+ }
+ }
+
+ if(_icon){
+ if(!label){
+ _icon.x = (unscaledWidth-_icon.width)/2;
+ }
+ else{
+ if(_labelAlign == "left"){
+ _icon.x = label.x;
+ label.x += _icon.width+5;
+ }
+ else{
+ _icon.x = label.x-_icon.width-5;
+ }
+ }
+ _icon.y = (unscaledHeight-_icon.height)/2;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/1d/30cb8a9ec111001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/1d/30cb8a9ec111001e1d7df1eab75b47a2
new file mode 100644
index 0000000..68cd35d
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/1d/30cb8a9ec111001e1d7df1eab75b47a2
@@ -0,0 +1,109 @@
+package {
+ import org.openPyro.charts.VBarChart;
+ import org.openPyro.controls.*;
+ import org.openPyro.core.*;
+ import org.openPyro.layout.*;
+ import org.openPyroExamples.DimensionMarkerSkin;
+
+ import flash.display.Sprite;
+ import flash.events.*;
+
+ public class OpenPyroExample extends Sprite{
+
+ private var overall:UIContainer
+ private var container:UIContainer;
+ private var red:UIControl;
+ private var blue:UIControl;
+
+ public function OpenPyroExample(){
+ stage.scaleMode = "noScale"
+ stage.align = "TL"
+ testCompositeLayout();
+ }
+
+ private function testCompositeLayout():void{
+
+ stage.addEventListener(Event.RESIZE, onStageResize);
+ //stage.addEventListener(MouseEvent.MOUSE_DOWN,onStageClick)
+ overall = new UIContainer()
+ overall.name = "overall";
+ overall.setSize(stage.stageWidth/2,stage.stageHeight/2);
+ overall.x = overall.y = 10;
+
+ addChild(overall);
+ overall.layout = new HLayout(0);
+
+
+ red = new UIControl()
+ red.skin = new DimensionMarkerSkin();
+ red.name = "red";
+ red.percentUnusedHeight=100;
+ red.width = 100
+ overall.addChild(red);
+
+
+ container = new UIContainer();
+ container.name = "inner_container_1"
+ container.setSize("100%","100%");
+ container.layout = new VLayout();
+
+ overall.addChild(container);
+
+
+ var green:UIControl = new UIControl();
+ green.skin = new DimensionMarkerSkin()
+ green.name = "green"
+ green.percentUnusedWidth = 100;
+ green.percentUnusedHeight = 20
+ container.addChild(green);
+
+
+ blue = new UIControl()
+ blue.skin = new DimensionMarkerSkin()
+ blue.name = "blue";
+ blue.percentUnusedWidth = 100;
+ blue.percentUnusedHeight = 20
+ container.addChild(blue);
+
+ var c3:UIContainer = new UIContainer()
+ c3.name = "container_3";
+ c3.layout = new HLayout()
+ c3.percentUnusedWidth = 100
+ c3.percentUnusedHeight = 60
+
+ container.addChild(c3)
+
+ var white:UIControl = new UIControl()
+ white.skin = new DimensionMarkerSkin()
+ white.name="white"
+ white.width = 100
+ white.percentUnusedHeight=100
+ c3.addChild(white)
+
+ var c4:UIContainer = new UIContainer()
+ c4.name = "c4"
+ c4.layout = new VLayout()
+ c4.percentUnusedWidth = 100
+ c4.percentUnusedHeight=100
+ c3.addChild(c4);
+
+ var black:UIControl = new UIControl()
+ black.skin = new DimensionMarkerSkin()
+ black.name = "black"
+ black.percentUnusedWidth=100
+ black.height=50
+ c4.addChild(black)
+
+ var greyish:UIControl = new UIControl()
+ greyish.skin = new DimensionMarkerSkin()
+ greyish.percentUnusedWidth = 100
+ greyish.percentUnusedHeight=100
+ c4.addChild(greyish);
+ }
+ private function onStageResize(event:Event):void{
+ overall.setSize(stage.stageWidth/2,stage.stageHeight/2);
+ }
+ }
+
+
+}
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/20/f00892fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/20/f00892fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..5b0d3b1
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/20/f00892fec011001e1d7df1eab75b47a2
@@ -0,0 +1,129 @@
+package com.cimians.openPyro.managers
+{
+ import com.cimians.openPyro.core.IDataRenderer;
+ import com.cimians.openPyro.core.MeasurableControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.managers.toolTipClasses.DefaultToolTipRenderer;
+
+ import flash.display.DisplayObject;
+ import flash.display.Stage;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+ import flash.events.TimerEvent;
+ import flash.utils.Timer;
+ import flash.utils.getDefinitionByName;
+ import flash.utils.getQualifiedClassName;
+
+ public class TooltipManager
+ {
+
+ private var rendererInstance:DisplayObject;
+ private var _defaultRendererClass:Class = DefaultToolTipRenderer
+
+ public function TooltipManager() {}
+
+ private var stage:Stage;
+ private var hideTimer:Timer
+ private var currentTarget:DisplayObject;
+
+ public function showToolTip(event:MouseEvent, data:Object, rendererClass:Class=null):void
+ {
+ if(!rendererClass){
+ rendererClass = DefaultToolTipRenderer;
+ }
+ currentTarget= event.target as DisplayObject;
+ stage = event.target.stage;
+ if(!stage) return;
+ if(!rendererInstance || getDefinitionByName(getQualifiedClassName(rendererInstance)) != rendererClass){
+ rendererInstance =new rendererClass();
+ stage.addChild(rendererInstance);
+ if(rendererInstance is MeasurableControl){
+ MeasurableControl(rendererInstance).validateSize();
+ MeasurableControl(rendererInstance).validateDisplayList();
+ MeasurableControl(rendererInstance).addEventListener(PyroEvent.UPDATE_COMPLETE, onRendererUpdate);
+ }
+ }
+ else{
+ rendererInstance.visible = true;
+ }
+ IDataRenderer(rendererInstance).data = data;
+ positionTooltipFunction();
+ if(_moveWithMouse){
+ stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
+ }
+
+ currentTarget.addEventListener(MouseEvent.MOUSE_OUT, hideToolTip)
+
+ if(!hideTimer){
+ hideTimer = new Timer(5000,1);
+ hideTimer.addEventListener(TimerEvent.TIMER, onHideTimer);
+ }
+
+ hideTimer.reset();
+ hideTimer.start();
+
+ }
+
+ private function onHideTimer(event:TimerEvent):void{
+ hideToolTip();
+ }
+
+
+ private function onRendererUpdate(event:PyroEvent):void{
+ positionTooltipFunction();
+ }
+
+ private function onMouseMove(event:Event):void{
+ if(rendererInstance)
+ positionTooltipFunction();
+
+ }
+
+ /**
+ * positionTooltip is a Function that is in the public namespace.
+ * This way, if you wanted to provide a custom positioning algorithm,
+ * you can just by doing:
+ * TooltipManager.getInstance.positionToolTipFunction = function(){ ... }
+ */
+ public var positionTooltipFunction:Function = function():void{
+ if(!stage) return;
+ if(stage.mouseX < (stage.stageWidth - rendererInstance.width-20)){
+ rendererInstance.x = stage.mouseX+10;
+ }
+ else{
+ rendererInstance.x = stage.mouseX-rendererInstance.width-5;
+ }
+ if(stage.mouseY < stage.stageHeight-60){
+ rendererInstance.y = stage.mouseY+10;
+ }
+ else{
+ rendererInstance.y = stage.mouseY-rendererInstance.height-5;
+ }
+ }
+
+ public function hideToolTip(event:Event=null):void
+ {
+ rendererInstance.visible = false;
+ if(stage)
+ stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
+ }
+
+ private var _moveWithMouse:Boolean = false;
+ public function set moveWithMouse(b:Boolean):void{
+ _moveWithMouse = b
+ }
+ public function get moveWithMouse():Boolean{
+ return _moveWithMouse;
+ }
+
+ private static var instance:TooltipManager;
+ public static function getInstance():TooltipManager
+ {
+ if(!instance)
+ {
+ instance = new TooltipManager();
+ }
+ return instance;
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/21/509a92fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/21/509a92fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..03e02c2
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/21/509a92fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,49 @@
+package org.openPyro.aurora{
+
+ import com.cimians.openPyro.aurora.skinClasses.GradientRectSkin;
+ import com.cimians.openPyro.controls.skins.ISliderSkin;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.painters.Stroke;
+ import com.cimians.openPyro.skins.ISkin;
+
+ public class AuroraSliderSkin implements ISliderSkin
+ {
+
+ public var trackGradientRotation:Number=0;
+
+ private var track:GradientRectSkin;
+ private var _thumbSkin:AuroraButtonSkin;
+
+ public function AuroraSliderSkin()
+ {
+ }
+
+ public function get thumbSkin():ISkin
+ {
+ _thumbSkin = new AuroraButtonSkin();
+ return _thumbSkin;
+ }
+
+ public function set skinnedControl(uic:UIControl):void{}
+
+ public function get trackSkin():ISkin
+ {
+ track = new GradientRectSkin();
+ track.stroke = new Stroke(1,0xcccccc)
+ track.gradientRotation = trackGradientRotation;
+ return track;
+ }
+ public function dispose():void
+ {
+ if(_thumbSkin.parent)
+ {
+ _thumbSkin.parent.removeChild(_thumbSkin);
+ }
+ _thumbSkin = null;
+ if(track.parent){
+ track.parent.removeChild(track);
+ }
+ track = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/22/20b2b72dc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/22/20b2b72dc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..51a9a46
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/22/20b2b72dc011001e1d7df1eab75b47a2
@@ -0,0 +1,39 @@
+package org.openPyro.aurora.skinClasses{
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.painters.GradientFillPainter;
+ import com.cimians.openPyro.painters.Stroke;
+
+ public class GradientRectSkin extends UIControl
+
+ {
+ protected var _gradientRotation:Number = 0;
+ protected var gradientFill:GradientFillPainter;
+
+ public function GradientRectSkin()
+ {
+ gradientFill = new GradientFillPainter([0x999999,0xdfdfdf],[.6,1],[1,255],_gradientRotation)
+ this.backgroundPainter = gradientFill;
+ }
+
+ public function set gradientRotation(r:Number):void
+ {
+ _gradientRotation = r;
+ gradientFill.rotation = _gradientRotation;
+ this.invalidateDisplayList();
+ }
+
+ protected var _stroke:Stroke = new Stroke(1,0x777777);
+
+ public function set stroke(str:Stroke):void{
+ _stroke = str;
+ gradientFill.stroke = str;
+ this.invalidateDisplayList();
+ }
+
+ public function get stroke():Stroke
+ {
+ return _stroke;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2098e7fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2098e7fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..c64d9eb
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/2b/2098e7fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,49 @@
+package com.cimians.openPyro.effects
+{
+ import com.cimians.openPyro.collections.ArrayCollection;
+
+ import flash.events.Event;
+
+ public class EffectSequence extends PyroEffect
+ {
+ private var effects:ArrayCollection
+ public function EffectSequence()
+ {
+ effects = new ArrayCollection();
+ }
+
+ public function addEffect(effect:PyroEffect):void{
+ effects.addItem(effect);
+ }
+
+ protected var currentlyPlayingEffectIndex:int = -1;
+ protected var currentlyPlayingEffect:PyroEffect;
+
+ override public function start():void{
+ for(var i:int=0; i
+ * var a:Array = [0,1,2,3,4,5]
+ * ArrayUtil.insertAt(a, 2, "inserted");
+ * trace(a) //[0,1,inserted,2,3,4,5]
+ *
+ */
+ public static function insertAt(src:Array, idx:Number, data:*):void{
+ if(idx=0; i--){
+ insertAt(sourceArray, idx, arrayToInsert[i])
+ }
+ return sourceArray;
+ }
+
+
+
+ public static function removeItemAt(src:Array, idx:uint):void{
+ src.splice(idx,1);
+ }
+
+ public static function removeDuplicates(arr:Array):Array{
+ var uniques:Array = new Array()
+ var i:uint = 0;
+ while(i < arr.length){
+ var searchElement:* = arr[i];
+ if(uniques.indexOf(searchElement) != -1){
+ removeItemAt(arr, i);
+
+ }
+ else{
+ uniques.push(searchElement);
+ i++;
+ }
+ }
+ return arr;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/3/40d6c0fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/3/40d6c0fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..e47bde1
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/3/40d6c0fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,112 @@
+package com.cimians.openPyro.containers
+{
+ import com.cimians.openPyro.containers.events.DividerEvent;
+ import com.cimians.openPyro.controls.skins.IDividedBoxSkin;
+ import com.cimians.openPyro.core.ClassFactory;
+ import com.cimians.openPyro.core.UIContainer;
+
+ import flash.display.DisplayObject;
+ import flash.display.InteractiveObject;
+ import flash.events.MouseEvent;
+
+ [Event(name="dividerDoubleClick", type="com.cimians.openPyro.containers.events.DividerEvent" )]
+
+ public class DividedBox extends UIContainer
+ {
+ public function DividedBox()
+ {
+ super();
+ }
+
+ protected var dividers:Array = new Array();
+
+
+ protected var _dividerFactory:ClassFactory;
+ public function set dividerFactory(f:ClassFactory):void{
+ _dividerFactory = f;
+ }
+ public function get dividerFactory():ClassFactory{
+ return _dividerFactory;
+ }
+
+ override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
+ if(contentPane.numChildren > 0){
+ contentPane.addChild(getNewDivider())
+ }
+ return super.addChildAt(child, index);
+ }
+
+
+ protected function getNewDivider():DisplayObject{
+ var divider:DisplayObject
+ if(this._skin){
+ divider = IDividedBoxSkin(_skin).getNewDividerSkin();
+ }
+ else{
+ if(!_dividerFactory){
+ _dividerFactory = defaultDividerFactory;
+ }
+ divider = _dividerFactory.newInstance();
+ }
+ dividers.push(divider);
+ InteractiveObject(divider).doubleClickEnabled = true;
+ divider.addEventListener(MouseEvent.MOUSE_DOWN, onDividerMouseDown);
+ divider.addEventListener(MouseEvent.CLICK, onDividerClick);
+ divider.addEventListener(MouseEvent.DOUBLE_CLICK, onDividerDoubleClick);
+ return divider;
+ }
+
+ protected function get defaultDividerFactory():ClassFactory{
+ throw new Error("Method needs overriding")
+ return new ClassFactory();
+ /// override
+ }
+
+ protected function onDividerMouseDown(event:MouseEvent):void{
+ throw new Error("DividerMouseDown needs overriding")
+ }
+
+ protected function onDividerDoubleClick(event:MouseEvent):void{
+ var evt:DividerEvent = new DividerEvent(DividerEvent.DIVIDER_DOUBLE_CLICK)
+ evt.divider = event.currentTarget as DisplayObject;
+ evt.dividerIndex = dividers.indexOf(event.currentTarget);
+ dispatchEvent(evt);
+ }
+
+ protected function onDividerClick(event:MouseEvent):void{
+ var evt:DividerEvent = new DividerEvent(DividerEvent.DIVIDER_CLICK)
+ evt.divider = event.currentTarget as DisplayObject;
+ evt.dividerIndex = dividers.indexOf(event.currentTarget);
+ dispatchEvent(evt);
+ }
+
+ /*
+ Removes the child required and also the previous divider or the next one if one
+ was created
+ */
+ override public function removeChild(child:DisplayObject):DisplayObject{
+
+ var prevDivider:DisplayObject;
+ for(var i:int=0; i
+ * one
+ *
+ *
+ * in something like
+ *
+ *
+ *
+ *
+ *
+ * `
+ * one
+ *
+ *
+ *
+ *
+ *
+ */
+ public static function isItemParentOf(item:XML, newNode:XML):Boolean{
+ if(item.contains(newNode)) return true;
+ var foundAsChild:Boolean = false
+ for(var i:int=0; i'+slider.value)
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4/f05b5f5bc111001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4/f05b5f5bc111001e1d7df1eab75b47a2
new file mode 100644
index 0000000..7fe53df
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4/f05b5f5bc111001e1d7df1eab75b47a2
@@ -0,0 +1,82 @@
+package org.openPyroExamples
+{
+ import org.openPyro.core.UIControl;
+ import org.openPyro.skins.ISkin;
+
+ import flash.display.Graphics;
+ import flash.text.TextField;
+ import flash.text.TextFormat;
+
+ public class DimensionMarkerSkin extends UIControl implements ISkin
+ {
+
+ private var _control:UIControl
+
+ private var widthTxt:TextField
+ private var heightTxt:TextField;
+
+ public function DimensionMarkerSkin()
+ {
+ widthTxt = new TextField()
+ widthTxt.autoSize = "left"
+ widthTxt.defaultTextFormat = new TextFormat("Arial",11,0x00e0fb)
+
+ heightTxt = new TextField()
+ heightTxt.autoSize = "left"
+ heightTxt.defaultTextFormat = new TextFormat("Arial",11,0x00e0fb)
+
+ addChild(widthTxt)
+ addChild(heightTxt);
+
+ this.percentUnusedWidth = 100
+ this.percentUnusedHeight = 100;
+
+ }
+
+ public function get selector():String
+ {
+ return null;
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ this._control = uic;
+ _control.addChild(this);
+
+ }
+
+ override public function validateSize():void{
+ //trace(this+ ' validate size called '+this.usesMeasurementStrategy)
+ super.validateSize();
+ }
+
+
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ var gr:Graphics = this.graphics;
+ gr.clear();
+ gr.lineStyle(1,0x333333);
+ gr.beginGradientFill("linear",[0xffffff,0xdfdfdf],[1,1],[0,255]);
+ gr.drawRect(0,0,unscaledWidth,unscaledHeight);
+ gr.endFill();
+
+ gr.lineStyle(1,0x00e0fb);
+ gr.moveTo(2,10)
+ gr.lineTo(unscaledWidth-4, 10);
+
+ widthTxt.text = isNaN(_control.explicitWidth)?_control.percentUnusedWidth+"%":_control.explicitWidth+"px"
+ widthTxt.x = unscaledWidth/2
+ widthTxt.y = 12;
+
+
+ gr.moveTo(10,2)
+ gr.lineTo( 10, unscaledHeight-4);
+
+ heightTxt.text = isNaN(_control.explicitHeight)?_control.percentUnusedHeight+"%":_control.explicitHeight+"px"
+ heightTxt.x = 12
+ heightTxt.y = unscaledHeight/2;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/41/90d5b7fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/41/90d5b7fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..5a0fe7b
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/41/90d5b7fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,131 @@
+package com.cimians.openPyro.controls.listClasses
+{
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.painters.FillPainter;
+ import com.cimians.openPyro.painters.IPainter;
+
+ import flash.events.MouseEvent;
+ import flash.text.TextField;
+ import flash.text.TextFormat;
+
+ public class DefaultListRenderer extends UIControl implements IListDataRenderer
+ {
+
+ protected var _labelField:TextField;
+
+ protected var _rollOverBackgroundPainter:IPainter;
+ protected var _rollOutBackgroundPainter:IPainter;
+
+ public function DefaultListRenderer() {
+ super();
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+ this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler)
+ this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler)
+ _labelField = new TextField()
+ _labelField.selectable=false;
+
+ if(!_labelFormat){
+ _labelField.defaultTextFormat= new TextFormat("Arial",12)
+ }
+ else{
+ _labelField.defaultTextFormat = _labelFormat;
+ }
+ addChild(_labelField);
+ if(_data && _baseListData && _baseListData.list){
+ _labelField.text = _baseListData.list.labelFunction(_data);
+ }
+
+ if(!_rollOverBackgroundPainter){
+ _rollOverBackgroundPainter = new FillPainter(0x559DE6)
+ }
+ if(!_rollOutBackgroundPainter){
+ _rollOutBackgroundPainter = new FillPainter(0xffffff)
+ }
+ this.backgroundPainter = this._rollOutBackgroundPainter
+ }
+
+ protected var _baseListData:BaseListData;
+ public function set baseListData(value:BaseListData):void{
+ _baseListData = value
+ }
+ public function set rollOutBackgroundPainter(painter:IPainter):void
+ {
+ this._rollOutBackgroundPainter = painter;
+ }
+
+ public function set rollOverBackgroundPainter(painter:IPainter):void
+ {
+ this._rollOverBackgroundPainter = painter;
+ }
+
+ protected var _labelFormat:TextFormat;
+ public function set labelFormat(format:TextFormat):void
+ {
+ _labelFormat = format;
+ if(_labelField){
+ _labelField.defaultTextFormat = format;
+ }
+ }
+
+ public function get labelFormat():TextFormat{
+ return _labelFormat;
+ }
+
+ protected function mouseOverHandler(event:MouseEvent):void
+ {
+ this.backgroundPainter = _rollOverBackgroundPainter;
+ }
+
+ protected function mouseOutHandler(event:MouseEvent):void
+ {
+ if(!_selected){
+ this.backgroundPainter = _rollOutBackgroundPainter;
+ }
+ }
+
+ protected var _data:*;
+
+ public function set data(value:Object):void{
+ _data = value;
+ _labelField.text = _baseListData.list.labelFunction(_data);
+ }
+
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ private var _selected:Boolean = false;
+ public function set selected(b:Boolean):void
+ {
+ _selected = b;
+ if(_selected){
+ this.backgroundPainter = _rollOverBackgroundPainter;
+ }
+ else{
+ this.backgroundPainter = _rollOutBackgroundPainter;
+ }
+ invalidateDisplayList();
+
+ }
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ _labelField.x = _labelField.y = 5;
+ _labelField.width = unscaledWidth-10
+ _labelField.height = Math.max(unscaledHeight-10,20);
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/44/209a3afec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/44/209a3afec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..d809024
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/44/209a3afec011001e1d7df1eab75b47a2
@@ -0,0 +1,106 @@
+package com.cimians.openPyro.layout{
+ import com.cimians.openPyro.core.MeasurableControl;
+ import com.cimians.openPyro.core.UIContainer;
+
+ import flash.display.DisplayObject;
+
+ public class HLayout implements ILayout, IContainerMeasurementHelper{
+
+
+ private var _hGap:Number;
+ public function HLayout(hGap:Number=0):void{
+ _hGap = hGap;
+ }
+
+ protected var _container:UIContainer;
+ public function set container(container:UIContainer):void
+ {
+ _container = container;
+ }
+
+ private var _initY:Number = 0;
+ private var _initX:Number = 0;
+
+ public function set initX(n:Number):void{
+ _initX = n;
+ }
+
+ public function get initX():Number{
+ return _initX;
+ }
+
+ public function set initY(n:Number):void{
+ _initY = n;
+ }
+
+ public function get initY():Number{
+ return _initY;
+ }
+
+ /**
+ *Find all the children with explicitWidth/ explicit Height set
+ *This part depends on the layout since HLayout will start trimming
+ *the objects available h space, and v layout will do the same
+ *for vertically available space
+ **/
+
+ public function calculateSizes(children:Array,container:UIContainer):void
+ {
+ for(var i:int = 0; i0){
+ container.explicitlyAllocatedWidth+=_hGap;
+ }
+ if(children[i] is MeasurableControl)
+ {
+ var sizeableChild:MeasurableControl = MeasurableControl(children[i]);
+
+ if(isNaN(sizeableChild.percentUnusedWidth) && isNaN(sizeableChild.percentWidth))
+ {
+ container.explicitlyAllocatedWidth+=sizeableChild.width;
+ }
+
+ }
+ }
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ var nowX:Number=_initX;
+ for(var i:uint=0; i maxH)
+ {
+ maxH = DisplayObject(children[i]).height
+ }
+ }
+ return maxH;
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ public function layout(children:Array):void{
+ var nowX:Number=_initX;
+ for(var i:uint=0; i 1 && tf.textWidth > w)
+ {
+ s = s.slice(0, s.lastIndexOf(" "));
+ tf.text = s + indicator;
+ }
+ }
+
+ // check against textWidth and textHeight, include styles
+ if(tf.textHeight > h)
+ {
+ // get close
+ s = originalText.slice(0, Math.floor((h / tf.textHeight ) * originalText.length));
+
+ while (s && s.length > 1 && tf.textHeight > h)
+ {
+ s = s.slice(0, s.lastIndexOf(" "));
+ tf.text = s + indicator;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/47/7014a4ecc111001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/47/7014a4ecc111001e1d7df1eab75b47a2
new file mode 100644
index 0000000..8a6de18
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/47/7014a4ecc111001e1d7df1eab75b47a2
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4039effdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4039effdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..432f5de
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/4a/4039effdc011001e1d7df1eab75b47a2
@@ -0,0 +1,812 @@
+package com.cimians.openPyro.core{
+ import com.cimians.openPyro.events.PyroEvent;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+
+ [Event(name="preInitialize", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="initialize", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="sizeInvalidated", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="sizeValidated", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="sizeChanged", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="updateComplete", type="com.cimians.openPyro.events.PyroEvent")]
+
+ [Event(name="propertyChange", type="com.cimians.openPyro.events.PyroEvent")]
+ [Event(name="resize", type="flash.events.Event")]
+
+
+ /**
+ * The Measurable control is the basic class that
+ * participates in Pyro's measurement strategy. Measurable controls understand
+ * a variety of properties like explicit height/width which is set if you set the
+ * width or height property with an actual neumerical value, or percentUnusedWidth
+ * and percentUnusedHeight which are set if the control's size is based on
+ * measurement of the parent control. Controls can also be sized using the
+ * percentWidth or percentHeight which is based on the parent's size without taking
+ * the other children in the parent under consideration.
+ *
+ * Note: As of right now percentWidth and percentHeight may not be respected
+ * by certain containers like DividedBoxes
+ */
+ public class MeasurableControl extends Sprite{
+
+ public function MeasurableControl(){
+ this.addEventListener(Event.ADDED, onAddedToParent);
+ super.visible = false;
+ }
+
+ /**
+ * The event listener executed when this component
+ * has been added to the parent.
+ */
+ protected function onAddedToParent(event:Event):void{
+ if(!this.parent) return;
+ this.removeEventListener(Event.ADDED, onAddedToParent);
+ this.addEventListener(Event.REMOVED, onRemovedFromParent,false,0,true);
+ this._parentContainer = this.parent as UIControl;
+ if(!_parentContainer)
+ {
+ doOnAdded();
+ }
+ }
+
+ /**
+ * Property indicates whether a control has been initialized
+ * or not. Initialization happens the first time the control
+ * is added to the parent.
+ */
+ public var initialized:Boolean = false;
+
+ /**
+ * This happens only once when a child is
+ * first added to any parent. Subsequent
+ * removeChild and addChild actions do not
+ * trigger this function but rather directly call
+ * validateSize.
+ */
+ public function initialize():void
+ {
+ dispatchEvent(new PyroEvent(PyroEvent.PREINITIALIZE))
+ createChildren();
+ dispatchEvent(new PyroEvent(PyroEvent.INITIALIZE));
+ initialized = true;
+ this.validateSize();
+ }
+
+ /**
+ * This is where the new children should
+ * be created and then added to the displaylist.
+ * Similar to Flex's createChildren() method.
+ */
+ protected function createChildren():void{}
+
+ protected var _explicitWidth:Number = NaN;
+ protected var _explicitHeight:Number = NaN;
+
+ /**
+ * The width set in terms of actual pixels.
+ * You do not call this function in your code.
+ * Setting the width of the control to an actual
+ * numeric value (rather than percent) calls this
+ * function
+ * Call this function only if you want to set
+ * width without calling the invalidation methods
+ *
+ * [TODO] This class should
+ * have namespace access control (pyro_internal)
+ */
+ public function set explicitWidth(w:Number):void{
+ _explicitWidth = w;
+ }
+
+ /** The height set in terms of actual pixels.
+ * You do not call this function in your code.
+ * Setting the width of the control to an actual
+ * numeric value (rather than percent) calls this
+ * function
+ * Call this function only if you want to set
+ * width without calling the invalidation methods
+ *
+ * [TODO] This class should
+ * have namespace access control (pyro_internal)
+ */
+ public function get explicitWidth():Number{
+ return _explicitWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitHeight(h:Number):void{
+ _explicitHeight = h;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitHeight():Number{
+ return this._explicitHeight;
+ }
+
+ /**
+ * Set/get the width of the control. If the width
+ * is set to a different value from the one the
+ * control is already at, it triggers the size
+ * invalidation cycle
+ */
+ override public function set width(n:Number):void{
+ if(n == _explicitWidth) return
+ this._explicitWidth = n
+ _dimensionsChanged = true;
+ displayListInvalidated = true;
+ if(!initialized) return;
+ invalidateSize();
+ }
+
+ /**
+ * @private
+ */
+ override public function get width():Number{
+ return this.getExplicitOrMeasuredWidth()
+ }
+
+ /**
+ * Set/get the height of the control. If the height
+ * is set to a different value from the one the
+ * control is already at, it triggers the size
+ * invalidation cycle
+ */
+ override public function set height(n:Number):void{
+ if (n == _explicitHeight) return;
+ this._explicitHeight = n
+ displayListInvalidated = true;
+ _dimensionsChanged=true;
+ if(!initialized) return;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ /**
+ * @private
+ */
+ override public function get height():Number{
+ return this.getExplicitOrMeasuredHeight();
+ }
+
+ protected var _maximumWidth:Number = NaN;
+ public function set maximumWidth(n:Number):void{
+ _maximumWidth = n;
+ invalidateSize();
+ }
+
+ public function get maximumWidth():Number{
+ return _maximumWidth;
+ }
+
+ protected var _maximumHeight:Number = NaN;
+ public function set maximumHeight(n:Number):void{
+ _maximumHeight = n;
+ invalidateSize();
+ }
+
+ public function get maximumHeight():Number{
+ return _maximumHeight;
+ }
+
+
+ protected var _percentUnusedWidth:Number;
+ protected var _percentUnusedHeight:Number;
+
+ /**
+ * Only setting percent width/heights changes the
+ * needsMeasurement flag which makes its parent
+ * container call measure on it.
+ * If width and height are set directly, measurement
+ * is never called (although size invalidation
+ * still does if size has changed)
+ */
+ public var needsMeasurement:Boolean=true;
+
+ /**
+ * Set/get the percent width. If the value is
+ * different from the earlier, it sets the measurement
+ * flag and calls invalidateSize
+ */
+ public function set percentUnusedWidth(w:Number):void{
+ if(w == _percentUnusedWidth) return
+ _percentUnusedWidth = w;
+ if(!initialized) return;
+ invalidateSize()
+ }
+
+ /**
+ * @private
+ */
+ public function get percentUnusedWidth():Number{
+ return _percentUnusedWidth;
+ }
+
+ /**
+ * Set/get the percent height. If the value is
+ * different from the earlier, it sets the measurement
+ * flag and calls invalidateSize
+ */
+ public function set percentUnusedHeight(h:Number):void{
+ if(h==_percentUnusedHeight) return;
+ //needsMeasurement = true;
+ _percentUnusedHeight = h;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ protected var _percentWidth:Number
+ public function set percentWidth(w:Number):void
+ {
+ if(w==_percentWidth) return;
+ _percentWidth = w;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ public function get percentWidth():Number
+ {
+ return _percentWidth
+ }
+
+ protected var _percentHeight:Number
+ public function set percentHeight(h:Number):void
+ {
+ if(h==_percentHeight) return;
+ _percentHeight = h;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ public function get percentHeight():Number
+ {
+ return _percentHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function get percentUnusedHeight():Number{
+ return _percentUnusedHeight;
+ }
+
+ protected var _parentContainer:UIControl;
+
+ public function set parentContainer(c:UIControl):void{
+ this._parentContainer = c;
+ }
+
+ public function get parentContainer():UIControl
+ {
+ return _parentContainer;
+ }
+
+ /**
+ * The flag to mark that the control's size
+ * has been invalidated. This means the control
+ * is now waiting for a validateSize call.
+ */
+ public var sizeInvalidated:Boolean=false;
+
+ /**
+ * Marks itself dirty and waits till either the container
+ * to validateSize or validates itself at the next enterframe
+ * if it has no parent container.
+ *
+ * This method is overridden by UIControl. The code here
+ * will only be useful for a Spacer type of component.
+ */
+ public function invalidateSize(event:PyroEvent=null):void{
+ if(sizeInvalidated) return;
+ sizeInvalidated=true;
+ dispatchEvent(new PyroEvent(PyroEvent.SIZE_INVALIDATED));
+ if(!this._parentContainer){
+ /*
+ * If this is not contained in a OpenPyro control,
+ * take the responsibility for validating the
+ * displaylist
+ */
+ this.addEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
+ }
+
+ }
+
+ /**
+ * doQueueValidateSize is executed by the top level UIControl.
+ */
+ protected function doQueuedValidateSize(event:Event):void
+ {
+ this.removeEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
+ this.validateSize();
+ }
+
+ /**
+ * This property defines whether measure() will be called during
+ * validateSize() or not.
+ */
+ public function get usesMeasurementStrategy():Boolean{
+ if(isNaN(this._explicitHeight) || isNaN(this._explicitWidth)){
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ /**
+ * The validateSize function is called in response to
+ * a component declaring its size invalid (usually
+ * by calling invalidateSize()). The job of this
+ * method is to compute the final width and height
+ * (whether by calling measure if an explicit w/h
+ * is not declared or not if an explicit w & h is
+ * declared)
+ *
+ * @see invalidateSize()
+ * @see measure()
+ * @see usesMeasurementStrategy
+ */
+ public function validateSize():void{
+ if(usesMeasurementStrategy){
+ measure();
+ checkDisplayListValidation()
+ sizeInvalidated=false;
+ }
+ else{
+ sizeInvalidated=false;
+ if(displayListInvalidated){
+ queueValidateDisplayList();
+ }
+ }
+ for(var j:uint=0; jmeasure function.
+ *
+ */
+ public function getExplicitOrMeasuredWidth():Number{
+ if(!isNaN(this._explicitWidth)){
+ return _explicitWidth
+ }
+ else{
+ return _measuredWidth
+ }
+ }
+
+ /**
+ * Returns the explicitly defined height or the measured
+ * height computed by the measure function.
+ */
+ public function getExplicitOrMeasuredHeight():Number{
+ if(!isNaN(this._explicitHeight)){
+ return _explicitHeight
+ }
+ else{
+ return _measuredHeight
+ }
+ }
+
+ private function onRemovedFromParent(event:Event):void{
+ this.addEventListener(Event.ADDED, onAddedToParent);
+ }
+
+
+ ///////// Utils ///////////
+
+ public function cancelMouseEvents():void{
+ this.addEventListener(MouseEvent.MOUSE_OVER, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_DOWN, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_OUT, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_MOVE, disableEvent, true, 1,true);
+ //this.addEventListener(MouseEvent.MOUSE_UP, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.CLICK, disableEvent, true, 1,true);
+ _mouseActionsDisabled = true
+
+ }
+
+ public function enableMouseEvents():void{
+ //this.removeEventListener(MouseEvent.MOUSE_UP, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_OVER, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_DOWN, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_OUT, disableEvent,true);
+ this.removeEventListener(MouseEvent.CLICK, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_MOVE, disableEvent,true);
+ _mouseActionsDisabled = false;
+ }
+
+ protected function disableEvent(event:Event):void{
+ event.stopImmediatePropagation()
+ event.preventDefault()
+ }
+
+ protected var _mouseActionsDisabled:Boolean = false;
+ public function get mouseActionsDisabled():Boolean{
+ return _mouseActionsDisabled;
+ }
+
+ /**
+ * Utility function to check if a mouseEvent happened
+ * while the mouse was over the displayObject
+ */
+ public function isMouseOver(event:MouseEvent):Boolean{
+ if(event.localX < this.width && event.localX > 0 &&
+ event.localY < this.height && event.localY > 0){
+ return true
+ }
+ else{
+ return false
+ }
+ }
+
+
+ /**
+ * @private
+ * Since the addChild function is overridden in all MeasurableControls,
+ * this function is defined to keep the native implementation available
+ */
+ public final function $addChild(child:DisplayObject):DisplayObject
+ {
+ return super.addChild(child);
+ }
+
+ /**
+ * @private
+ * Since the addChild function is overridden in all MeasurableControls,
+ * this function is defined to keep the native implementation available
+ */
+ public final function $addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ return super.addChildAt(child,index);
+ }
+
+ private var _includeInLayout:Boolean = true
+
+ /**
+ * @private
+ */
+ public function set includeInLayout(value:Boolean):void{
+ _includeInLayout = value
+ }
+
+ /**
+ * Specifies whether this control participates in the
+ * layout system in OpenPyro. For example if you have 3
+ * UIControls sitting in a container with a
+ * HLayout layout, but the second control as the
+ * includeInLayout property set to false, the layout will
+ * not position that control.
+ */
+ public function get includeInLayout():Boolean{
+ return _includeInLayout;
+ }
+
+ /**
+ * @private
+ */
+ public final function get $width():Number
+ {
+ return super.width
+ }
+
+ /**
+ * @private
+ */
+ final public function set $width(w:Number):void
+ {
+ super.width = w;
+ }
+
+ /**
+ * @private
+ */
+ final public function get $height():Number
+ {
+ return super.height
+ }
+
+ /**
+ * @private
+ */
+ final public function set $height(h:Number):void
+ {
+ super.height = h;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/62/104172fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/62/104172fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..c37eff7
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/62/104172fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,73 @@
+package
+{
+ import org.openPyro.aurora.AuroraContainerSkin;
+ import com.cimians.openPyro.containers.SlidePane;
+ import com.cimians.openPyro.core.UIContainer;
+ import com.cimians.openPyro.painters.FillPainter;
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ public class TestViewStack extends Sprite
+ {
+ public function TestViewStack()
+ {
+ super();
+ stage.scaleMode = "noScale";
+ stage.align = "TL";
+
+ testViewStack();
+ }
+
+ private var children:Array = []
+ private var viewStack:SlidePane = new SlidePane();
+ private var red:UIContainer = new UIContainer()
+ private var blue:UIContainer = new UIContainer()
+
+ private function testViewStack():void
+ {
+
+ viewStack.width = 200;
+ viewStack.height = stage.stageHeight-300;
+ viewStack.x = viewStack.y = 10;
+ viewStack.skin = new AuroraContainerSkin()
+ viewStack.backgroundPainter = new FillPainter(0xcccccc);
+ addChild(viewStack);
+
+
+ red.backgroundPainter = new FillPainter(0xff0000);
+ red.width = 300;
+ red.height = 400;
+ red.name = "red";
+ viewStack.addChild(red);
+
+ children.push(red)
+
+ blue.backgroundPainter = new FillPainter(0x0000ff);
+ blue.width = 150;
+ blue.height = 300;
+ blue.name = "blue";
+ viewStack.addChild(blue);
+
+ children.push(blue)
+
+ stage.addEventListener(MouseEvent.CLICK, onStageClick);
+ stage.addEventListener(Event.RESIZE, function(event:Event):void{
+ viewStack.height = stage.stageHeight-300;
+ });
+ }
+
+ private function onStageClick(event:MouseEvent):void
+ {
+ if(viewStack.selectedChild == red){
+ viewStack.selectedChild = blue
+ }
+ else
+ {
+ viewStack.selectedChild = red;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/905f7c24bf11001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/905f7c24bf11001e1d7df1eab75b47a2
new file mode 100644
index 0000000..86e4a0c
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/905f7c24bf11001e1d7df1eab75b47a2
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0961d36c211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0961d36c211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..b322e4a
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/65/d0961d36c211001e1d7df1eab75b47a2
@@ -0,0 +1,133 @@
+package
+{
+ import org.openPyro.aurora.AuroraScrollBarSkin;
+ import org.openPyro.aurora.AuroraSliderSkin;
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.controls.Slider;
+ import org.openPyro.core.Direction;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyroExamples.HaloTrackSkin;
+ import org.openPyroExamples.SimpleButtonSkin;
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ public class TestSlider extends Sprite
+ {
+
+ public function TestSlider()
+ {
+
+ stage.scaleMode = "noScale";
+ stage.align = "TL";
+
+ testScrollBarWithAuroraSkin();
+ //testSliderWithAuroraSkin();
+ stage.addEventListener(Event.RESIZE, onResize)
+ }
+
+ private function onResize(event:Event):void
+ {
+ if(scrollBar)
+ {
+ scrollBar.height = stage.stageHeight/3;
+ }
+ if(slider)
+ {
+ slider.height = stage.stageHeight/3
+ }
+ }
+
+ private var scrollBar:ScrollBar
+ private function testScrollBarWithAuroraSkin():void
+ {
+ scrollBar = new ScrollBar(Direction.VERTICAL);
+ scrollBar.addEventListener(PyroEvent.UPDATE_COMPLETE, onScrollBarUpdate);
+ scrollBar.x = 150
+ scrollBar.y = 100
+
+ scrollBar.width = 15;
+ scrollBar.height = stage.stageHeight/3;
+ addChild(scrollBar);
+
+ var auroraScrollBarSkin:AuroraScrollBarSkin = new AuroraScrollBarSkin()
+ auroraScrollBarSkin.direction = Direction.VERTICAL;
+ scrollBar.skin = auroraScrollBarSkin
+ }
+
+ private function onScrollBarUpdate(event:PyroEvent):void
+ {
+ trace("-----------------------");
+ }
+
+ private var slider:Slider
+ private function testSliderWithAuroraSkin():void
+ {
+ slider = new Slider(Direction.VERTICAL);
+ addChild(slider);
+
+ slider = new Slider(Direction.VERTICAL);
+ slider.setSize(15, stage.stageHeight/3);
+
+ var sliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
+
+ slider.skin = sliderSkin
+ slider.x = 50;
+ slider.y = 100;
+ addChild(slider);
+
+ var hSlider:Slider = new Slider(Direction.HORIZONTAL);
+ hSlider.width = 300
+ hSlider.height = 15;
+
+ var hSliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
+ hSliderSkin.trackGradientRotation = Math.PI/2
+
+ hSlider.skin = hSliderSkin
+
+ addChild(hSlider)
+ hSlider.x = 100
+ hSlider.y = 50;
+
+ stage.addEventListener(MouseEvent.CLICK, function():void{
+
+ })
+
+
+ }
+
+ private function testSliderWithExplicitSkins():void
+ {
+
+ /*
+ slider.thumbSkin = new SimpleButtonSkin();
+ slider.addEventListener(SliderEvent.THUMB_DRAG, onThumbDrag)
+ slider.trackSkin = new HaloTrackSkin();
+ */
+ }
+
+ private function testScrollBarWithExplicitSkins():void
+ {
+
+ var scrollBar:ScrollBar = new ScrollBar(Direction.VERTICAL);
+ scrollBar.x = 100
+ scrollBar.y = 100
+
+ scrollBar.width = 15;
+ scrollBar.height = 300;
+ addChild(scrollBar);
+
+ scrollBar.slider.trackSkin = new HaloTrackSkin()
+ scrollBar.slider.thumbSkin = new SimpleButtonSkin()
+ scrollBar.incrementButtonSkin = new SimpleButtonSkin()
+ scrollBar.decrementButtonSkin = new SimpleButtonSkin();
+
+ }
+
+ private function onThumbDrag(event:Event):void{
+ //trace(this,'-->'+slider.value)
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6c/d0f30b3ebf11001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6c/d0f30b3ebf11001e1d7df1eab75b47a2
new file mode 100644
index 0000000..176da6f
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6c/d0f30b3ebf11001e1d7df1eab75b47a2
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/40b581fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/40b581fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..fc661d4
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/40b581fec011001e1d7df1eab75b47a2
@@ -0,0 +1,27 @@
+package com.cimians.openPyro.effects
+{
+ import flash.display.DisplayObject;
+
+ public class FadeEffect extends PyroEffect
+ {
+ public var _alphaFrom:Number = 1;
+ public var _alphaTo:Number = 0;
+ public var _duration:Number = 1;
+
+
+ public function FadeEffect(alphaFrom:Number=1, alphaTo:Number=0, duration:Number=1){
+ this._alphaFrom = alphaFrom;
+ this._alphaTo = alphaTo;
+ this._duration = duration;
+ }
+
+ override public function start():void{
+ _target.alpha = _alphaFrom;
+ var descriptor:EffectDescriptor = new EffectDescriptor(_target, _duration, {alpha:_alphaTo})
+ this.effectDescriptors = [descriptor];
+ super.start();
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a07a9dfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a07a9dfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..1c1833f
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a07a9dfec011001e1d7df1eab75b47a2
@@ -0,0 +1,30 @@
+package org.openPyro.aurora.skinClasses{
+ import com.cimians.openPyro.aurora.AuroraButtonSkin;
+ import com.cimians.openPyro.controls.Button;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.painters.GradientFillPainter;
+
+ public class HDividerSkin extends UIControl
+ {
+ public function HDividerSkin()
+ {
+ super();
+ }
+
+ private var closeButton:Button;
+ override protected function createChildren():void{
+ this.backgroundPainter = new GradientFillPainter([0x999999, 0xffffff, 0x999999]);
+ closeButton = new Button()
+ closeButton.skin = new AuroraButtonSkin()
+ closeButton.percentWidth=100;
+ closeButton.height = 70;
+ addChild(closeButton);
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ closeButton.y = (unscaledHeight-70)/2
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/1025cafdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/1025cafdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..ae913ee
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/1025cafdc011001e1d7df1eab75b47a2
@@ -0,0 +1,105 @@
+package com.cimians.openPyro.collections
+{
+ import com.cimians.openPyro.collections.events.CollectionEvent;
+ import com.cimians.openPyro.collections.events.CollectionEventKind;
+ import com.cimians.openPyro.utils.ArrayUtil;
+
+ import flash.events.EventDispatcher;
+
+ public class ArrayCollection extends EventDispatcher implements ICollection
+ {
+ protected var _originalSource:Array;
+
+ public function ArrayCollection(source:Array = null)
+ {
+ if(!source){
+ source = new Array();
+ }
+ _source = source;
+ _originalSource = source;
+ _iterator = new ArrayIterator(this);
+ }
+
+ private var _source:Array;
+ private var _iterator:ArrayIterator;
+
+ public function set source(array:*):void
+ {
+ _source = array;
+ _originalSource = array;
+ dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGED));
+ }
+
+ public function get source():*
+ {
+ return _source;
+ }
+
+ public function get normalizedArray():Array{
+ return _source;
+ }
+
+ public function get length():int
+ {
+ if(_source){
+ return _source.length;
+ }
+ return 0;
+ }
+
+ public function addItems(items:Array):void{
+ addItemsAt(items, _source.length);
+ }
+
+ public function addItem(obj:*):void{
+ addItems([obj])
+ }
+
+ public function addItemsAt(items:Array, idx:Number):void{
+ var lastData:Object
+ if(idx==0 || _source.length==0){
+ // insert the data at the beginning
+ lastData = null;
+ }
+ else{
+ lastData = _source[idx-1];
+ }
+
+
+ ArrayUtil.insertArrayAtIndex(_source, items, idx);
+ var collectionEvent:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGED);
+ collectionEvent.delta = items;
+
+ collectionEvent.eventNode = lastData;
+ collectionEvent.kind = CollectionEventKind.ADD;
+ dispatchEvent(collectionEvent);
+ }
+
+ public function get iterator():IIterator
+ {
+ return _iterator;
+ }
+
+ public function getItemIndex(ob:Object):int
+ {
+ return _source.indexOf(ob);
+ }
+
+ public function getItemAt(index:int):*{
+ return _source[index];
+ }
+
+ public function removeItems(items:Array):void{
+
+ }
+
+ public function set filterFunction(f:Function):void{
+
+ }
+
+ public function refresh():void{
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/e079ccfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/e079ccfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..14d8730
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/72/e079ccfec011001e1d7df1eab75b47a2
@@ -0,0 +1,119 @@
+package com.cimians.openPyro.layout{
+ import com.cimians.openPyro.core.MeasurableControl;
+ import com.cimians.openPyro.core.UIContainer;
+ import com.cimians.openPyro.effects.EffectDescriptor;
+ import com.cimians.openPyro.effects.PyroEffect;
+
+ import flash.display.DisplayObject;
+
+ public class VLayout implements ILayout, IContainerMeasurementHelper{
+
+ private var _vGap:Number = 0;
+
+ public function VLayout(vGap:Number=0){
+ _vGap = vGap;
+ }
+
+ protected var _container:UIContainer;
+ public function set container(container:UIContainer):void
+ {
+ _container = container;
+ }
+
+ private var _initY:Number = 0;
+ private var _initX:Number = 0;
+
+ public function set initX(n:Number):void
+ {
+ _initX = n;
+ }
+
+ public function set initY(n:Number):void
+ {
+ _initY = n;
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ var maxW:Number=0;
+ for(var i:uint=0; i maxW)
+ {
+ maxW = DisplayObject(children[i]).width
+ }
+ }
+ return maxW;
+ }
+
+
+ public function getMaxHeight(children:Array):Number
+ {
+ var nowY:Number=_initY;
+ for(var i:uint=0; i0){
+ container.explicitlyAllocatedHeight+=_vGap;
+ }
+
+ if(children[i] is MeasurableControl)
+ {
+ var sizeableChild:MeasurableControl = MeasurableControl(children[i]);
+ if(isNaN(sizeableChild.percentUnusedHeight) && isNaN(sizeableChild.percentHeight))
+ {
+ container.explicitlyAllocatedHeight+=sizeableChild.height;
+ }
+ }
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/7b/603cb1f3c211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/7b/603cb1f3c211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..d7d79a0
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/7b/603cb1f3c211001e1d7df1eab75b47a2
@@ -0,0 +1,156 @@
+package org.openPyro.controls.treeClasses
+{
+ import org.openPyro.collections.XMLNodeDescriptor;
+ import org.openPyro.controls.events.TreeEvent;
+ import org.openPyro.controls.listClasses.DefaultListRenderer;
+ import org.openPyro.layout.HLayout;
+ import org.openPyro.painters.TrianglePainter;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.IEventDispatcher;
+ import flash.events.MouseEvent;
+
+ [Event(name="rotatorClick", type="org.openPyro.controls.events.TreeEvent")]
+
+ public class DefaultTreeItemRenderer extends DefaultListRenderer
+ {
+
+ [Embed(source="../../../../../assets/folder.png")]
+ protected var folderIconClass:Class
+
+ public function DefaultTreeItemRenderer()
+ {
+ super();
+ }
+
+ private var folderIcon:DisplayObject;
+ private var leafIcon:DisplayObject;
+ private var rotator:Sprite;
+ private var arrow:Sprite;
+
+ override protected function createChildren():void{
+ super.createChildren()
+ }
+
+ override public function set data(value:Object):void{
+ if(_data && _data is IEventDispatcher){
+ IEventDispatcher(_data).removeEventListener(XMLNodeDescriptor.BRANCH_VISIBILITY_CHANGED, setRotatorDirection);
+ }
+ super.data = value;
+
+ if(_data is IEventDispatcher){
+ IEventDispatcher(_data).addEventListener(XMLNodeDescriptor.BRANCH_VISIBILITY_CHANGED, setRotatorDirection);
+ }
+
+ if(!XMLNodeDescriptor(value).isLeaf()){
+ if(!folderIcon){
+ folderIcon = new folderIconClass();
+ }
+ if(!folderIcon.parent){
+ addChild(folderIcon);
+ }
+ if(!rotator){
+ rotator = new Sprite();
+ rotator.graphics.beginFill(0x000000,0)
+ rotator.graphics.drawRect(0,0, 20,20);
+ rotator.graphics.endFill()
+
+
+ arrow = new Sprite();
+
+ var trianglePainter:TrianglePainter = new TrianglePainter(TrianglePainter.CENTERED);
+ trianglePainter.draw(arrow.graphics, 8,8)
+ //rotator.addChild(arrow)
+ addChild(arrow)
+ arrow.cacheAsBitmap = true;
+
+ rotator.buttonMode = true;
+ rotator.useHandCursor = true
+
+ rotator.addEventListener(MouseEvent.CLICK, onRotatorClick)//,true,1,true)
+ rotator.mouseChildren=false;
+ }
+ if(!rotator.parent){
+ addChild(rotator);
+ }
+ }
+ else{
+ if(folderIcon && folderIcon.parent){
+ removeChild(folderIcon);
+ folderIcon = null;
+ }
+ if(rotator && rotator.parent){
+ removeChild(rotator);
+ rotator = null
+ }
+ if(arrow && arrow.parent){
+ removeChild(arrow);
+ arrow = null
+ }
+
+
+ }
+ this.forceInvalidateDisplayList=true
+ this.invalidateDisplayList()
+ }
+
+ private function onRotatorClick(event:MouseEvent):void{
+ event.stopImmediatePropagation()
+ event.preventDefault();
+ var treeEvent:TreeEvent = new TreeEvent(TreeEvent.ROTATOR_CLICK);
+ treeEvent.nodeDescriptor = XMLNodeDescriptor(_data);
+ dispatchEvent(treeEvent);
+ }
+
+ private function setRotatorDirection(event:Event=null):void{
+
+ if(!rotator || !rotator.parent) return;
+ if(XMLNodeDescriptor(_data).open){
+ arrow.rotation = 90
+ }
+ else{
+ arrow.rotation = 0
+ }
+ }
+
+ private var rendererLayout:HLayout = new HLayout(5)
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(rotator && rotator.parent){
+ rotator.y = (unscaledHeight-rotator.height)/2
+ }
+
+ setRotatorDirection()
+
+ rendererLayout.initX = XMLNodeDescriptor(_data).depth*15+10
+ rendererLayout.initY = 5;
+ var children:Array = []
+ if(rotator && rotator.parent){
+ children.push(rotator)
+ }
+ else{
+ rendererLayout.initX+=10;
+ }
+ if(folderIcon && folderIcon.parent){
+ children.push(folderIcon)
+ }
+ else{
+ rendererLayout.initX+=10
+ }
+ children.push(_labelField);
+
+ if(arrow){
+ arrow.x = rotator.x+ (rotator.width - arrow.width)/2+arrow.width/2
+ arrow.y = rotator.y+ (rotator.height - arrow.height)/2+arrow.height/2;
+
+ }
+
+
+ rendererLayout.layout(children);
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/80/505b58fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/80/505b58fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..4710352
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/80/505b58fec011001e1d7df1eab75b47a2
@@ -0,0 +1,89 @@
+package com.cimians.openPyro.painters
+{
+ import com.cimians.openPyro.core.Padding;
+
+ import flash.display.Graphics;
+
+ /**
+ * Paints a Stroke on the Graphics context of a DisplayObject.
+ * The Painter can be configured to paint only selected sides
+ * of a control
+ */
+ public class StrokePainter implements IPainter
+ {
+ private var _stroke:Stroke;
+ private var _padding:Padding;
+
+ private var _top:Boolean;
+ private var _right:Boolean;
+ private var _bottom:Boolean
+ private var _left:Boolean;
+
+ public function StrokePainter(stroke:Stroke, top:Boolean=true, right:Boolean=true, bottom:Boolean=true, left:Boolean=true ){
+ _stroke = stroke;
+ _top = top
+ _right = right
+ _bottom = bottom
+ _left = left
+ }
+
+ public function setBorderSides( top:Boolean=true, right:Boolean=true, bottom:Boolean=true, left:Boolean=true):void{
+ _top = top
+ _right = right
+ _bottom = bottom
+ _left = left
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function draw(gr:Graphics, w:Number, h:Number):void
+ {
+ var drawX:int = 0;
+ var drawY:int = 0;
+ var drawW:int = w;
+ var drawH:int = h;
+
+ if(_padding)
+ {
+ drawX += _padding.left
+ drawY += _padding.top
+ drawW -= _padding.right + _padding.left
+ drawH -= padding.top + _padding.bottom
+ }
+
+ gr.lineStyle(_stroke.thickness,
+ _stroke.color,
+ _stroke.alpha,
+ _stroke.pixelHinting,
+ _stroke.scaleMode,
+ _stroke.caps,
+ _stroke.joints,
+ _stroke.miterLimit);
+
+ gr.moveTo(drawX, drawY);
+
+ _top?gr.lineTo(drawW, drawY):gr.moveTo(drawW, drawY);
+ _right?gr.lineTo(drawW, drawH):gr.moveTo(drawW, drawH);
+ _bottom?gr.lineTo(drawX, drawH):gr.moveTo(drawX, drawH);
+ _left?gr.lineTo(drawX, drawY):gr.moveTo(drawX, drawY);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function set padding(p:Padding):void
+ {
+ _padding = p
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function get padding():Padding
+ {
+ return _padding;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/83/9056e1fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/83/9056e1fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..b8cfda0
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/83/9056e1fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,201 @@
+package org.openPyro.aurora{
+ import com.cimians.openPyro.controls.Button;
+ import com.cimians.openPyro.controls.Label;
+ import com.cimians.openPyro.controls.events.ButtonEvent;
+ import com.cimians.openPyro.core.IStateFulClient;
+ import com.cimians.openPyro.core.Padding;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.painters.IPainter;
+
+ import flash.display.DisplayObject;
+ import flash.text.TextFormat;
+
+ public class AuroraPainterButtonSkin extends UIControl implements IStateFulClient
+ {
+ /**
+ * A skin for buttons using different painters.
+ * Note: Only padding left and padding top are respected if align is set to
+ * left
+ */
+ public function AuroraPainterButtonSkin()
+ {
+ this.mouseChildren=false;
+ this._padding = new Padding(0,10, 0,0);
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ if(skinnedControl)
+ {
+ skinnedControl.removeEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ }
+ super.skinnedControl = uic;
+ skinnedControl.addEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ if(uic is Button)
+ {
+ this.changeState(null, Button(uic).currentState);
+ updateLabel();
+ }
+ this.buttonMode = true;
+ this.useHandCursor = true;
+
+ }
+
+ protected function onSkinnedControlPropertyChange(event:PyroEvent):void
+ {
+ if(skinnedControl is Button)
+ {
+ updateLabel();
+ }
+ }
+
+ /////////////////// ICON /////////////////
+
+ protected var _icon:DisplayObject;
+ public function set icon(icn:DisplayObject):void
+ {
+ _icon = icn;
+ addChild(_icon);
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ ////////////////// LABEL /////////////////
+
+ protected var _labelFormat:TextFormat = new TextFormat("Arial",11, 0x111111,true);
+
+ public function set labelFormat(fmt:TextFormat):void
+ {
+ _labelFormat = fmt;
+ if(label)
+ {
+ label.textFormat = fmt;
+ }
+ if(skinnedControl)
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ public function get labelFormat():TextFormat
+ {
+ return _labelFormat;
+ }
+
+ protected var label:Label;
+
+ public function updateLabel():void{
+ if(this.skinnedControl is Button){
+ var bttn:Button = Button(this.skinnedControl);
+ if(!bttn.label) return;
+ if(!label){
+ label = new Label();
+ label.textFormat = _labelFormat;
+ addChild(label);
+
+ }
+
+ if(bttn.label != label.text){
+ label.text = bttn.label;
+ }
+ }
+ //this.invalidateDisplayList();
+ }
+
+ private var _labelAlign:String = "center";
+ public function set labelAlign(direction:String):void
+ {
+ _labelAlign = direction;
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ //////////// Colors ///////////////
+
+ public var upPainter:IPainter;
+ public var overPainter:IPainter;
+ public var downPainter:IPainter;
+
+ public function set painters(painter:IPainter):void{
+ upPainter = overPainter = downPainter = painter;
+ this.invalidateDisplayList();
+ }
+
+/* public function set stroke(str:Stroke):void
+ {
+ _stroke = str;
+ this.invalidateDisplayList();
+ } */
+
+
+ ///////////////// Button Behavior ////////
+
+ public function changeState(fromState:String, toState:String):void
+ {
+ if(toState==ButtonEvent.UP)
+ {
+ this.backgroundPainter = upPainter;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ this.backgroundPainter = overPainter;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ this.backgroundPainter = downPainter;
+ }
+ else
+ {
+ this.backgroundPainter = upPainter;
+ }
+ }
+
+ override public function dispose():void
+ {
+ if(this.parent)
+ {
+ this.parent.removeChild(this);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(label){
+
+ label.textField.autoSize = "left";
+ label.y = (unscaledHeight-label.height)/2+_padding.top;
+
+ if(this._labelAlign == "center"){
+ label.x = (unscaledWidth-label.width)/2;
+ }
+ else if(_labelAlign == "left"){
+ label.x = _padding.left;
+ }
+ }
+
+ if(_icon){
+ if(!label){
+ _icon.x = (unscaledWidth-_icon.width)/2;
+ }
+ else{
+ if(_labelAlign == "left"){
+ _icon.x = label.x;
+ label.x += _icon.width+5;
+ }
+ else{
+ _icon.x = label.x-_icon.width-5;
+ }
+ }
+ _icon.y = (unscaledHeight-_icon.height)/2;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/84/103d1c31c411001e1be5a0206e735d1a b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/84/103d1c31c411001e1be5a0206e735d1a
new file mode 100644
index 0000000..4b72710
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/84/103d1c31c411001e1be5a0206e735d1a
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9/c0c4f7fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9/c0c4f7fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..6a1a0a4
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9/c0c4f7fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,47 @@
+package org.openPyro.aurora
+{
+ import com.cimians.openPyro.controls.skins.IComboBoxSkin;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.skins.ISkin;
+
+ import flash.filters.DropShadowFilter;
+
+ public class AuroraComboBoxSkin implements IComboBoxSkin
+ {
+ protected var _buttonSkin:AuroraButtonSkin;
+ protected var _listSkin:AuroraContainerSkin;
+
+ public function AuroraComboBoxSkin() {
+
+ }
+
+ public function get buttonSkin():ISkin
+ {
+ _buttonSkin = new AuroraButtonSkin();
+ _buttonSkin.labelAlign = "left";
+ _buttonSkin.cornerRadius = 10;
+ _buttonSkin.filters = [new DropShadowFilter(.5,90,0,1,0,0)]
+ return _buttonSkin;
+ }
+
+ public function get listSkin():ISkin
+ {
+ _listSkin = new AuroraContainerSkin();
+ return _listSkin;
+ }
+
+ public function dispose():void
+ {
+
+ }
+
+ public function set skinnedControl(control:UIControl):void
+ {
+ if(_buttonSkin)
+ {
+ _buttonSkin.skinnedControl = control;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/98/8096b5fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/98/8096b5fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..84d4bb7
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/98/8096b5fec011001e1d7df1eab75b47a2
@@ -0,0 +1,335 @@
+package com.cimians.openPyro.controls
+{
+ import com.cimians.openPyro.controls.events.ScrollEvent;
+ import com.cimians.openPyro.controls.events.SliderEvent;
+ import com.cimians.openPyro.controls.scrollBarClasses.HScrollBarLayout;
+ import com.cimians.openPyro.controls.scrollBarClasses.VScrollBarLayout;
+ import com.cimians.openPyro.controls.skins.IScrollBarSkin;
+ import com.cimians.openPyro.core.Direction;
+ import com.cimians.openPyro.core.UIContainer;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.skins.ISkin;
+
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ [Event(name="scroll",type="com.cimians.openPyro.controls.events.ScrollEvent")]
+
+ public class ScrollBar extends UIContainer
+ {
+
+ protected var _direction:String;
+ protected var _slider:Slider;
+
+ public function ScrollBar(direction:String)
+ {
+ this._direction = direction;
+ super();
+ _styleName = "ScrollBar"
+ }
+
+ /**
+ * At the very least, a scrollBar needs a slider
+ * or some subclass of it.
+ * Increment and Decrement Buttons are created
+ * automatically when a skin is applied.
+ */
+ override public function initialize():void
+ {
+ if(!_slider)
+ {
+ slider = new Slider(_direction);
+ slider.addEventListener(PyroEvent.UPDATE_COMPLETE, onSliderUpdateComplete)
+ slider.minimum = _minimum
+ slider.maximum = _maximum;
+ }
+ //if(!_layout)
+ //{
+ if(this._direction == Direction.HORIZONTAL)
+ {
+ _layout = new HScrollBarLayout()
+ }
+ else if(this._direction == Direction.VERTICAL)
+ {
+ _layout = new VScrollBarLayout();
+ }
+ //}
+ this._layout.container = this;
+ super.initialize();
+
+ }
+
+ public function get direction():String
+ {
+ return _direction;
+ }
+
+ override public function set skin(skinImpl:ISkin):void
+ {
+ super.skin = skinImpl;
+ if(_skin is IScrollBarSkin)
+ {
+ var scrollBarSkin:IScrollBarSkin = IScrollBarSkin(skinImpl);
+ if(scrollBarSkin.sliderSkin)
+ {
+ if(!_slider)
+ {
+ slider = new Slider(this._direction);
+ slider.minimum = _minimum
+ slider.maximum = _maximum
+ slider.addEventListener(PyroEvent.UPDATE_COMPLETE, onSliderUpdateComplete)
+ }
+ _slider.skin = scrollBarSkin.sliderSkin;
+ }
+ if(scrollBarSkin.incrementButtonSkin)
+ {
+ this.incrementButtonSkin = scrollBarSkin.incrementButtonSkin;
+ }
+ if(scrollBarSkin.decrementButtonSkin)
+ {
+ this.decrementButtonSkin = scrollBarSkin.decrementButtonSkin;
+ }
+ }
+ }
+
+ protected function onSliderUpdateComplete(event:PyroEvent):void
+ {
+ updateScrollUI()
+ }
+
+ protected var _incrementButton:Button;
+ public function set incrementButton(b:Button):void
+ {
+ _incrementButton = b;
+ /*if(_direction == Direction.VERTICAL)
+ {
+ b.percentUnusedWidth=100
+ }
+ if(_direction == Direction.HORIZONTAL)
+ {
+ b.percentUnusedHeight = 100;
+ }*/
+ _incrementButton.addEventListener(MouseEvent.CLICK, onIncrementButtonClick);
+ $addChild(b);
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ public function get incrementButton():Button
+ {
+ return _incrementButton;
+ }
+
+ protected var _incrementButtonSkin:ISkin;
+ public function set incrementButtonSkin(skin:ISkin):void
+ {
+ _incrementButtonSkin = skin;
+ if(!_incrementButton)
+ {
+ incrementButton = new Button();
+ // trigger invalidateDL to retrigger the layout
+ //this.invalidateDisplayList();
+ }
+ _incrementButton.skin = skin;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ protected var _decrementButton:Button;
+ public function set decrementButton(b:Button):void
+ {
+ _decrementButton = b;
+ /*if(_direction == Direction.VERTICAL)
+ {
+ b.percentUnusedWidth=100;
+ }
+ if(_direction == Direction.HORIZONTAL)
+ {
+ b.percentUnusedHeight = 100;
+ }*/
+ _decrementButton.addEventListener(MouseEvent.CLICK, onDecrementButtonClick)
+ $addChild(b);
+ invalidateSize()
+ //invalidateDisplayList();
+ }
+
+ /**
+ * The height/width the scrollbar must scroll
+ * when one of the scroll buttons is clicked on.
+ */
+ public var incrementalScrollDelta:Number=25;
+ private function onDecrementButtonClick(event:Event):void{
+ if(_slider.direction == Direction.HORIZONTAL){
+ _slider.thumbButton.x = Math.max(0, _slider.thumbButton.x - incrementalScrollDelta)
+ }
+ else if(slider.direction == Direction.VERTICAL){
+ _slider.thumbButton.y = Math.max(0, _slider.thumbButton.y - incrementalScrollDelta)
+ }
+ _slider.dispatchScrollEvent()
+
+ }
+ private function onIncrementButtonClick(event:Event):void{
+ //_slider.value = Math.min(1, _slider.value + incrementalScrollDelta/_slider.height)
+ if(_slider.direction == Direction.HORIZONTAL){
+ _slider.thumbButton.x = Math.min(_slider.width-_slider.thumbButton.width,_slider.thumbButton.x + incrementalScrollDelta);
+ }
+ else if(slider.direction == Direction.VERTICAL){
+ _slider.thumbButton.y = Math.min(_slider.height-_slider.thumbButton.height, _slider.thumbButton.y + incrementalScrollDelta)
+ }
+ _slider.dispatchScrollEvent()
+ }
+
+ public function get decrementButton():Button
+ {
+ return _decrementButton;
+ }
+
+ protected var _decrementButtonSkin:ISkin;
+ public function set decrementButtonSkin(skin:ISkin):void
+ {
+ _decrementButtonSkin = skin;
+ if(!_decrementButton)
+ {
+ decrementButton = new Button()
+ }
+ _decrementButton.skin = skin;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ public function set slider(sl:Slider):void{
+
+ if(_slider)
+ {
+ _slider.removeEventListener(SliderEvent.CHANGE, onSliderThumbDrag);
+ removeChild(_slider);
+ _slider = null;
+ }
+
+ _slider = sl;
+ _slider.addEventListener(SliderEvent.CHANGE, onSliderThumbDrag);
+ this.$addChild(_slider);
+ if(_direction == Direction.HORIZONTAL){
+ _slider.explicitWidth = NaN;
+ _slider.percentUnusedWidth = 100;
+ _slider.percentUnusedHeight = 100;
+ }
+ else if(_direction==Direction.VERTICAL){
+ _slider.explicitHeight = NaN;
+ _slider.percentUnusedWidth = 100;
+ _slider.percentUnusedHeight = 100;
+ }
+ _slider.minimum = 0;
+ _slider.maximum = 1;
+ this.invalidateSize()
+ //this.invalidateDisplayList()
+ }
+
+ public function get slider():Slider
+ {
+ return _slider;
+ }
+
+ private var _sliderThumbPosition:Number = 0;
+ protected function onSliderThumbDrag(event:SliderEvent):void
+ {
+ var scrollEvent:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
+ scrollEvent.direction = this._direction;
+ scrollEvent.delta = _slider.value - _sliderThumbPosition;
+ scrollEvent.value = this._slider.value;
+ dispatchEvent(scrollEvent);
+ _sliderThumbPosition = _slider.value;
+ }
+
+ /**
+ * For scrollBars, unless the dimension properites of the
+ * buttons are set, the button's width and heights are
+ * set to the same as the each other to create square
+ * buttons
+ */
+ override public function validateSize():void
+ {
+ super.validateSize();
+
+ }
+
+
+ private var _value:Number = 0;
+ private var _minimum:Number = 0;
+ private var _maximum:Number = 100;
+
+ public function set minimum(value:Number):void
+ {
+ _minimum = value;
+ if(_slider)
+ {
+ _slider.minimum = value;
+ }
+ }
+
+ public function get minimum():Number
+ {
+ return _minimum;
+ }
+
+ public function set maximum(value:Number):void
+ {
+ _maximum = value;
+ if(_slider)
+ {
+ _slider.maximum = value
+ }
+ }
+
+ public function get maximum():Number
+ {
+ return _maximum;
+ }
+
+ public function set value(v:Number):void{
+ _value = v;
+ if(_slider){
+ _slider.value = v;
+ }
+ }
+
+ public function get value():Number
+ {
+ return _slider.value
+ }
+
+
+ protected var _visibleScroll:Number = NaN;
+ protected var _maxScroll:Number=NaN;
+ protected var _scrollButtonSize:Number = NaN;
+
+ public function setScrollProperty(visibleScroll:Number, maxScroll:Number):void
+ {
+
+ //trace("Setting scroll py >> "+visibleScroll, maxScroll, _slider.height, this.height);
+ //trace(">> "+this.height, this.incrementButton.height, this.decrementButton.height);
+ //if(visibleScroll == _visibleScroll && maxScroll == _maxScroll) return;
+
+ _visibleScroll = visibleScroll;
+ _maxScroll = maxScroll;
+ updateScrollUI()
+ }
+
+ protected function updateScrollUI():void
+ {
+ if(!_slider) return;
+ if(this._direction == Direction.VERTICAL)
+ {
+ _scrollButtonSize = Math.floor(_visibleScroll*_slider.height/_maxScroll)
+ _slider.thumbButtonHeight = _scrollButtonSize
+
+ }
+ else if(this._direction == Direction.HORIZONTAL)
+ {
+ _scrollButtonSize = Math.floor(_visibleScroll*_slider.width/_maxScroll);
+ _slider.thumbButtonWidth = _scrollButtonSize;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9a/205a5a2cc211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9a/205a5a2cc211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..9e410be
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/9a/205a5a2cc211001e1d7df1eab75b47a2
@@ -0,0 +1,338 @@
+package
+{
+ import org.openPyro.aurora.AuroraContainerSkin;
+ import org.openPyro.controls.List;
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.core.*;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.layout.*;
+ import org.openPyro.painters.FillPainter;
+ import org.openPyro.painters.GradientFillPainter;
+ import org.openPyro.utils.GlobalTimer;
+ import org.openPyroExamples.HaloTrackSkin;
+ import org.openPyroExamples.SimpleButtonSkin;
+
+ import flash.display.Sprite;
+ import flash.events.*;
+
+ import net.comcast.logging.Logger;
+ import net.comcast.logging.consoles.LogBookConsole;
+
+ [SWF(frameRate="30", backgroundColor="#8899aa")]
+ public class TestList extends Sprite
+ {
+
+ private var list:List;
+ private var container:UIContainer;
+
+ public function TestList()
+ {
+ stage.scaleMode = "noScale"
+ stage.align = "TL"
+
+ Logger.addConsole(new LogBookConsole('_test'))
+ Logger.debug(this, "Init")
+
+ //testSimpleChildren()
+ //testSimpleScroll()
+ testListInLayout()
+
+ stage.addEventListener(Event.RESIZE, onStageResize)
+ var globalTimer:GlobalTimer = new GlobalTimer(stage);
+ globalTimer.start()
+
+ stage.addEventListener(MouseEvent.CLICK, onStageClick);
+ }
+
+ private function onStageClick(event:MouseEvent):void
+ {
+ }
+
+ private function testSimpleScroll():void{
+
+ container = new UIContainer();
+ container.name = "rootContainer";
+ container.addEventListener(PyroEvent.UPDATE_COMPLETE,onContainerUpdate);
+ container.width = stage.stageWidth/3
+ container.height = stage.stageHeight/3;
+ addChild(container);
+ container.backgroundPainter = new FillPainter(0xcccccc)
+ container.skin = new AuroraContainerSkin();
+ //createScrollBarFromStyle2();
+
+
+ container.x = 100
+ container.y = 100;
+
+ var spacer:UIControl = new UIControl();
+ spacer.setSize(800,400)
+ spacer.backgroundPainter = new FillPainter(0xff0000);
+ container.addChild(spacer);
+
+ }
+
+ private var uic:UIControl
+ private function testSimpleChildren():void{
+ uic = new UIControl()
+ uic.name = "uic1"
+ uic.backgroundPainter = new FillPainter(0xcdcdcd);
+ this.uic.width = stage.stageWidth/4;
+ this.uic.height = stage.stageHeight/4;
+ addChild(uic)
+
+
+ uic.x = uic.y = 100;
+
+ var uic2:UIControl = new UIControl()
+ uic2.name = "uic2"
+ uic2.backgroundPainter = new FillPainter(0x00ff00);
+ uic2.percentUnusedWidth = 50
+ uic2.percentUnusedHeight = 50;
+ uic.addChild(uic2)
+
+ uic.addEventListener(PyroEvent.UPDATE_COMPLETE, onContainerUpdate);
+ }
+
+ private var s1:UIControl
+ private var s2:UIControl;
+ private function testListInLayout():void
+ {
+ createList()
+ createContainer();
+
+
+ container.addChild(list);
+ s1 = createShape(0xff0000);
+ container.addChild(s1);
+ //stage.addEventListener(MouseEvent.CLICK, onMouseClick);
+
+ s2 = createShape(0x00ff00);
+ s2.name = "green";
+ container.addChild(s2);
+
+ //container.validateSize()
+ container.layout = new HLayout(0);
+ }
+
+ private function onMouseClick(event:Event):void
+ {
+ stage.removeEventListener(MouseEvent.CLICK, onMouseClick);
+ var s1:UIControl = new UIControl()
+ s1.backgroundPainter = new GradientFillPainter([0xff0000,0x0000ff])
+ s1.width = container.width+100
+ s1.height = container.height+100
+ s1.name = "red"
+ container.addChild(s1);
+
+ stage.dispatchEvent(new Event(Event.RESIZE));
+ }
+
+ private function createContainer():void{
+ container = new UIContainer();
+ container.name = "rootContainer";
+ container.addEventListener(PyroEvent.UPDATE_COMPLETE,onContainerUpdate);
+ container.width = stage.stageWidth/3;
+ container.height = stage.stageHeight/3;
+ addChild(container);
+ container.backgroundPainter = new FillPainter(0xcccccc)
+ container.skin = new AuroraContainerSkin();
+ //createScrollBarFromStyle2();
+
+
+ container.x = 100
+ container.y = 100;
+
+
+
+ }
+
+ private function onContainerUpdate(event:PyroEvent):void
+ {
+// trace("[container]"+container.height, container.measuredHeight)
+ /*
+ trace("Container w/h : "+container.width, container.height)
+ if(list){
+ trace("list w/h: ", list.width, list.height)
+ }
+ if(s1){
+ trace("S1 w/h: ", s1.width, s1.height)
+ }
+
+ if(s2){
+ trace("s2 w/h: ", s2.width, s2.height)
+ }
+ */
+
+ }
+
+ private function createShape(color:uint):UIControl
+ {
+ var spacer:UIControl = new UIControl();
+ spacer.setSize("60%","100%")
+ spacer.backgroundPainter = new FillPainter(color);
+ return spacer;
+ }
+
+ private function createList():List{
+ list = new List();
+ list.addEventListener(MouseEvent.CLICK, onListClick)
+ list.width = 200
+ list.percentUnusedHeight = 100;
+
+ var layout:VLayout = new VLayout(0);
+ list.layout = layout;
+
+ var rendererFactory:ClassFactory = new ClassFactory(Renderer);
+ rendererFactory.properties = {width:500, height:30}
+ list.itemRenderer = rendererFactory;
+ list.dataProvider = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
+
+ list.skin = new AuroraContainerSkin()
+ return list;
+ }
+
+ private function onListClick(event:MouseEvent):void
+ {
+ //container.horizontalScrollBar.visible = false;
+ //trace('list height: '+list.height, 'list measuredht: '+list.measuredHeight, 'hScrollBar y'+list.horizontalScrollBar.y)
+ }
+
+ public function onStageResize(event:Event):void{
+ //trace(container.width, container.height)
+ if(uic){
+ this.uic.width = stage.stageWidth/4;
+ this.uic.height = stage.stageHeight/4;
+ }
+ if(!container) return;
+ container.width = stage.stageWidth/3;
+ container.height = stage.stageHeight/3;
+ }
+
+ private function createScrollBarFromStyle():void
+ {
+ /*var vSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin());
+ var vScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(vSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var hSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin(Math.PI/2));
+ var hScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(hSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var listSkin:UIContainerSkin = new UIContainerSkin(vScrollBarSkin,hScrollBarSkin);
+
+ list.skin = listSkin;
+ */
+ }
+
+ private function createScrollBarFromStyle2():void
+ {
+ /*var vSliderSkin:SliderSkin = new SliderSkin(new SimpleButtonSkin(), new HaloTrackSkin());
+ var vScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(vSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var hScrubberSkin:SimpleButtonSkin = new SimpleButtonSkin()
+ hScrubberSkin.name = "hScrubber"
+ var hSliderSkin:SliderSkin = new SliderSkin(hScrubberSkin, new HaloTrackSkin(Math.PI/2));
+ var hScrollBarSkin:ScrollBarSkin = new ScrollBarSkin(hSliderSkin, new SimpleButtonSkin(0), new SimpleButtonSkin(0));
+
+ var listSkin:UIContainerSkin = new UIContainerSkin(vScrollBarSkin,hScrollBarSkin);
+
+ container.skin = listSkin;
+ */
+ }
+
+ private function createVScrollBar():ScrollBar{
+
+ var verticalScrollBar:ScrollBar = new ScrollBar(Direction.VERTICAL);
+ verticalScrollBar.width = 15;
+ verticalScrollBar.height = 300;
+ addChild(verticalScrollBar)
+
+ verticalScrollBar.slider.trackSkin = new HaloTrackSkin()
+ verticalScrollBar.slider.thumbSkin = new SimpleButtonSkin()
+ verticalScrollBar.incrementButtonSkin = new SimpleButtonSkin()
+ verticalScrollBar.decrementButtonSkin = new SimpleButtonSkin();
+ return verticalScrollBar
+
+ }
+ }
+}
+
+
+import flash.display.Sprite;
+import flash.display.Graphics;
+import org.openPyro.core.UIControl;
+import flash.text.TextField;
+import net.comcast.logging.Logger;
+import net.comcast.logging.consoles.TraceConsole;
+import org.openPyro.core.IDataRenderer;
+import flash.events.MouseEvent;
+
+internal class Renderer extends UIControl implements IDataRenderer{
+
+ private var txt:TextField;
+
+ public function Renderer(){
+
+ //Logger.addConsole(new TraceConsole());
+
+ txt = new TextField()
+ //txt.border=true;
+ addChild(txt);
+ txt.autoSize = "left";
+ txt.wordWrap=true;
+ txt.selectable=false;
+ //this.addEventListener(MouseEvent.CLICK, onMouseClick)
+ //this.height = 30;
+ }
+
+
+ private var addHt:Number = 0
+ private function onMouseClick(event:MouseEvent):void{
+ addHt = 100;
+ this.invalidateSize();
+ }
+
+ public function set data(d:Object):void{
+ this.txt.text = String(d)
+ invalidateSize();
+ }
+
+ private var _data:String
+ public function set label(s:String):void{
+ _data = s;
+ this.txt.text = s;
+ this.invalidateSize()
+ }
+
+ override public function measure():void{
+ super.measure()
+
+ //if(this.txt.text == "1"){
+ //trace(this.txt.text + ':measuring height: '+ _measuredHeight);
+ //}
+ //this.invalidateDisplayList()
+ //trace('[ ROOT set height ]'+_measuredHeight)
+ }
+
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ if(this.txt.text == "1"){
+ //trace('updating dl: '+unscaledHeight);
+ }
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ txt.width = unscaledWidth-20
+ txt.x = 10
+ txt.y = 10
+ txt.height = 20
+
+ var gr:Graphics = this.graphics;
+ gr.clear()
+ gr.lineStyle(1, 0x6ab0f7)
+ gr.beginFill(0xcccccc)
+ gr.drawRect(0,0,unscaledWidth,unscaledHeight);
+ gr.endFill();
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a1/100238fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a1/100238fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..7cebef6
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a1/100238fec011001e1d7df1eab75b47a2
@@ -0,0 +1,52 @@
+package com.cimians.openPyro.managers.toolTipClasses
+{
+ import com.cimians.openPyro.controls.Label;
+ import com.cimians.openPyro.core.IDataRenderer;
+ import com.cimians.openPyro.core.Padding;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.painters.FillPainter;
+
+ import flash.events.Event;
+ import flash.filters.DropShadowFilter;
+ import flash.text.TextFormat;
+
+ public class DefaultToolTipRenderer extends Label implements IDataRenderer
+ {
+ protected var _labelFormat:TextFormat;
+
+ public function DefaultToolTipRenderer()
+ {
+ super();
+ }
+
+ override protected function createChildren():void{
+ //_label = new Label()
+ super.createChildren()
+ this.padding = new Padding(0,5,0,5);
+ if(!_labelFormat){
+ _labelFormat = new TextFormat("Arial", 12, 0);
+ }
+ this.textFormat = _labelFormat;
+ var painter:FillPainter = new FillPainter(0xffffcc,1)
+ this.backgroundPainter = painter;
+ this.filters = [new DropShadowFilter(2,90,0,.5,2,2)]
+ if(_data){
+ data = _data;
+ }
+ }
+
+ private var _data:Object;
+ public function set data(d:Object):void{
+ _data = d;
+ this.text = (d) as String;
+
+ }
+
+ public function get data():Object{
+ return _data;
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0e87bfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0e87bfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..731e8a0
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0e87bfec011001e1d7df1eab75b47a2
@@ -0,0 +1,84 @@
+package org.openPyro.aurora{
+ import com.cimians.openPyro.controls.skins.IScrollBarSkin;
+ import com.cimians.openPyro.controls.skins.ISliderSkin;
+ import com.cimians.openPyro.core.Direction;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.shapes.Triangle;
+ import com.cimians.openPyro.skins.ISkin;
+
+ public class AuroraScrollBarSkin implements IScrollBarSkin
+ {
+
+ public var direction:String = Direction.VERTICAL ;
+
+ private var _incrementButtonSkin:AuroraButtonSkin;
+ private var _decrementButtonSkin:AuroraButtonSkin;
+ private var _sliderSkin:AuroraSliderSkin;
+
+ public function AuroraScrollBarSkin()
+ {
+ }
+
+ public function get incrementButtonSkin():ISkin
+ {
+ _incrementButtonSkin = new AuroraButtonSkin();
+ if(direction == Direction.VERTICAL){
+ _incrementButtonSkin.icon = new Triangle(Direction.DOWN, 6,6)
+ }
+ else if(direction == Direction.HORIZONTAL){
+ _incrementButtonSkin.icon = new Triangle(Direction.RIGHT, 6,6)
+ }
+ _incrementButtonSkin.width = 15
+ _incrementButtonSkin.height= 15
+ return _incrementButtonSkin
+ }
+
+ public function get decrementButtonSkin():ISkin
+ {
+ _decrementButtonSkin = new AuroraButtonSkin();
+ if(direction == Direction.VERTICAL){
+ _decrementButtonSkin.icon = new Triangle(Direction.UP, 6,6)
+ }
+ else if(direction == Direction.HORIZONTAL){
+ _decrementButtonSkin.icon = new Triangle(Direction.LEFT, 6,6)
+ }
+ _decrementButtonSkin.width = 15
+ _decrementButtonSkin.height= 15
+ return _decrementButtonSkin
+
+ }
+
+ public function set skinnedControl(uic:UIControl):void
+ {
+ }
+
+ public function get sliderSkin():ISliderSkin
+ {
+ _sliderSkin = new AuroraSliderSkin();
+ if(direction == Direction.HORIZONTAL)
+ {
+ _sliderSkin.trackGradientRotation = Math.PI/2
+ }
+ return _sliderSkin;
+ }
+
+ public function dispose():void
+ {
+ if(_incrementButtonSkin && _incrementButtonSkin.parent)
+ {
+ _incrementButtonSkin.parent.removeChild(_incrementButtonSkin);
+ }
+ _incrementButtonSkin = null;
+
+ if(_decrementButtonSkin && _decrementButtonSkin.parent)
+ {
+ _decrementButtonSkin.parent.removeChild(_decrementButtonSkin);
+ }
+ _decrementButtonSkin = null;
+ if(_sliderSkin){
+ _sliderSkin.dispose();
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a3/e06068fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a3/e06068fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..4234815
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a3/e06068fec011001e1d7df1eab75b47a2
@@ -0,0 +1,44 @@
+package org.openPyro.aurora{
+ import com.cimians.openPyro.aurora.AuroraScrollBarSkin;
+ import com.cimians.openPyro.controls.skins.IScrollBarSkin;
+ import com.cimians.openPyro.controls.skins.IScrollableContainerSkin;
+ import com.cimians.openPyro.core.Direction;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.skins.ISkin;
+
+ public class AuroraContainerSkin implements IScrollableContainerSkin
+ {
+
+ private var _horizontalScrollBarSkin:AuroraScrollBarSkin;
+ private var _verticalScrollBarSkin:AuroraScrollBarSkin;
+
+ public function AuroraContainerSkin() {
+
+ }
+
+ public function get verticalScrollBarSkin():IScrollBarSkin
+ {
+ _verticalScrollBarSkin = new AuroraScrollBarSkin()
+ _verticalScrollBarSkin.direction = Direction.VERTICAL;
+ return _verticalScrollBarSkin;
+ }
+
+ public function get horizontalScrollBarSkin():IScrollBarSkin
+ {
+ _horizontalScrollBarSkin = new AuroraScrollBarSkin();
+ _horizontalScrollBarSkin.direction = Direction.HORIZONTAL;
+ return _horizontalScrollBarSkin;
+ }
+
+ public function set skinnedControl(uic:UIControl):void
+ {
+ }
+
+ public function dispose():void
+ {
+ _verticalScrollBarSkin.dispose();
+ _horizontalScrollBarSkin.dispose();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0cdc4fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0cdc4fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..424a896
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/a7/e0cdc4fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,18 @@
+package com.cimians.openPyro.skins{
+ import com.cimians.openPyro.core.UIControl;
+
+ import flash.display.IBitmapDrawable;
+
+ /**
+ * Defines an interface that all DisplayObjects
+ * that can be applied as Skins to OpenPyro controls
+ */
+ public interface ISkin extends IBitmapDrawable{
+
+ //function get selector():String;
+
+ function set skinnedControl(uic:UIControl):void;
+ function dispose():void;
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/aa/305bc8fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/aa/305bc8fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..1836b55
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/aa/305bc8fec011001e1d7df1eab75b47a2
@@ -0,0 +1,12 @@
+package com.cimians.openPyro.skins{
+
+ /**
+ * Defines the interface that all OpenPyro controls
+ * that can have skins applied to them must implement
+ */
+ public interface ISkinClient
+ {
+ function set skin(skinImpl:ISkin):void;
+ function get styleName():String;
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ab/40165dfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ab/40165dfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..1494308
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ab/40165dfec011001e1d7df1eab75b47a2
@@ -0,0 +1,786 @@
+package com.cimians.openPyro.core{
+ import com.cimians.openPyro.controls.ScrollBar;
+ import com.cimians.openPyro.controls.events.ScrollEvent;
+ import com.cimians.openPyro.controls.skins.IScrollableContainerSkin;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.layout.AbsoluteLayout;
+ import com.cimians.openPyro.layout.IContainerMeasurementHelper;
+ import com.cimians.openPyro.layout.ILayout;
+
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+
+ /**
+ * UIContainers extend UIControls and introduce
+ * the concept of scrolling and layouts. If the
+ * bounds of the children of a UIContainer, they
+ * get clipped by the mask layer on top.
+ *
+ * todo: Create UIContainer.clipContent = false/true function
+ *
+ * @see #layout
+ */
+ public class UIContainer extends UIControl{
+
+ protected var contentPane:UIControl;
+ protected var _horizontalScrollPolicy:Boolean = true
+ protected var _verticalScrollPolicy:Boolean = true;
+
+ public function UIContainer(){
+ super();
+ contentPane = new UIControl();
+ contentPane.name = "contentPane_"+this.name
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function initialize():void
+ {
+ /*
+ Since the first time the container is
+ validated, it may cause scrollbars to
+ be added immediately, the contentPane
+ is added before any of that so that
+ scrollbars are not placed under it
+ */
+ $addChild(contentPane);
+ this.addEventListener(MouseEvent.MOUSE_WHEEL, handleMouseWheel);
+
+ super.initialize();
+
+ contentPane.percentUnusedWidth = 100;
+ contentPane.percentUnusedHeight = 100;
+ contentPane.doOnAdded()
+
+ this.addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver, true)
+
+ }
+
+ public static var mouseOverDisabled:Boolean = false;
+
+ private function handleMouseOver(event:MouseEvent):void{
+ if(UIContainer.mouseOverDisabled){
+ event.stopImmediatePropagation()
+ event.preventDefault()
+ }
+ }
+
+ public function set horizontalScrollPolicy(b:Boolean):void{
+ _horizontalScrollPolicy = b;
+ }
+ public function get horizontalScrollPolicy():Boolean{
+ return _horizontalScrollPolicy
+ }
+
+ public function set verticalScrollPolicy(b:Boolean):void{
+ _verticalScrollPolicy = b;
+ }
+
+ public function get verticalScrollPolicy():Boolean{
+ return _verticalScrollPolicy;
+ }
+
+
+ override public function addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ var ch:DisplayObject = contentPane.addChild(child);
+ if(child is MeasurableControl)
+ {
+ var control:MeasurableControl = child as MeasurableControl;
+ control.parentContainer = this;
+ control.addEventListener(PyroEvent.SIZE_INVALIDATED, invalidateSize);
+ control.addEventListener(PyroEvent.SIZE_CHANGED, queueValidateDisplayList);
+ control.doOnAdded()
+ }
+ return ch;
+ }
+
+ override public function getChildByName(name:String):DisplayObject{
+ return contentPane.getChildByName(name);
+ }
+
+ override public function removeChild(child:DisplayObject):DisplayObject{
+ return contentPane.removeChild(child)
+ }
+
+ public function removeAllChildren():void{
+ while(this.contentPane.numChildren>0){
+ contentPane.removeChildAt(0);
+ }
+ }
+
+ override protected function doChildBasedValidation():void
+ {
+ var child:DisplayObject;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ super.measuredWidth = _layout.getMaxWidth(this.layoutChildren) + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ super.measuredHeight = _layout.getMaxHeight(this.layoutChildren) + _padding.top + _padding.bottom;
+ }
+ }
+
+
+ private var _explicitlyAllocatedWidth:Number = 0;
+ private var _explicitlyAllocatedHeight:Number = 0;
+
+ /**
+ * This property are modified by IContainerMeasurementHelpers.
+ * which most container layouts implement.
+ *
+ * @see com.cimians.openPyro.layout.IContainerMeasurementHelper
+ */
+ public function set explicitlyAllocatedWidth(w:Number):void
+ {
+ _explicitlyAllocatedWidth = w;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitlyAllocatedWidth():Number
+ {
+ return _explicitlyAllocatedWidth ;
+ }
+
+ /**
+ * This property are modified by IContainerMeasurementHelpers.
+ * which most container layouts implement.
+ *
+ * @see com.cimians.openPyro.layout.IContainerMeasurementHelper
+ */
+ public function set explicitlyAllocatedHeight(h:Number):void
+ {
+ _explicitlyAllocatedHeight = h;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitlyAllocatedHeight():Number
+ {
+ return _explicitlyAllocatedHeight;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * If validateSize is called on UIContainers, the container does
+ * a check at the end to see if the children layout requires a
+ * scroll and if the scrollbar needs to be created. If so, it
+ * creates the scrollbars and calls validateSize again.
+ */
+ override public function validateSize():void
+ {
+ _contentHeight = this._layout.getMaxHeight(this.layoutChildren);
+ _contentWidth = this._layout.getMaxWidth(this.layoutChildren);
+ _explicitlyAllocatedWidth = _padding.left+_padding.right
+ _explicitlyAllocatedHeight = _padding.top+_padding.bottom;
+ var layoutChildrenArray:Array = layoutChildren;
+
+ _layout.initX = this.padding.left;
+ _layout.initY = this.padding.top;
+
+ if(_layout is IContainerMeasurementHelper)
+ {
+ IContainerMeasurementHelper(_layout).calculateSizes(layoutChildrenArray, this)
+ }
+ super.validateSize();
+
+ if(this._verticalScrollBar && _verticalScrollBar.visible)
+ {
+ this.explicitlyAllocatedWidth-=_verticalScrollBar.width
+ _verticalScrollBar.setScrollProperty(this.scrollHeight, this._contentHeight);
+ }
+
+ if(this._horizontalScrollBar && _horizontalScrollBar.visible)
+ {
+ this.explicitlyAllocatedHeight-=_horizontalScrollBar.height
+ _horizontalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ if(_verticalScrollBar)
+ {
+ if(_horizontalScrollBar && _horizontalScrollBar.visible){
+ _verticalScrollBar.height = this.height - _horizontalScrollBar.height//setActualSize(_verticalScrollBar.width,this.height - _horizontalScrollBar.height);
+ }
+ else{
+ _verticalScrollBar.height = this.height
+ }
+ }
+ if(_horizontalScrollBar)
+ {
+ if(_verticalScrollBar && _verticalScrollBar.visible)
+ {
+ _horizontalScrollBar.width = this.width-_verticalScrollBar.width;
+ }
+ else{
+ _horizontalScrollBar.width = this.width;
+ }
+ }
+ checkRevalidation()
+ }
+
+ protected var _layout:ILayout = new AbsoluteLayout()
+ protected var layoutInvalidated:Boolean = true;
+ /**
+ * Containers can be assigned different layouts
+ * which control the positioning of the
+ * different controls.
+ *
+ * @see com.cimians.openPyro.layout
+ */
+ public function get layout():ILayout
+ {
+ return _layout;
+ }
+
+ /**
+ * @private
+ */
+ public function set layout(l:ILayout):void
+ {
+ if(_layout == l) return
+ layoutInvalidated = true;
+ _layout = l;
+ _layout.container = this;
+ if(!initialized) return;
+
+ this.invalidateSize()
+ }
+
+ /**
+ * Returns an Array of displayObjects whose positions
+ * are controlled by the ILayout object.
+ * These do not include, for example, the scrollbars.
+ *
+ * @see com.cimians.openPyro.layout
+ */
+ public function get layoutChildren():Array
+ {
+ var children:Array = new Array();
+ if(!contentPane) return children;
+ for(var i:uint=0; i this.height)
+ {
+ setVerticalScrollBar();
+ }
+ }
+
+ protected var scrollBarsChanged:Boolean = false;
+
+ protected function checkRevalidation():void
+ {
+ if(_horizontalScrollPolicy){
+ checkNeedsHScrollBar()
+ }
+ if(_verticalScrollPolicy)
+ {
+ checkNeedsVScrollBar()
+ }
+
+ if(needsHorizontalScrollBar &&
+ this._skin &&
+ this._skin is IScrollableContainerSkin &&
+ IScrollableContainerSkin(_skin).horizontalScrollBarSkin)
+ {
+ if(!_horizontalScrollBar)
+ {
+ createHScrollBar();
+ }
+ if(_horizontalScrollBar.visible==false)
+ {
+ _horizontalScrollBar.visible = true;
+ scrollBarsChanged = true;
+ }
+ }
+ else
+ {
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true)
+ {
+ _horizontalScrollBar.visible = false;
+ scrollBarsChanged = true;
+ }
+ }
+ if(needsVerticalScrollBar &&
+ this._skin &&
+ this._skin is IScrollableContainerSkin &&
+ IScrollableContainerSkin(_skin).verticalScrollBarSkin)
+ {
+ if(!_verticalScrollBar)
+ {
+ createVScrollBar();
+ }
+ if(_verticalScrollBar.visible == false)
+ {
+ _verticalScrollBar.visible = true;
+ scrollBarsChanged=true;
+ }
+ }
+ else
+ {
+ if(_verticalScrollBar && _verticalScrollBar.visible == true)
+ {
+ _verticalScrollBar.visible = false;
+ scrollBarsChanged = true;
+ }
+ }
+
+ if(scrollBarsChanged)
+ {
+ scrollBarsChanged = false;
+ dispatchEvent(new PyroEvent(PyroEvent.SCROLLBARS_CHANGED));
+ validateSize();
+ }
+ }
+
+ protected var _contentHeight:Number = 0;
+ protected var _contentWidth:Number = 0;
+
+ public function get contentHeight():Number{
+ return _contentHeight;
+ }
+ public function get contentWidth():Number{
+ return _contentWidth;
+ }
+
+
+ protected var needsVerticalScrollBar:Boolean = false;
+ protected var needsHorizontalScrollBar:Boolean = false;
+
+ protected function checkNeedsVScrollBar():void
+ {
+ //_contentHeight = this._layout.getMaxHeight(this.layoutChildren);
+ if(_contentHeight > this.height){
+ needsVerticalScrollBar = true
+ }
+ else{
+ needsVerticalScrollBar = false;
+ }
+ }
+ protected function checkNeedsHScrollBar():void
+ {
+ _contentWidth = this._layout.getMaxWidth(this.layoutChildren);
+ if(_contentWidth > this.width){
+ needsHorizontalScrollBar = true
+ }
+ else{
+ needsHorizontalScrollBar = false;
+ }
+ }
+
+ protected function createVScrollBar():void
+ {
+ _verticalScrollBar = new ScrollBar(Direction.VERTICAL);
+ _verticalScrollBar.maximum = 1;
+ _verticalScrollBar.minimum = 0;
+ _verticalScrollBar.incrementalScrollDelta = _verticalScrollIncrement;
+ _verticalScrollBar.name = "vscrollbar_"+this.name;
+ _verticalScrollBar.width = 15;
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = true;
+ })
+ _verticalScrollBar.addEventListener(PyroEvent.SIZE_VALIDATED, onVerticalScrollBarSizeValidated);
+ _verticalScrollBar.addEventListener(PyroEvent.UPDATE_COMPLETE, onVScrollBarUpdateComplete);
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+
+ _verticalScrollBar.skin = IScrollableContainerSkin(_skin).verticalScrollBarSkin;
+ _verticalScrollBar.addEventListener(ScrollEvent.SCROLL, onVerticalScroll)
+ _verticalScrollBar.doOnAdded()
+ _verticalScrollBar.visible = false;
+ $addChild(_verticalScrollBar);
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ }
+
+ protected function hideVScrollBar():void
+ {
+ if(_verticalScrollBar)
+ {
+ _verticalScrollBar.visible=false;
+ }
+ }
+
+ protected function createHScrollBar():void
+ {
+ _horizontalScrollBar = new ScrollBar(Direction.HORIZONTAL);
+ _horizontalScrollBar.maximum = 1
+ _horizontalScrollBar.minimum = 0
+ _horizontalScrollBar.incrementalScrollDelta = _horizontalScrollIncrement
+ _horizontalScrollBar.name = "hscrollbar_"+this.name;
+ _horizontalScrollBar.height = 15;
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = true;
+ })
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ _horizontalScrollBar.addEventListener(PyroEvent.SIZE_VALIDATED, onHorizontalScrollBarSizeValidated)
+ _horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, onHorizontalScroll);
+ _horizontalScrollBar.parentContainer = this;
+ _horizontalScrollBar.doOnAdded()
+ _horizontalScrollBar.skin = IScrollableContainerSkin(_skin).horizontalScrollBarSkin;
+ _horizontalScrollBar.visible = false;
+ $addChild(_horizontalScrollBar);
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ }
+
+ protected function onHorizontalScrollBarSizeValidated(event:PyroEvent):void
+ {
+ _horizontalScrollBar.removeEventListener(PyroEvent.SIZE_VALIDATED, onHorizontalScrollBarSizeValidated)
+ _horizontalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ protected function onVerticalScrollBarSizeValidated(event:PyroEvent):void
+ {
+ _verticalScrollBar.removeEventListener(PyroEvent.SIZE_VALIDATED, onVerticalScrollBarSizeValidated)
+ _verticalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ protected function hideHScrollBar():void
+ {
+ if(_horizontalScrollBar)
+ {
+ _horizontalScrollBar.visible=false;
+ }
+ }
+
+ protected function setVerticalScrollBar():void{
+ if(_verticalScrollBar.parent != this)
+ {
+ addChild(_verticalScrollBar);
+ }
+ _verticalScrollBar.height = this.height;
+ }
+
+ protected function handleMouseWheel(event:MouseEvent):void{
+ if(this.verticalScrollBar){
+ var scrollDelta:Number = verticalScrollBar.value - event.delta*.02;
+ scrollDelta = Math.min(scrollDelta, 1)
+ scrollDelta = Math.max(0, scrollDelta);
+ verticalScrollBar.value = scrollDelta;
+ }
+ }
+
+ public function set horizontalScrollPosition(value:Number):void{
+ if(!_horizontalScrollBar) return
+ if(value > 1){
+ throw new Error("UIContainer scrollpositions range from 0 to 1")
+ }
+ this._horizontalScrollBar.value = value;
+ }
+
+ public function get horizontalScrollPosition():Number{
+ return _horizontalScrollBar.value;
+ }
+
+ private var _horizontalScrollIncrement:Number = 25;
+ public function set horizontalScrollIncrement(n:Number):void{
+ _horizontalScrollIncrement = n;
+ if(_horizontalScrollBar){
+ _horizontalScrollBar.incrementalScrollDelta = n;
+ }
+ }
+
+ public function get horizontalScrollIncrement():Number{
+ return _horizontalScrollIncrement
+ }
+
+ private var _verticalScrollIncrement:Number = 25;
+ public function set verticalScrollIncrement(n:Number):void{
+ _verticalScrollIncrement = n;
+ if(_verticalScrollBar){
+ _verticalScrollBar.incrementalScrollDelta = n;
+ }
+ }
+
+ public function get verticalScrollIncrement():Number{
+ return _verticalScrollIncrement
+ }
+
+
+ /**
+ * Sets the scrollposition of the vertical scrollbar
+ * The valid values are between 0 and 1
+ */
+ public function set verticalScrollPosition(value:Number):void{
+ if(!_verticalScrollBar) return;
+ if(value > 1){
+ throw new Error("UIContainer scrollpositions range from 0 to 1")
+ }
+ this._verticalScrollBar.value = value;
+ }
+
+ public function get verticalScrollPosition():Number{
+ return _verticalScrollBar.value;
+ }
+
+ protected var scrollY:Number = 0;
+ protected var scrollX:Number = 0;
+
+ /**
+ * Event listener for when the vertical scrollbar is
+ * used.
+ */
+ protected function onVerticalScroll(event:ScrollEvent):void
+ {
+ var scrollAbleHeight:Number = this._contentHeight - this.height;
+ if(_horizontalScrollBar)
+ {
+ scrollAbleHeight+=_horizontalScrollBar.height;
+ }
+ scrollY = event.value*scrollAbleHeight
+ setContentMask()
+ }
+
+ /**
+ * Event listener for when the horizontal scrollbar is
+ * used.
+ */
+ protected function onHorizontalScroll(event:ScrollEvent):void
+ {
+ var scrollAbleWidth:Number = this.contentWidth - this.width;
+ if(_verticalScrollBar)
+ {
+ scrollAbleWidth+=_verticalScrollBar.width;
+ }
+ scrollX = event.value*scrollAbleWidth
+ setContentMask()
+ }
+
+ /**
+ * Unlike UIControls, UIContainers do not apply a skin directly on
+ * themselves but interpret the skin file and apply them to the
+ * different children. So updateDisplayList here does not call
+ * super.updateDisplayList()
+ *
+ * @inheritDoc
+ */
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ if(layoutInvalidated)
+ {
+ doLayoutChildren()
+ }
+ if(_verticalScrollBar && _verticalScrollBar.visible==true)
+ {
+ _verticalScrollBar.x = this.width - _verticalScrollBar.width;
+ }
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true)
+ {
+ _horizontalScrollBar.y = this.height - _horizontalScrollBar.height;
+ }
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0,unscaledWidth, unscaledHeight);
+ this.setContentMask()
+ }
+ }
+
+
+ protected var _clipContent:Boolean = true;
+
+ public function set clipContent(b:Boolean):void
+ {
+ if(!b) this.scrollRect = null;
+ _clipContent = b;
+ }
+
+ public function get clipContent():Boolean
+ {
+ return _clipContent;
+ }
+
+ /**
+ * Lays out the layoutChildren based ILayout
+ * object.
+ *
+ * @see #layoutChildren
+ */
+ override public function doLayoutChildren():void
+ {
+ _layout.layout(this.layoutChildren);
+ layoutInvalidated = false;
+ }
+
+ /**
+ * Event listener for the vertical scrollbar's
+ * creation and validation event.
+ */
+ protected function onVScrollBarUpdateComplete(event:PyroEvent):void
+ {
+ if(_horizontalScrollBar){
+ _horizontalScrollBar.y = _verticalScrollBar.height;
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0, this.width, this.height);
+ this.setContentMask()
+ }
+ }
+ }
+
+ /**
+ * Event listener for the horizontal scrollbar's
+ * creation and validation event.
+ */
+ protected function onHScrollBarUpdateComplete(event:PyroEvent):void
+ {
+ if(_verticalScrollBar){
+ _verticalScrollBar.x = _horizontalScrollBar.width;
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0, this.width, this.height);
+ this.setContentMask()
+ }
+ }
+ }
+
+ protected function setContentMask():void{
+ var contentW:Number = width
+ var contentH:Number = height;
+
+ if(_verticalScrollBar && _verticalScrollBar.visible==true){
+ contentW-=_verticalScrollBar.width
+ }
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true){
+ contentH-=_horizontalScrollBar.height
+ }
+ if(_verticalScrollBar){
+
+ }
+ var rect:Rectangle = new Rectangle(scrollX,scrollY,contentW,contentH);
+
+ this.contentPane.scrollRect = rect
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ac/b0cfbffec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ac/b0cfbffec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..7d17edf
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ac/b0cfbffec011001e1d7df1eab75b47a2
@@ -0,0 +1,452 @@
+package com.cimians.openPyro.core{
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.managers.SkinManager;
+ import com.cimians.openPyro.managers.TooltipManager;
+ import com.cimians.openPyro.painters.IPainter;
+ import com.cimians.openPyro.skins.ISkin;
+ import com.cimians.openPyro.skins.ISkinClient;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ /**
+ * The UIControl is the basic building block for
+ * pyro controls. UIControls extend from Measurable control so
+ * can use all the different sizing properties like explicit or percent widths/heights.
+ * UIControls can also include other UIControls
+ * as children but cannot use layouts to position them. To use layouts,
+ * use UIContainers.
+ *
+ * UIControls also implement the ISkinClient interface so can be skinned and
+ * the ISkin interface so themselves can be used as base classes for skins
+ */
+ public class UIControl extends MeasurableControl implements ISkinClient, ISkin{
+
+ public function UIControl() {
+ super();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function initialize():void
+ {
+ super.initialize()
+ if(_skin || !_styleName ) return;
+ SkinManager.getInstance().registerSkinClient(this, _styleName);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function addChild(child:DisplayObject):DisplayObject
+ {
+ return addChildAt(child, this.numChildren);
+ }
+
+
+ /**
+ * @inheritDoc
+ */
+ override public function addChildAt(child:DisplayObject,index:int):DisplayObject
+ {
+ var ch:DisplayObject = super.$addChildAt(child, index);
+ if(child is MeasurableControl)
+ {
+ var control:MeasurableControl = child as MeasurableControl;
+ control.parentContainer = this;
+ control.addEventListener(PyroEvent.SIZE_INVALIDATED, invalidateSize);
+ control.addEventListener(PyroEvent.SIZE_CHANGED, queueValidateDisplayList);
+ control.doOnAdded()
+ }
+ this.invalidateSize()
+ return ch
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function measure():void{
+ if(isNaN(this._explicitWidth) &&
+ (!isNaN(this._percentWidth) || !isNaN(_percentUnusedWidth)))
+ {
+ calculateMeasuredWidth()
+ }
+ if(isNaN(this._explicitHeight) &&
+ (!isNaN(this._percentHeight) || !isNaN(_percentUnusedHeight)))
+ {
+ calculateMeasuredHeight();
+ }
+ this.needsMeasurement=false;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function checkDisplayListValidation():void
+ {
+ doChildBasedValidation()
+ super.checkDisplayListValidation()
+ }
+
+ /**
+ * While UIControls can be sized based on the dimensions of the parent
+ * container, if the explicit or percent dimension values are not specified,
+ * the UIControl can look at its children's dimensions and base its
+ * sizing off them.
+ *
+ * For example, Label controls can look at the size of the text rendered
+ * by them to define their own width.
+ */
+ protected function doChildBasedValidation():void
+ {
+ var child:DisplayObject;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ var maxW:Number = 0
+ for(var j:uint=0; j maxW)
+ {
+ maxW = child.width;
+ }
+ }
+
+ super.measuredWidth = maxW + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ var maxH:Number = 0
+ for(var k:uint=0; k maxH)
+ {
+ maxH = child.height;
+ }
+ }
+ super.measuredHeight = maxH + _padding.top + _padding.bottom;
+ }
+ }
+
+
+ /**
+ * Overrides the set measuredWidth property from
+ * MeasurableControl to invalidate children
+ * (UIControl acknowledges that it can have children whose
+ * dimensions are based on its own)
+ */
+ override public function set measuredWidth(w:Number):void{
+ if(w == _measuredWidth) return
+ _dimensionsChanged = true;
+ _measuredWidth = w;
+ for(var i:uint=0; iMeasurableControl to invalidate children
+ * (UIControl acknowledges that it can have children whose
+ * dimensions are based on its own)
+ */
+ override public function set measuredHeight(h:Number):void{
+ if(h == _measuredHeight) return
+ this._dimensionsChanged = true;
+ _measuredHeight = h;
+ for(var i:uint=0; i
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/b9/607b6efec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/b9/607b6efec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..6b39f58
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/b9/607b6efec011001e1d7df1eab75b47a2
@@ -0,0 +1,45 @@
+package com.cimians.openPyro.core
+{
+ /**
+ * Defines a padding object that is used by different
+ * systems (like Painters) to define active areas in a
+ * control
+ */
+ public class Padding
+ {
+
+ private var _top:Number;
+ private var _right:Number;
+ private var _bottom:Number;
+ private var _left:Number;
+
+ public function Padding(top:Number=0, right:Number=0, bottom:Number=0, left:Number=0)
+ {
+ _top = top;
+ _right = right;
+ _bottom = bottom;
+ _left = left;
+ }
+
+ public function get top():Number
+ {
+ return _top;
+ }
+
+ public function get right():Number
+ {
+ return _right;
+ }
+
+ public function get left():Number
+ {
+ return _left;
+ }
+
+ public function get bottom():Number
+ {
+ return _bottom;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/bc/506586fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/bc/506586fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..e6d0289
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/bc/506586fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,15 @@
+package org.openPyro.aurora{
+ import com.cimians.openPyro.aurora.skinClasses.HDividerSkin;
+ import com.cimians.openPyro.controls.skins.IDividedBoxSkin;
+ import com.cimians.openPyro.core.UIControl;
+
+ public class AuroraHDividedBoxSkin extends AuroraContainerSkin implements IDividedBoxSkin
+ {
+ public function getNewDividerSkin():UIControl{
+ var dividerSkin:UIControl = new HDividerSkin();
+ dividerSkin.width = 8;
+ dividerSkin.percentUnusedHeight = 100;
+ return dividerSkin;
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c0/c0d9b841c011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c0/c0d9b841c011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..6e582c7
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c0/c0d9b841c011001e1d7df1eab75b47a2
@@ -0,0 +1,39 @@
+package org.openPyro.aurora.skinClasses{
+ import org.openPyro.core.UIControl;
+ import com.cimians.openPyro.painters.GradientFillPainter;
+ import com.cimians.openPyro.painters.Stroke;
+
+ public class GradientRectSkin extends UIControl
+
+ {
+ protected var _gradientRotation:Number = 0;
+ protected var gradientFill:GradientFillPainter;
+
+ public function GradientRectSkin()
+ {
+ gradientFill = new GradientFillPainter([0x999999,0xdfdfdf],[.6,1],[1,255],_gradientRotation)
+ this.backgroundPainter = gradientFill;
+ }
+
+ public function set gradientRotation(r:Number):void
+ {
+ _gradientRotation = r;
+ gradientFill.rotation = _gradientRotation;
+ this.invalidateDisplayList();
+ }
+
+ protected var _stroke:Stroke = new Stroke(1,0x777777);
+
+ public function set stroke(str:Stroke):void{
+ _stroke = str;
+ gradientFill.stroke = str;
+ this.invalidateDisplayList();
+ }
+
+ public function get stroke():Stroke
+ {
+ return _stroke;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c4/8046f2fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c4/8046f2fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..b47b1f4
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c4/8046f2fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,37 @@
+package com.cimians.openPyro.painters
+{
+ import flash.display.Graphics;
+
+ /**
+ * Defines a stroke that can be applied to a Graphics context or
+ * be used by one of the painters
+ */
+ public class Stroke
+ {
+ public var thickness:Number = NaN;
+ public var color:uint = 0;
+ public var alpha:Number = 1.0;
+ public var pixelHinting:Boolean = false;
+ public var scaleMode:String = "normal";
+ public var caps:String = null;
+ public var joints:String = null;
+ public var miterLimit:Number = 3
+
+ public function Stroke(thickness:Number=1, color:uint=0x000000,alpha:Number = 1, pixelHinting:Boolean=false)
+ {
+ this.thickness = thickness;
+ this.color = color;
+ this.alpha = alpha;
+ this.pixelHinting = pixelHinting;
+ }
+
+ /**
+ * Applies the Stroke to a Graphics context
+ */
+ public function apply(gr:Graphics):void
+ {
+ gr.lineStyle(thickness, color, alpha, pixelHinting,
+ scaleMode, caps, joints, miterLimit);
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a01c06fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a01c06fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..39a1b7c
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a01c06fec011001e1d7df1eab75b47a2
@@ -0,0 +1,91 @@
+package com.cimians.openPyro.painters
+{
+ import com.cimians.openPyro.core.Padding;
+
+ import flash.display.BitmapData;
+ import flash.display.Graphics;
+ import flash.geom.Matrix;
+ import flash.geom.Rectangle;
+
+ /**
+ * Paints 45 degree inclined stripes on the
+ * Graphics context of a DisplayObject
+ */
+ public class StripesPainter implements IPainter
+ {
+ private var _padding:Padding;
+ private var _stripeWidth:Number;
+
+ /**
+ * constructor
+ */
+ public function StripesPainter(stripeWidth:Number=10){
+ _stripeWidth = stripeWidth;
+ }
+
+ /**
+ * Sets the width of the stripe that will be painted
+ * on the graphics context
+ */
+ public function set stripeWidth(n:Number):void{
+ _stripeWidth = n;
+ }
+
+ /**
+ * @private
+ */
+ public function get stripeWidth():Number{
+ return _stripeWidth;
+ }
+
+ /**
+ * Paints the graphics context with Stripes of width specified by
+ * the stripeWidth property
+ *
+ * @see #stripeWidth()
+ */
+ public function draw(gr:Graphics, w:Number, h:Number):void
+ {
+ var bdata:BitmapData = new BitmapData(2*_stripeWidth,2*_stripeWidth, true);
+ var rect1:Rectangle = new Rectangle(0,0,_stripeWidth,2*_stripeWidth);
+ var rect2:Rectangle = new Rectangle(_stripeWidth,0,_stripeWidth,2*_stripeWidth);
+
+ //Create 2 black rectangles: one semitransparent and other invisible
+ bdata.fillRect(rect1, 0x00000000);
+ bdata.fillRect(rect2, 0x10000000);
+
+ //Create the skew-matrix
+ var m:Matrix = new Matrix();
+ m.c=-1;
+
+ //Fill the MovieClip with the BitmapData.
+ gr.beginBitmapFill(bdata, m)
+ gr.drawRect(0,0,w,h);
+ gr.endFill();
+ }
+
+ /**
+ * @private
+ */
+ public function toString():String{
+ return ("stripeWidth: "+_stripeWidth)
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function set padding(p:Padding):void
+ {
+ _padding = p
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function get padding():Padding
+ {
+ return _padding;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c7/207899fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c7/207899fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..b0aacd2
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/c7/207899fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,188 @@
+package com.cimians.openPyro.controls{
+ import com.cimians.openPyro.controls.events.ButtonEvent;
+ import com.cimians.openPyro.core.IStateFulClient;
+ import com.cimians.openPyro.core.Padding;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.skins.ISkin;
+
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+
+ [Event(name="up", type="com.cimians.openPyro.controls.events.ButtonEvent")]
+ [Event(name="over", type="com.cimians.openPyro.controls.events.ButtonEvent")]
+ [Event(name="down", type="com.cimians.openPyro.controls.events.ButtonEvent")]
+
+ /**
+ * Dispatched when a toggleable button's state changes from selected to
+ * deselected or vice versa.
+ */
+ [Event(name="change", type="flash.events.Event")]
+
+ public class Button extends UIControl{
+
+ private var _buttonSkin:ISkin;
+
+ /**
+ * Buttons by default return to their 'up' state when
+ * the mouse moves out, but buttons can be used as elements
+ * in sliders, scrollbars etc where mouseOut should be
+ * handled differently. Having the function referenced like
+ * this lets you override the mouseOut behavior
+ *
+ * @see com.cimians.openPyro.controls.Slider#thumbButton
+ */
+ public var mouseOutHandler:Function = onMouseOut;
+
+ public function Button(){
+ super();
+ _styleName = "Button";
+ }
+
+ override public function initialize():void{
+ super.initialize();
+ this.currentState = ButtonEvent.UP
+ this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
+ this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
+ this.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
+ this.addEventListener(MouseEvent.MOUSE_OUT, this.mouseOutHandler);
+ }
+
+ private var _label:String;
+
+ /**
+ * Sets the label property of the Button. How this
+ * property appears visually is upto the skin of
+ * this control
+ */
+ public function set label(str:String):void
+ {
+ _label = str;
+ dispatchEvent(new PyroEvent(PyroEvent.PROPERTY_CHANGE));
+ }
+
+ public function get label():String
+ {
+ return _label;
+ }
+
+ override public function set skin(skinImpl:ISkin):void{
+ super.skin = skinImpl;
+ this._buttonSkin = skinImpl;
+ }
+
+ /////////////// TOGGLE IMPLEMENTATION //////
+
+ protected var _toggle:Boolean = false;
+
+ /**
+ * Sets whether a button is set as togglable or not.
+ * If true, the button can be set in a selected or deselected
+ * state
+ */
+ public function set toggle(b:Boolean):void{
+ _toggle = b
+ }
+
+ /**
+ * @private
+ */
+ public function get toggle():Boolean{
+ return _toggle
+ }
+
+ protected var _selected:Boolean = false;
+ /**
+ * Sets a button's state to selected or not. This value is
+ * ONLY set if the toggle property is set to true
+ */
+ public function set selected(b:Boolean):void{
+ if(_toggle){
+ if(_selected != b){
+ this._selected = b;
+ dispatchEvent(new PyroEvent(PyroEvent.PROPERTY_CHANGE));
+ dispatchEvent(new Event(Event.CHANGE));
+ }
+ }
+ }
+
+ public function get selected():Boolean{
+ return _selected
+ }
+
+ /**
+ *
+ * IMPORTANT
+ *
+ * The Button control is different from basic UIControls.
+ * If there is a skin applied to the Button, changing the
+ * Padding property dispatches an event that the skin can
+ * react to, otherwise the Button does what UIControls do
+ * by default (so for example, that if a background painter
+ * is on it, it can repaint accordingly)
+ *
+ * Not sure how I like this, have to rethink Button as a
+ * pure interaction controller with no UI?
+ */
+ override public function set padding(p:Padding):void{
+ if(_padding == p) return;
+ _padding = p;
+ if(!initialized) return;
+ if(this._skin){
+ dispatchEvent(new PyroEvent(PyroEvent.PROPERTY_CHANGE));
+ }
+ else{
+ this.invalidateSize();
+ }
+ }
+
+ //////////// States //////////////////////////
+
+ public var currentState:String;
+
+ public function changeState(fromState:String, toState:String):void{}
+
+ private function onMouseOver(event:MouseEvent):void{
+ if(_buttonSkin && _buttonSkin is IStateFulClient){
+ IStateFulClient(this._buttonSkin).changeState(this.currentState,ButtonEvent.OVER);
+ }
+ this.currentState = ButtonEvent.OVER;
+ dispatchEvent(new ButtonEvent(ButtonEvent.OVER));
+ }
+
+ private function onMouseDown(event:MouseEvent):void{
+ if(_toggle){
+ if(_selected){
+ selected = false;
+ }
+ else{
+ selected = true
+ }
+ }
+ if(_buttonSkin && _buttonSkin is IStateFulClient){
+ IStateFulClient(this._buttonSkin).changeState(this.currentState,ButtonEvent.DOWN);
+ }
+ this.currentState = ButtonEvent.DOWN;
+ dispatchEvent(new ButtonEvent(ButtonEvent.DOWN));
+ }
+
+ private function onMouseUp(event:MouseEvent):void{
+ if(_buttonSkin && _buttonSkin is IStateFulClient){
+ IStateFulClient(this._buttonSkin).changeState(this.currentState, ButtonEvent.OVER);
+ }
+ this.currentState = ButtonEvent.UP;
+ dispatchEvent(new ButtonEvent(ButtonEvent.UP));
+ }
+
+ private function onMouseOut(event:MouseEvent):void
+ {
+ if(_buttonSkin && _buttonSkin is IStateFulClient){
+ IStateFulClient(this._buttonSkin).changeState(this.currentState, ButtonEvent.UP);
+ }
+ this.currentState = ButtonEvent.UP;
+ dispatchEvent(new ButtonEvent(ButtonEvent.UP));
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e00424fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e00424fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..17edafc
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e00424fec011001e1d7df1eab75b47a2
@@ -0,0 +1,29 @@
+package com.cimians.openPyro.painters
+{
+ import flash.display.Graphics;
+ import com.cimians.openPyro.core.Padding;
+
+ /**
+ * Painters are classes that can draw things on the
+ * graphics context of any DisplayObject.
+ */
+ public interface IPainter
+ {
+ /**
+ * The padding to be applied to the painter.
+ * Painters will paint only within the area
+ * defined inside the padded area
+ */
+ function set padding(p:Padding):void;
+
+ /**
+ * @private
+ */
+ function get padding():Padding;
+
+ /**
+ * Paints the graphics context of the DisplayObject
+ */
+ function draw(gr:Graphics, w:Number, h:Number):void;
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/d1/409c1dfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/d1/409c1dfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..f15c690
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/d1/409c1dfec011001e1d7df1eab75b47a2
@@ -0,0 +1,152 @@
+package org.openPyro.aurora
+{
+ import com.cimians.openPyro.controls.Button;
+ import com.cimians.openPyro.controls.events.ButtonEvent;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.painters.GradientFillPainter;
+ import com.cimians.openPyro.painters.Stroke;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+
+ public class AuroraCheckBoxSkin extends AuroraPainterButtonSkin
+ {
+
+ [Embed(source="/assets/graphic_assets.swf", symbol="checkIcon")]
+ private var TickGraphic:Class
+
+ public function AuroraCheckBoxSkin()
+ {
+ }
+
+ private var _checkIcon:DisplayObject
+
+ public var cornerRadius:Number = 0
+ public var boxLabelGap:Number = 10;
+
+ public function set checkIcon(icon:DisplayObject):void{
+ _checkIcon = icon
+ }
+
+ private var _uncheckIcon:DisplayObject
+ public function set uncheckIcon(icon:DisplayObject):void{
+ _uncheckIcon = icon;
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ super.skinnedControl = uic
+ checkSelectedStatus()
+ }
+
+ override protected function onSkinnedControlPropertyChange(event:PyroEvent):void{
+ super.onSkinnedControlPropertyChange(event);
+ checkSelectedStatus()
+ }
+
+ override public function changeState(fromState:String, toState:String):void
+ {
+ if(toState==ButtonEvent.UP)
+ {
+ this.backgroundPainter = upPainter;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ this.backgroundPainter = overPainter;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ this.backgroundPainter = downPainter;
+ if(_skinnedControl is Button){
+ var b:Button = _skinnedControl as Button;
+ checkSelectedStatus()
+ }
+ }
+ else
+ {
+ this.backgroundPainter = upPainter;
+ }
+ }
+
+ protected function checkSelectedStatus():void{
+ if(Button(_skinnedControl).toggle){
+ if(Button(_skinnedControl).selected){
+ if(!_checkIcon){
+ _checkIcon = createDefaultCheckIcon()
+
+ }
+ _checkIcon.visible = true
+ if(_uncheckIcon){
+ _uncheckIcon.visible = false;
+ }
+ }
+ else {
+ if(!_uncheckIcon){
+ _uncheckIcon = createDefaultUnCheckIcon()
+
+ }
+ _uncheckIcon.visible = true
+ if(_checkIcon){
+ _checkIcon.visible=false
+ }
+ }
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(!label){
+ if(_checkIcon)
+ _checkIcon.x = (unscaledWidth-_checkIcon.width)/2;
+ if(_uncheckIcon)
+ _uncheckIcon.x = (unscaledWidth-_uncheckIcon.width)/2
+ }
+ else{
+ if(_checkIcon){
+ _checkIcon.x = _skinnedControl.padding.left;
+ _checkIcon.y = (unscaledHeight-_checkIcon.height)/2;
+
+ }
+ if(_uncheckIcon){
+ _uncheckIcon.x = _skinnedControl.padding.left;;
+ _uncheckIcon.y = (unscaledHeight-_uncheckIcon.height)/2;
+ }
+ var checkIconW:Number = _checkIcon ? _checkIcon.width:0
+ var uncheckIconW:Number = _uncheckIcon?_uncheckIcon.width:0
+ label.x = Math.max(checkIconW, uncheckIconW)+boxLabelGap;
+ }
+
+ }
+
+ protected function createDefaultUnCheckIcon():Sprite{
+ var sp:Sprite = new Sprite()
+ var gr:GradientFillPainter = new GradientFillPainter([0xffffff, 0xdddddd])
+ gr.stroke = new Stroke(1,0x666666,1,true)
+ gr.rotation = Math.PI/2
+ gr.cornerRadius = cornerRadius
+ gr.draw(sp.graphics, 15,15)
+ addChild(sp)
+ return sp
+ }
+
+ protected function createDefaultCheckIcon():Sprite{
+ var sp:Sprite = new Sprite()
+ var gr:GradientFillPainter = new GradientFillPainter([0xffffff, 0xdddddd])
+ gr.stroke = new Stroke(1,0x666666,1,true)
+ gr.rotation = Math.PI/2
+ gr.cornerRadius = cornerRadius
+ gr.draw(sp.graphics, 15,15)
+ addChild(sp)
+
+ var tick:DisplayObject = new TickGraphic()
+ sp.addChild(tick)
+ sp.mouseChildren=false;
+ return sp
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/de/40994226c211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/de/40994226c211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..3fd15ca
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/de/40994226c211001e1d7df1eab75b47a2
@@ -0,0 +1,62 @@
+package
+{
+ import org.openPyro.containers.HDividedBox;
+ import org.openPyro.containers.VDividedBox;
+ import org.openPyro.core.UIControl;
+ import org.openPyroExamples.DimensionMarkerSkin;
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+
+ public class TestVDividedBox extends Sprite
+ {
+ public function TestVDividedBox()
+ {
+ stage.scaleMode = "noScale"
+ stage.align = "TL";
+ stage.addEventListener(Event.ENTER_FRAME, initialize)
+ }
+
+ public function initialize(event:Event):void{
+ stage.removeEventListener(Event.ENTER_FRAME, initialize);
+
+ var vdbox:VDividedBox = new VDividedBox()
+ //hdbox.skin = new AuroraHDividedBoxSkin();
+ //vdbox.horizontalScrollPolicy = false;
+ vdbox.width = 400
+ vdbox.height = 600
+
+ var greenBox:UIControl = new UIControl()
+ greenBox.name = "greenBox";
+ greenBox.skin = new DimensionMarkerSkin()
+ greenBox.percentUnusedWidth = 100
+ greenBox.height = 40
+
+ var redBox:UIControl = new UIControl();
+ redBox.name = "redBox"
+ redBox.skin = new DimensionMarkerSkin()
+ redBox.percentUnusedWidth = 100
+ redBox.percentUnusedHeight = 50
+
+
+
+ var blueBox:UIControl = new UIControl()
+ blueBox.name = "blueBox"
+ blueBox.skin = new DimensionMarkerSkin()
+ blueBox.percentUnusedWidth = 100
+ blueBox.percentUnusedHeight = 50
+
+
+
+ vdbox.addChild(greenBox)
+
+ vdbox.addChild(redBox)
+ vdbox.addChild(blueBox);
+
+ addChild(vdbox);
+
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/40d96294c111001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/40d96294c111001e1d7df1eab75b47a2
new file mode 100644
index 0000000..bb49abb
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/40d96294c111001e1d7df1eab75b47a2
@@ -0,0 +1,74 @@
+package org.openPyroExamples{
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.skins.ISkin;
+
+ import flash.display.Graphics;
+ import flash.events.Event;
+ import flash.geom.Matrix;
+
+ public class SimpleButtonSkin extends UIControl implements ISkin{
+
+ private var _control:UIControl;
+ private var _cornerRadius:Number;
+
+ public function SimpleButtonSkin(cornerRadius:Number=5){
+ super();
+ this._cornerRadius = cornerRadius;
+ }
+
+ private var matrix:Matrix = new Matrix();
+
+ override public function set skinnedControl(uic:UIControl):void{
+ _control = uic;
+ _control.addChildAt(this, 0);
+ _control.addEventListener(Event.RESIZE, onResize);
+
+ matrix.createGradientBox(_control.width, _control.height, Math.PI/2);
+
+ if(!isNaN(_control.width) && !isNaN(_control.height)){
+ var gr:Graphics = this.graphics
+ gr.lineStyle(1,0x777777)
+ gr.beginGradientFill('linear',[0xdfdfdf, 0xffffff],[1,1],[0,255],matrix);
+ gr.drawRoundRect(0,0,_control.width, _control.height,_cornerRadius,_cornerRadius);
+ gr.endFill();
+ }
+ }
+
+ private function onResize(event:Event):void{
+ var gr:Graphics = this.graphics
+ matrix.createGradientBox(_control.width, _control.height, Math.PI/2);
+ gr.clear()
+ gr.lineStyle(1,0x777777)
+ gr.beginGradientFill('linear',[0xdfdfdf, 0xffffff],[1,1],[0,255],matrix);
+ gr.drawRoundRect(0,0,_control.width, _control.height,_cornerRadius,_cornerRadius);
+ gr.endFill();
+ }
+
+ public function get selector():String{
+ return "SimpleButtonSkin";
+ }
+
+ public function changeState(fromState:String, toState:String):void{
+ var gr:Graphics = this.graphics
+ gr.clear();
+ gr.lineStyle(1,0x777777)
+ if(toState == ButtonEvent.UP){
+ gr.beginGradientFill('linear',[0xdfdfdf, 0xffffff],[1,1],[0,255],matrix);
+ }
+ else if(toState == ButtonEvent.OVER){
+ gr.beginGradientFill('linear',[0xffffff,0xdfdfdf],[1,1],[0,255],matrix);
+ }
+ else if(toState == ButtonEvent.DOWN){
+ gr.lineStyle(2,0x56A0EA);
+ gr.beginGradientFill('linear',[0xffffff,0xdfdfdf],[1,1],[0,255],matrix);
+ }
+ else{
+ gr.beginGradientFill('linear',[0xdfdfdf, 0xffffff],[1,1],[0,255],matrix);
+ }
+ gr.drawRoundRect(0,0,_control.width, _control.height,_cornerRadius,_cornerRadius);
+ gr.endFill();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0b693fec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0b693fec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..4cdb944
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/a0b693fec011001e1d7df1eab75b47a2
@@ -0,0 +1,42 @@
+package com.cimians.openPyro.utils{
+
+ /**
+ * A collection of Utility methods for Mathematical operations
+ */
+ public class MathUtil
+ {
+ /**
+ * Inserts a comma after every 3rd character when counted from reverse
+ *
+ * useage: getCommaSeparatedString(12345) returns 12,345
+ */
+ public static function getCommaSeparatedString(n:Number):String{
+ var numString:String = String(n);
+ var returnString:Array = new Array();
+ for(var i:Number=numString.length-1, count:Number=1; i>=0; i--, count++){
+ returnString.push(numString.charAt(i));
+ if(count%3==0 && i != 0){
+ returnString.push(",");
+ }
+ }
+ returnString.reverse();
+ return returnString.join('');
+ }
+
+ /**
+ * @param deg The degree value whose radian equivalent is required
+ * @return The radian equivalent of the input parameter
+ */
+ public static function degreeToRadians(deg:Number):Number{
+ return Math.PI*deg/180;
+ }
+
+ public static function radiansToDegrees(rad:Number):Number{
+ return 180*rad/Math.PI;
+ }
+
+ public static function randRange(start:Number, end:Number) : Number{
+ return Math.floor(start +(Math.random() * (end - start)));
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/b07ed501c211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/b07ed501c211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..4b150a6
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/e4/b07ed501c211001e1d7df1eab75b47a2
@@ -0,0 +1,142 @@
+package
+{
+ import org.openPyro.aurora.AuroraButtonSkin;
+ import org.openPyro.controls.Button;
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.layout.VLayout;
+ import org.openPyro.managers.SkinManager;
+ import org.openPyro.painters.FillPainter;
+ import org.openPyro.painters.Stroke;
+ import org.openPyroExamples.SimpleButtonSkin;
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+ import flash.filters.DropShadowFilter;
+
+ public class TestStyleManager extends Sprite{
+
+ private var button1:Button;
+ private var button2:Button;
+
+ public function TestStyleManager(){
+
+ stage.scaleMode = "noScale"
+ stage.align = "TL"
+
+ testButtonSkinning()
+ //basicTest();
+ }
+
+ private function testButtonSkinning():void
+ {
+
+ var buttonStyleFactory:ClassFactory = new ClassFactory(AuroraButtonSkin);
+ buttonStyleFactory.properties = {cornerRadius:10,
+ percentUnusedWidth:100,
+ percentUnusedHeight:100}
+
+ SkinManager.getInstance().registerSkin(buttonStyleFactory, "Button")
+
+ var button:Button = new Button()
+ button.width = 150
+ button.height = 25;
+ addChild(button)
+ button.addEventListener(ButtonEvent.DOWN, onButtonDown);
+ button.x = button.y = 100;
+
+ button2 = new Button()
+ button2.width = 150
+ button2.height = 25;
+ addChild(button2);
+ button2.addEventListener(ButtonEvent.DOWN, onButton2Down);
+ button2.y = 100
+ button2.x = 300;
+
+
+ }
+
+ private function onButton2Down(event:ButtonEvent):void
+ {
+ button2.styleName = "coolButtonStyle";
+ SkinManager.getInstance().loadSkinSwf("Skin.swf");
+ }
+
+ private function onButtonDown(event:Event):void
+ {
+ var buttonStyleFactory:ClassFactory = new ClassFactory(AuroraButtonSkin);
+ buttonStyleFactory.properties = {cornerRadius:20,
+ upColors:[0x750811, 0xff0000],
+ overColors:[0xff0000,0x750811],
+ downColors:[0x750811, 0x750811],
+ percentUnusedWidth:100,
+ percentUnusedHeight:100}
+
+ SkinManager.getInstance().registerSkin(buttonStyleFactory, "Button")
+ }
+
+
+ private function basicTest():void{
+ var container:UIContainer = new UIContainer()
+ addChild(container);
+
+ var vLayout:VLayout = new VLayout(60);
+ container.layout = vLayout;
+ container.x = container.y = 100;
+
+ var stroke:Stroke = new Stroke()
+ stroke.thickness = 2;
+ stroke.color = 0xff0000;
+
+
+ var fillPainter:FillPainter = new FillPainter(0xcccccc,.4,stroke);
+ container.backgroundPainter = (fillPainter);
+
+
+ container.width = 100
+ container.height = 300
+
+
+ button1 = new Button()
+ button1.addEventListener(Event.RESIZE, onResize);
+ container.addChild(button1);
+ button1.percentUnusedWidth = 100
+ button1.percentUnusedHeight = 50;
+
+
+ button2 = new Button()
+ button2.addEventListener(Event.RESIZE, onResize);
+ container.addChild(button2);
+ button2.percentUnusedWidth = 100
+ button2.percentUnusedHeight = 50;
+
+
+ var skin:SimpleButtonSkin = new SimpleButtonSkin();
+ button1.skin = skin;
+
+ var skinManager:SkinManager = new SkinManager()
+ skinManager.addEventListener(SkinManager.SKIN_SWF_LOADED, onSkinSwfLoaded);
+ skinManager.registerSkinClient(button2, "SimpleFlaButtonSkin")
+ skinManager.loadSkinSwf('Skin.swf');
+
+ }
+
+ private function onSkinSwfLoaded(event:Event):void{
+ trace('swf loaded ')
+ }
+
+ private function onResize(event:Event):void{
+
+ }
+
+ public function onStageClick(event:MouseEvent):void{
+ /*trace('stage click');
+ var skin:SimpleButtonSkin = new SimpleButtonSkin();
+ button.skin = skin;
+ */
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ee/f093e9fdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ee/f093e9fdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..b4cba41
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/ee/f093e9fdc011001e1d7df1eab75b47a2
@@ -0,0 +1,189 @@
+package com.cimians.openPyro.controls
+{
+ import com.cimians.openPyro.core.UIControl;
+
+ import flash.display.Loader;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLRequest;
+ import flash.system.LoaderContext;
+
+ public class Image extends UIControl
+ {
+ private var _sourceURL:String = "";
+ private var _loader:Loader;
+
+ public function Image() {
+ super();
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+ _loader = new Loader();
+ _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
+ _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
+ addChild(_loader);
+
+ if(!_loaderContext)
+ {
+ _loaderContext = new LoaderContext(true);
+ }
+
+ if(_autoLoad && (_sourceURL != "")){
+ _loader.load(new URLRequest(_sourceURL), _loaderContext);
+ }
+ }
+
+ protected var _autoLoad:Boolean = true;
+ public function set autoLoad(b:Boolean):void
+ {
+ _autoLoad = b;
+ }
+
+ public function get autoLoad():Boolean
+ {
+ return _autoLoad;
+ }
+
+ public function set source(url:String):void
+ {
+ if(url == _sourceURL) return;
+ _sourceURL = url;
+ if(_loader && _autoLoad){
+ _loader.load(new URLRequest(url), _loaderContext);
+ }
+ }
+
+ private var _loaderContext:LoaderContext
+
+ /**
+ * The LoaderContext that is used when loading an
+ * image.
+ */
+ public function set loaderContext(context:LoaderContext):void
+ {
+ _loaderContext = context;
+ }
+
+ /**
+ * @private
+ */
+ public function get loaderContext():LoaderContext
+ {
+ return _loaderContext;
+ }
+
+ /**
+ * Returns the raw loader being used to load the image
+ */
+ public function get loader():Loader
+ {
+ return _loader;
+ }
+
+ protected var _originalContentWidth:Number = NaN;
+ protected var _originalContentHeight:Number = NaN;
+
+ protected function onLoadComplete(event:Event):void
+ {
+ _originalContentWidth = _loader.content.width;
+ _originalContentHeight = _loader.content.height;
+ dispatchEvent(new Event(Event.COMPLETE));
+ forceInvalidateDisplayList = true;
+ invalidateSize();
+ invalidateDisplayList()
+ }
+ override protected function doChildBasedValidation():void{
+ if(!_loader || !_loader.content) return;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth)){
+ measuredWidth = _originalContentWidth + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ measuredHeight = _originalContentWidth + _padding.top + _padding.bottom;
+ }
+ }
+
+ public function get contentWidth():Number{
+ return _loader.content.width;
+ }
+
+ public function get contentHeight():Number{
+ return _loader.content.height;
+ }
+
+ public function get originalContentWidth():Number{
+ return _originalContentWidth
+ }
+
+ public function get originalContentHeight():Number{
+ return _originalContentHeight;
+ }
+
+
+ protected function onIOError(event:IOErrorEvent):void
+ {
+ //todo: Put broken thumb skin here//
+ }
+
+ protected var _scaleToFit:Boolean = true;
+ public function get scaleToFit():Boolean
+ {
+ return _scaleToFit;
+ }
+
+ public function set scaleToFit(value:Boolean):void
+ {
+ _scaleToFit = value;
+ if(_scaleToFit && _loader && _loader.content)
+ {
+ scaleImageContent()
+ }
+ }
+
+
+
+ protected var _maintainAspectRatio:Boolean = true;
+ public function set maintainAspectRatio(value:Boolean):void
+ {
+ _maintainAspectRatio = value;
+ }
+ public function get maintainAspectRatio():Boolean
+ {
+ return _maintainAspectRatio;
+ }
+
+ protected function scaleImageContent():void
+ {
+
+ var scaleX:Number;
+ var scaleY:Number;
+ scaleX = width / _originalContentWidth;
+ scaleY = height / _originalContentHeight;
+
+ if(_maintainAspectRatio)
+ {
+ var scale:Number = Math.min(scaleX, scaleY);
+ _loader.content.width = _originalContentWidth*scale;
+ _loader.content.height = _originalContentHeight*scale;
+ }
+ else
+ {
+ _loader.content.width = _originalContentWidth*scaleX;
+ _loader.content.height = _originalContentHeight*scaleY;
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_loader && _loader.content && _scaleToFit){
+ scaleImageContent()
+ }
+ _loader.x = _padding.left
+ _loader.y = _padding.top;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a07c6010c211001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a07c6010c211001e1d7df1eab75b47a2
new file mode 100644
index 0000000..d8ef7fc
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a07c6010c211001e1d7df1eab75b47a2
@@ -0,0 +1,60 @@
+package
+{
+ import org.openPyro.aurora.AuroraHDividedBoxSkin;
+ import org.openPyro.containers.HDividedBox;
+ import org.openPyro.core.UIControl;
+ import org.openPyroExamples.DimensionMarkerSkin;
+
+ import flash.display.Sprite;
+ import flash.events.Event;
+
+ public class TestHDividedBox extends Sprite
+ {
+ public function TestHDividedBox()
+ {
+ stage.scaleMode = "noScale"
+ stage.align = "TL";
+ stage.addEventListener(Event.ENTER_FRAME, initialize)
+ }
+
+ public function initialize(event:Event):void{
+ stage.removeEventListener(Event.ENTER_FRAME, initialize);
+
+ var hdbox:HDividedBox = new HDividedBox()
+ //hdbox.skin = new AuroraHDividedBoxSkin();
+ hdbox.horizontalScrollPolicy = false;
+ hdbox.width = 600
+ hdbox.height = 400
+
+ var redBox:UIControl = new UIControl();
+ redBox.name = "redBox"
+ redBox.skin = new DimensionMarkerSkin()
+ redBox.percentUnusedWidth = 50
+ redBox.percentUnusedHeight = 100
+
+ var greenBox:UIControl = new UIControl()
+ greenBox.name = "greenBox";
+ greenBox.skin = new DimensionMarkerSkin()
+ greenBox.width = 200
+ greenBox.percentUnusedHeight = 100
+
+ var blueBox:UIControl = new UIControl()
+ blueBox.name = "blueBox"
+ blueBox.skin = new DimensionMarkerSkin()
+ blueBox.percentUnusedWidth = 50
+ blueBox.percentUnusedHeight = 100
+
+
+
+
+ hdbox.addChild(redBox)
+ hdbox.addChild(greenBox)
+ hdbox.addChild(blueBox);
+
+ addChild(hdbox);
+
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2017befdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2017befdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..60ffa35
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/f6/2017befdc011001e1d7df1eab75b47a2
@@ -0,0 +1,435 @@
+package com.cimians.openPyro.controls
+{
+ import com.cimians.openPyro.collections.CollectionHelpers;
+ import com.cimians.openPyro.collections.ICollection;
+ import com.cimians.openPyro.collections.IIterator;
+ import com.cimians.openPyro.collections.events.CollectionEvent;
+ import com.cimians.openPyro.collections.events.CollectionEventKind;
+ import com.cimians.openPyro.collections.events.IteratorEvent;
+ import com.cimians.openPyro.controls.events.ListEvent;
+ import com.cimians.openPyro.controls.listClasses.BaseListData;
+ import com.cimians.openPyro.controls.listClasses.DefaultListRenderer;
+ import com.cimians.openPyro.controls.listClasses.IListDataRenderer;
+ import com.cimians.openPyro.core.ClassFactory;
+ import com.cimians.openPyro.core.IDataRenderer;
+ import com.cimians.openPyro.core.MeasurableControl;
+ import com.cimians.openPyro.core.ObjectPool;
+ import com.cimians.openPyro.core.UIContainer;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.layout.VLayout;
+ import com.cimians.openPyro.utils.ArrayUtil;
+ import com.cimians.openPyro.utils.StringUtil;
+
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+
+ [Event(name="change", type="com.cimians.openPyro.controls.events.ListEvent")]
+ [Event(name="itemClick", type="com.cimians.openPyro.controls.events.ListEvent")]
+
+ public class List extends UIContainer
+ {
+
+ /**
+ * Resets scrolls when the dataProvider changes
+ */
+ public var autoResetScrollOnDataProviderChange:Boolean = true
+
+
+ public function List()
+ {
+ super();
+ this._labelFunction = StringUtil.toStringLabel
+ _layout = new VLayout();
+ }
+
+ protected var _labelFunction:Function = StringUtil.toStringLabel
+ public function set labelFunction(func:Function):void{
+ _labelFunction = func;
+ /*
+ * TODO: Change label functions on all itemRenderers
+ */
+ }
+
+ public function get labelFunction():Function{
+ return _labelFunction;
+ }
+
+
+ override protected function createChildren():void
+ {
+ if(!this._rendererPool){
+ var cf:ClassFactory = new ClassFactory(DefaultListRenderer);
+ cf.properties = {percentWidth:100, height:25};
+ _rendererPool = new ObjectPool(cf)
+ }
+ }
+
+ protected var renderers:Array = new Array();
+ protected var _rendererPool:ObjectPool;
+ protected var selectedRenderer:DisplayObject;
+
+ protected var _dataProvider:ICollection;
+ protected var _originalRawDataProvider:Object;
+
+ public function set dataProvider(dp:Object):void{
+ if(dp == _originalRawDataProvider){
+ return;
+ }
+ _originalRawDataProvider =dp
+ if(autoResetScrollOnDataProviderChange){
+ verticalScrollPosition = 0
+ horizontalScrollPosition=0
+ }
+ if(_dataProvider){
+ _dataProvider.removeEventListener(CollectionEvent.COLLECTION_CHANGED, onSourceCollectionChanged);
+ _dataProvider.iterator.addEventListener(IteratorEvent.ITERATOR_MOVED, onIteratorMoved);
+ }
+ convertDataToCollection(dp)
+ _dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGED, onSourceCollectionChanged);
+ _dataProvider.iterator.addEventListener(IteratorEvent.ITERATOR_MOVED, onIteratorMoved);
+ createRenderers()
+ }
+
+ public function get originalRawDataProvider():Object{
+ return _originalRawDataProvider;
+ }
+
+ protected function createRenderers():void{
+ if(!_rendererPool) return;
+ returnRenderersToPool()
+ var renderer:DisplayObject;
+
+ var iterator:IIterator = _dataProvider.iterator;
+ iterator.reset();
+
+ while(iterator.hasNext())
+ {
+ var listData:Object = iterator.getNext();
+ renderer = DisplayObject(_rendererPool.getObject());
+ setRendererData(renderer, listData, iterator.cursorIndex);
+ renderers.push(renderer);
+ contentPane.addChildAt(renderer,0);
+
+ }
+ // reset the iterator to -1
+ iterator.reset()
+
+ displayListInvalidated = true;
+ this.forceInvalidateDisplayList = true;
+ this.invalidateSize();
+ this.invalidateDisplayList();
+ _selectedIndex = -1;
+ }
+
+ public function get dataProvider():Object{
+ return _dataProvider;
+ }
+
+ /**
+ * Converts an Array to ArrayCollection or xml to
+ * XMLCollection. Written as a separate function so
+ * that overriding classes may massage the data as
+ * needed
+ */
+ protected function convertDataToCollection(dp:Object):void{
+ this._dataProvider = CollectionHelpers.sourceToCollection(dp);
+ }
+
+ private function onSourceCollectionChanged(event:CollectionEvent):void{
+
+ if(event.kind == CollectionEventKind.REMOVE){
+ handleDataProviderItemsRemoved(event)
+ }
+
+ else if(event.kind == CollectionEventKind.ADD){
+ handDataProviderItemsAdded(event)
+ }
+ else if(event.kind == CollectionEventKind.RESET){
+ createRenderers();
+ }
+
+ this.displayListInvalidated = true
+ this.layoutInvalidated = true;
+ this.invalidateSize()
+ }
+
+ protected function onIteratorMoved(event:IteratorEvent):void{
+ var data:Object = _dataProvider.iterator.getCurrent();
+ var renderer:DisplayObject = dataToItemRenderer(data);
+ if(renderer is IListDataRenderer){
+ IListDataRenderer(renderer).selected = true;
+ }
+ selectedRenderer = renderer;
+ dispatchEvent(new ListEvent(ListEvent.CHANGE));
+ }
+
+ protected function handleDataProviderItemsRemoved(event:CollectionEvent):void
+ {
+ var childNodesData:Array = event.delta;
+
+ var renderer:DisplayObject
+ for(var i:int=0; i=0; l--){
+ //(this.renderers.length == 0)?0:this.renderers[this.renderers.length-1].y
+ var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
+ var listData:Object = childNodesData[l]
+ setRendererData(newRenderer, listData, l);
+ this.contentPane.addChild(newRenderer);
+
+ newRenderer.y = tgtY;
+
+ renderers.unshift(newRenderer);
+
+ }
+
+ }
+
+ else{
+ //trace(XMLNodeDescriptor(eventSourceData).nodeString);
+ for(var j:int=0; j=0; k--){
+ var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
+ var listData:Object = childNodesData[k]
+ setRendererData(newRenderer, listData, k);
+ this.contentPane.addChildAt(newRenderer,0);
+ newRenderer.y = positionRefNode.y - newRenderer.height;
+ positionRefNode = newRenderer;
+ ArrayUtil.insertAt(renderers, (j+1), newRenderer);
+ }
+ break;
+ }
+ }
+ }
+ this.forceInvalidateDisplayList=true;
+ invalidateSize();
+ invalidateDisplayList();
+ }
+
+ protected function returnRenderersToPool():void{
+ var renderer:DisplayObject
+ while(renderers.length > 0)
+ {
+ renderer = renderers.shift();
+ if(renderer.parent)
+ {
+ renderer.parent.removeChild(renderer);
+ }
+ _rendererPool.returnToPool(renderer);
+ }
+ }
+
+ protected function setRendererData(renderer:DisplayObject, data:Object, index:int):void
+ {
+ if(renderer is IListDataRenderer){
+ var listRenderer:IListDataRenderer = renderer as IListDataRenderer;
+ var baseListData:BaseListData = new BaseListData()
+ baseListData.list = this;
+ baseListData.rowIndex = index;
+
+ listRenderer.baseListData = baseListData;
+
+ /*
+ If the list Renderer is a measurable control,
+ make sure the renderer is initialized before you
+ set the data property. That way all children have
+ been created and can be populated w/ data.
+ */
+ if(listRenderer is MeasurableControl){
+ if(MeasurableControl(listRenderer).initialized){
+ listRenderer.data = data;
+ }
+ else{
+ MeasurableControl(listRenderer).addEventListener(PyroEvent.INITIALIZE,
+ function(event:PyroEvent):void{
+ listRenderer.data = data;
+ MeasurableControl(listRenderer).removeEventListener(PyroEvent.INITIALIZE, arguments.callee);
+ })
+ }
+ }
+ else{
+ listRenderer.data = data;
+ }
+ }
+ renderer.addEventListener(MouseEvent.CLICK, handleRendererClick);
+ }
+
+
+ protected function handleRendererClick(event:MouseEvent):void
+ {
+ // dont react if the click is coming from a currently
+ // selected child.
+ if(!(event.currentTarget is IListDataRenderer) || IListDataRenderer(event.currentTarget).selected) return;
+
+
+ if(selectedRenderer && selectedRenderer is IListDataRenderer){
+ IListDataRenderer(selectedRenderer).selected = false;
+ }
+ var newIndex:int = itemRendererToIndex(event.currentTarget as DisplayObject);
+ if(newIndex != selectedIndex){
+ selectedIndex = newIndex;
+ selectedRenderer = event.currentTarget as DisplayObject;
+ if(selectedRenderer is IListDataRenderer){
+ IListDataRenderer(selectedRenderer).selected = true;
+ }
+ }
+
+ dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK));
+ }
+
+
+ public function dataToItemRendererIndex(data:*):int
+ {
+ for(var i:uint=0; i 0){
+ renderer = renderers.shift();
+ if(renderer.parent){
+ renderer.parent.removeChild(renderer);
+ renderer = null;
+ }
+ }
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ }
+
+ override public function get layoutChildren():Array{
+ return this.renderers;
+ }
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e06e3cfec011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e06e3cfec011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..12efa71
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e06e3cfec011001e1d7df1eab75b47a2
@@ -0,0 +1,73 @@
+package com.cimians.openPyro.effects
+{
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+
+ import gs.TweenMax;
+
+ [Event(name="complete", type="flash.events.Event")]
+ [Event(name="starting", type="flash.events.Event")]
+
+ public class PyroEffect extends EventDispatcher{
+
+ /**
+ * Event dispatched just before the effect begins to
+ * play.
+ */
+ public static const STARTING:String = "starting";
+
+ [ArrayElementType("com.cimians.openPyro.effects.EffectDescriptor")]
+ protected var _effDescriptors:Array;
+
+ public function PyroEffect() {}
+
+ protected var _target:DisplayObject
+ public function set target(tgt:DisplayObject):void{
+ _target = tgt;
+ }
+
+
+ public function set effectDescriptors(effDescriptors:Array):void{
+ _effDescriptors = effDescriptors;
+ }
+
+ public function get effectDescriptors():Array{
+ return _effDescriptors;
+ }
+
+ public var currentEffect:TweenMax;
+
+ public function start():void{
+ for each(var descriptor:EffectDescriptor in _effDescriptors){
+ descriptor.properties.onComplete = function():void{
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+ if(!isNaN(_startDelay)){
+ descriptor.properties.delay = _startDelay;
+ }
+
+ dispatchEvent(new Event(STARTING));
+ currentEffect = TweenMax.to(descriptor.target, descriptor.duration, descriptor.properties);
+ }
+ }
+
+ public function pause():void{
+ if(currentEffect){
+ currentEffect.pause();
+ }
+ }
+
+ public function resume():void{
+ if(currentEffect && currentEffect.paused){
+ currentEffect.resume();
+ }
+ }
+
+ protected var _startDelay:Number = NaN
+ public function set startDelay(delay:Number):void{
+ _startDelay = delay;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f019aafdc011001e1d7df1eab75b47a2 b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f019aafdc011001e1d7df1eab75b47a2
new file mode 100644
index 0000000..3bc9cdd
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f019aafdc011001e1d7df1eab75b47a2
@@ -0,0 +1,258 @@
+package org.openPyro.aurora
+{
+ import com.cimians.openPyro.controls.Button;
+ import com.cimians.openPyro.controls.Label;
+ import com.cimians.openPyro.controls.events.ButtonEvent;
+ import com.cimians.openPyro.core.IStateFulClient;
+ import com.cimians.openPyro.core.UIControl;
+ import com.cimians.openPyro.events.PyroEvent;
+ import com.cimians.openPyro.painters.GradientFillPainter;
+ import com.cimians.openPyro.painters.Stroke;
+
+ import flash.display.DisplayObject;
+ import flash.text.TextFormat;
+
+ public class AuroraButtonSkin extends UIControl implements IStateFulClient
+ {
+ protected var _cornerRadius:Number = 0
+ protected var gradientPainter:GradientFillPainter;
+ protected var _stroke:Stroke = new Stroke(1,0x777777,1,true);
+
+ public function AuroraButtonSkin()
+ {
+ this.mouseChildren=false;
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ if(skinnedControl)
+ {
+ skinnedControl.removeEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ }
+ super.skinnedControl = uic;
+ skinnedControl.addEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ if(uic is Button)
+ {
+ this.changeState(null, Button(uic).currentState);
+ updateLabel();
+ }
+ this.buttonMode = true;
+ this.useHandCursor = true;
+
+ }
+
+ protected function onSkinnedControlPropertyChange(event:PyroEvent):void
+ {
+ if(skinnedControl is Button)
+ {
+ updateLabel();
+ }
+ }
+
+ /////////////////// ICON /////////////////
+
+ protected var _icon:DisplayObject;
+ public function set icon(icn:DisplayObject):void
+ {
+ _icon = icn;
+ addChild(_icon);
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ ////////////////// LABEL /////////////////
+
+ protected var _labelFormat:TextFormat = new TextFormat("Arial",11, 0x111111,true);
+
+ public function set labelFormat(fmt:TextFormat):void
+ {
+ _labelFormat = fmt;
+ if(label)
+ {
+ label.textFormat = fmt;
+ }
+ if(skinnedControl)
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ public function get labelFormat():TextFormat
+ {
+ return _labelFormat;
+ }
+
+ protected var label:Label;
+
+ public function updateLabel():void
+ {
+ if(this.skinnedControl is Button)
+ {
+ var bttn:Button = Button(this.skinnedControl);
+ if(!bttn.label) return;
+ if(!label){
+ label = new Label();
+ label.textFormat = _labelFormat;
+ addChild(label);
+
+ }
+ label.text = bttn.label;
+ }
+ }
+
+ private var _labelAlign:String = "center";
+ public function set labelAlign(direction:String):void
+ {
+ _labelAlign = direction;
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ //////////// Colors ///////////////
+
+ private var _upColors:Array = [0xdfdfdf, 0xffffff];
+ private var _overColors:Array = [0xffffff,0xdfdfdf];
+ private var _downColors:Array = [0xdfdfdf,0xdfdfdf];
+
+ public function set upColors(clrs:Array):void
+ {
+ this._upColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set overColors(clrs:Array):void
+ {
+ this._overColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set downColors(clrs:Array):void
+ {
+ this._downColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ /**
+ * Shortcut function for setting colors of all 3 button states
+ * in one pass. Not recommended since there is no feedback to
+ * the user on rollover and rollout states.
+ */
+ public function set colors(clrs:Array):void
+ {
+ this._upColors = clrs;
+ this._overColors = clrs;
+ this._downColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set stroke(str:Stroke):void
+ {
+ _stroke = str;
+ this.invalidateDisplayList();
+ }
+
+
+ public function set cornerRadius(cr:Number):void
+ {
+ this._cornerRadius = cr;
+ if(this.gradientPainter){
+ gradientPainter.cornerRadius = cr;
+ }
+ if(this._skinnedControl){
+ this.invalidateDisplayList();
+ }
+ }
+
+ ///////////////// Button Behavior ////////
+
+ public function changeState(fromState:String, toState:String):void
+ {
+ this.gradientPainter = new GradientFillPainter([0,0])
+ if(toState==ButtonEvent.UP)
+ {
+ gradientPainter.colors = _upColors;
+ gradientPainter.stroke = _stroke;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ gradientPainter.colors = _overColors;
+ gradientPainter.stroke = _stroke;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ gradientPainter.colors = _downColors;
+ // draw the focus stroke
+ gradientPainter.stroke = new Stroke(1,0x559DE6);
+ }
+ else
+ {
+ gradientPainter.colors = _upColors;
+ gradientPainter.stroke = _stroke;
+ }
+ gradientPainter.cornerRadius = _cornerRadius;
+ gradientPainter.rotation = Math.PI/2;
+
+ this.backgroundPainter = gradientPainter;
+ invalidateDisplayList();
+ }
+
+ override public function dispose():void
+ {
+ if(this.parent)
+ {
+ this.parent.removeChild(this);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(label){
+
+ label.textField.autoSize = "left";
+ label.y = (unscaledHeight-label.height)/2;
+
+ if(this._labelAlign == "center"){
+ label.x = (unscaledWidth-label.width)/2;
+ }
+ else if(_labelAlign == "left"){
+ label.x = 10;
+ }
+ }
+
+ if(_icon){
+ if(!label){
+ _icon.x = (unscaledWidth-_icon.width)/2;
+ _icon.y = (unscaledHeight-_icon.height)/2;
+ }
+ else{
+ if(_labelAlign == "left"){
+ _icon.x = label.x;
+ label.x += _icon.width+5;
+ }
+ else{
+ _icon.x = label.x-_icon.width-5;
+ }
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/12/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/12/history.index
new file mode 100644
index 0000000..b049367
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/12/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/48/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/48/history.index
new file mode 100644
index 0000000..25fa08b
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/48/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/a8/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/a8/history.index
new file mode 100644
index 0000000..96f5e50
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/a8/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/history.index
new file mode 100644
index 0000000..9720c42
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/4a/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/3d/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/3d/history.index
new file mode 100644
index 0000000..c6a8790
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/3d/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/history.index
new file mode 100644
index 0000000..74b7a17
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/66/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/95/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/95/history.index
new file mode 100644
index 0000000..94a7857
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/95/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/96/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/96/history.index
new file mode 100644
index 0000000..cc6381f
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/96/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/9f/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/9f/history.index
new file mode 100644
index 0000000..5cca312
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/9f/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/e9/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/e9/history.index
new file mode 100644
index 0000000..3b0e7a8
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/e9/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/history.index
new file mode 100644
index 0000000..358bf7a
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/a0/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/b1/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/b1/history.index
new file mode 100644
index 0000000..8b50a8b
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/b1/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/d6/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/d6/history.index
new file mode 100644
index 0000000..e336b27
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/d6/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/e7/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/e7/history.index
new file mode 100644
index 0000000..5335eb9
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/e7/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/fe/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/fe/history.index
new file mode 100644
index 0000000..4b6d0a2
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/ce/e4/90/fe/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/81/24/d9/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/81/24/d9/history.index
new file mode 100644
index 0000000..297468c
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/81/24/d9/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/24/d9/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/24/d9/history.index
new file mode 100644
index 0000000..eb5c072
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/24/d9/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/49/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/49/history.index
new file mode 100644
index 0000000..041a042
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/49/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/d9/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/d9/history.index
new file mode 100644
index 0000000..8b5817a
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/e4/90/d9/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/history.index
new file mode 100644
index 0000000..80dba3c
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/e4/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/history.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/history.index
new file mode 100644
index 0000000..f33c198
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/history.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/properties.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/properties.index
new file mode 100644
index 0000000..590a3af
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.indexes/properties.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.markers b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.markers
new file mode 100644
index 0000000..2404389
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/.markers differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroExample.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroExample.cache
new file mode 100644
index 0000000..66dba76
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroExample.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroTooltip.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroTooltip.cache
new file mode 100644
index 0000000..c03a6c8
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/OpenPyroTooltip.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/SimpleRepeater.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/SimpleRepeater.cache
new file mode 100644
index 0000000..0e8b1b4
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/SimpleRepeater.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestChildBasedValidation.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestChildBasedValidation.cache
new file mode 100644
index 0000000..6cca5e0
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestChildBasedValidation.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestComboBox.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestComboBox.cache
new file mode 100644
index 0000000..2bc3c07
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestComboBox.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestHDividedBox.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestHDividedBox.cache
new file mode 100644
index 0000000..b7b5370
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestHDividedBox.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestImage.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestImage.cache
new file mode 100644
index 0000000..8e0a4ef
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestImage.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestLayouts.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestLayouts.cache
new file mode 100644
index 0000000..09667a4
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestLayouts.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestList.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestList.cache
new file mode 100644
index 0000000..96e1a8c
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestList.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestNestedContainers.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestNestedContainers.cache
new file mode 100644
index 0000000..fbb3baf
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestNestedContainers.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestShapes.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestShapes.cache
new file mode 100644
index 0000000..7978cc9
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestShapes.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSimpleList.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSimpleList.cache
new file mode 100644
index 0000000..fa6183b
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSimpleList.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSlider.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSlider.cache
new file mode 100644
index 0000000..c225665
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestSlider.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestStyleManager.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestStyleManager.cache
new file mode 100644
index 0000000..f445e4f
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestStyleManager.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestTree.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestTree.cache
new file mode 100644
index 0000000..7b9c6fa
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestTree.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestVDividedBox.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestVDividedBox.cache
new file mode 100644
index 0000000..a96cced
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestVDividedBox.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestViewStack.cache b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestViewStack.cache
new file mode 100644
index 0000000..9657f25
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.projects/OpenPyroExample/com.adobe.flexbuilder.project/TestViewStack.cache differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
new file mode 100644
index 0000000..25cb955
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index
new file mode 100644
index 0000000..0fdfb17
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
new file mode 100644
index 0000000..6b2aaa7
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree
new file mode 100644
index 0000000..a56f8e3
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree differ
diff --git a/examples/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/examples/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
new file mode 100644
index 0000000..04c82c7
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ
diff --git a/examples/.metadata/.plugins/org.eclipse.debug.core/.launches/OpenPyroExample.launch b/examples/.metadata/.plugins/org.eclipse.debug.core/.launches/OpenPyroExample.launch
new file mode 100644
index 0000000..5184f29
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.debug.core/.launches/OpenPyroExample.launch
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/examples/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
new file mode 100644
index 0000000..923a54e
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/examples/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat
new file mode 100644
index 0000000..0bad0d4
Binary files /dev/null and b/examples/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ
diff --git a/examples/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/examples/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml
new file mode 100644
index 0000000..11a0f4d
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/examples/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
new file mode 100644
index 0000000..a1c0a4e
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.search/dialog_settings.xml b/examples/.metadata/.plugins/org.eclipse.search/dialog_settings.xml
new file mode 100644
index 0000000..b3015a2
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.search/dialog_settings.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/examples/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
new file mode 100644
index 0000000..409e975
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml b/examples/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml
new file mode 100644
index 0000000..87860c3
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.ui.workbench.texteditor/dialog_settings.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/examples/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
new file mode 100644
index 0000000..20bc378
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml b/examples/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
new file mode 100644
index 0000000..7dc4ff3
--- /dev/null
+++ b/examples/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
@@ -0,0 +1,253 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/.metadata/version.ini b/examples/.metadata/version.ini
new file mode 100644
index 0000000..c335d75
--- /dev/null
+++ b/examples/.metadata/version.ini
@@ -0,0 +1 @@
+com.adobe.flexbuilder.standalone=1
\ No newline at end of file
diff --git a/examples/OpenPyroExample/.actionScriptProperties b/examples/OpenPyroExample/.actionScriptProperties
new file mode 100644
index 0000000..5795e59
--- /dev/null
+++ b/examples/OpenPyroExample/.actionScriptProperties
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/AC_OETags.js b/examples/OpenPyroExample/bin-debug/AC_OETags.js
new file mode 100644
index 0000000..6366467
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/AC_OETags.js
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+ var version;
+ var axo;
+ var e;
+
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+ try {
+ // version will be set for 7.X or greater players
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 6.X players only
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+
+ // installed player is some revision of 6.0
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+ // so we have to be careful.
+
+ // default to the first public version
+ version = "WIN 6,0,21,0";
+
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
+ axo.AllowScriptAccess = "always";
+
+ // safe to call for 6.0r47 or greater
+ version = axo.GetVariable("$version");
+
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 4.X or 5.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = axo.GetVariable("$version");
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 3.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+ version = "WIN 3,0,18,0";
+ } catch (e) {
+ }
+ }
+
+ if (!version)
+ {
+ try {
+ // version will be set for 2.X player
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+ version = "WIN 2,0,0,11";
+ } catch (e) {
+ version = -1;
+ }
+ }
+
+ return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
+ var flashVer = -1;
+
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+ var descArray = flashDescription.split(" ");
+ var tempArrayMajor = descArray[2].split(".");
+ var versionMajor = tempArrayMajor[0];
+ var versionMinor = tempArrayMajor[1];
+ var versionRevision = descArray[3];
+ if (versionRevision == "") {
+ versionRevision = descArray[4];
+ }
+ if (versionRevision[0] == "d") {
+ versionRevision = versionRevision.substring(1);
+ } else if (versionRevision[0] == "r") {
+ versionRevision = versionRevision.substring(1);
+ if (versionRevision.indexOf("d") > 0) {
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+ }
+ } else if (versionRevision[0] == "b") {
+ versionRevision = versionRevision.substring(1);
+ }
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+ }
+ }
+ // MSN/WebTV 2.6 supports Flash 4
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+ // WebTV 2.5 supports Flash 3
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+ // older WebTV supports Flash 2
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+ else if ( isIE && isWin && !isOpera ) {
+ flashVer = ControlVersion();
+ }
+ return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+ versionStr = GetSwfVer();
+ if (versionStr == -1 ) {
+ return false;
+ } else if (versionStr != 0) {
+ if(isIE && isWin && !isOpera) {
+ // Given "WIN 2,0,0,11"
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
+ tempString = tempArray[1]; // "2,0,0,11"
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
+ } else {
+ versionArray = versionStr.split(".");
+ }
+ var versionMajor = versionArray[0];
+ var versionMinor = versionArray[1];
+ var versionRevision = versionArray[2];
+
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
+ if (versionMajor > parseFloat(reqMajorVer)) {
+ return true;
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
+ if (versionMinor > parseFloat(reqMinorVer))
+ return true;
+ else if (versionMinor == parseFloat(reqMinorVer)) {
+ if (versionRevision >= parseFloat(reqRevision))
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+function AC_AddExtension(src, ext)
+{
+ var qIndex = src.indexOf('?');
+ if ( qIndex != -1)
+ {
+ // Add the extention (if needed) before the query params
+ var path = src.substring(0, qIndex);
+ if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+ return src;
+ else
+ return src.replace(/\?/, ext+'?');
+ }
+ else
+ {
+ // Add the extension (if needed) to the end of the URL
+ if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+ return src; // Already have extension
+ else
+ return src + ext;
+ }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs)
+{
+ var str = '';
+ if (isIE && isWin && !isOpera)
+ {
+ str += '';
+ } else {
+ str += '';
+ }
+
+ document.write(str);
+}
+
+function AC_FL_RunContent(){
+ var ret =
+ AC_GetArgs
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ , "application/x-shockwave-flash"
+ );
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+ var ret = new Object();
+ ret.embedAttrs = new Object();
+ ret.params = new Object();
+ ret.objAttrs = new Object();
+ for (var i=0; i < args.length; i=i+2){
+ var currArg = args[i].toLowerCase();
+
+ switch (currArg){
+ case "classid":
+ break;
+ case "pluginspage":
+ ret.embedAttrs[args[i]] = args[i+1];
+ break;
+ case "src":
+ case "movie":
+ args[i+1] = AC_AddExtension(args[i+1], ext);
+ ret.embedAttrs["src"] = args[i+1];
+ ret.params[srcParamName] = args[i+1];
+ break;
+ case "onafterupdate":
+ case "onbeforeupdate":
+ case "onblur":
+ case "oncellchange":
+ case "onclick":
+ case "ondblClick":
+ case "ondrag":
+ case "ondragend":
+ case "ondragenter":
+ case "ondragleave":
+ case "ondragover":
+ case "ondrop":
+ case "onfinish":
+ case "onfocus":
+ case "onhelp":
+ case "onmousedown":
+ case "onmouseup":
+ case "onmouseover":
+ case "onmousemove":
+ case "onmouseout":
+ case "onkeypress":
+ case "onkeydown":
+ case "onkeyup":
+ case "onload":
+ case "onlosecapture":
+ case "onpropertychange":
+ case "onreadystatechange":
+ case "onrowsdelete":
+ case "onrowenter":
+ case "onrowexit":
+ case "onrowsinserted":
+ case "onstart":
+ case "onscroll":
+ case "onbeforeeditfocus":
+ case "onactivate":
+ case "onbeforedeactivate":
+ case "ondeactivate":
+ case "type":
+ case "codebase":
+ ret.objAttrs[args[i]] = args[i+1];
+ break;
+ case "id":
+ case "width":
+ case "height":
+ case "align":
+ case "vspace":
+ case "hspace":
+ case "class":
+ case "title":
+ case "accesskey":
+ case "name":
+ case "tabindex":
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+ break;
+ default:
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+ }
+ }
+ ret.objAttrs["classid"] = classid;
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
+ return ret;
+}
+
+
diff --git a/examples/OpenPyroExample/bin-debug/OpenPyroExample.html b/examples/OpenPyroExample/bin-debug/OpenPyroExample.html
new file mode 100644
index 0000000..c887d7e
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/OpenPyroExample.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/OpenPyroExample.swf b/examples/OpenPyroExample/bin-debug/OpenPyroExample.swf
new file mode 100644
index 0000000..e0c3696
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/OpenPyroExample.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.html b/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.html
new file mode 100644
index 0000000..7e4a4fc
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.swf b/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.swf
new file mode 100644
index 0000000..bee1be4
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/OpenPyroTooltip.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/SimpleRepeater.html b/examples/OpenPyroExample/bin-debug/SimpleRepeater.html
new file mode 100644
index 0000000..d058ae4
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/SimpleRepeater.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/SimpleRepeater.swf b/examples/OpenPyroExample/bin-debug/SimpleRepeater.swf
new file mode 100644
index 0000000..65f896d
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/SimpleRepeater.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/Skin.fla b/examples/OpenPyroExample/bin-debug/Skin.fla
new file mode 100644
index 0000000..b177d0c
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/Skin.fla differ
diff --git a/examples/OpenPyroExample/bin-debug/Skin.swf b/examples/OpenPyroExample/bin-debug/Skin.swf
new file mode 100644
index 0000000..d7b8c3c
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/Skin.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.html b/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.html
new file mode 100644
index 0000000..b4922ca
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.swf b/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.swf
new file mode 100644
index 0000000..295c621
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestChildBasedValidation.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestComboBox.html b/examples/OpenPyroExample/bin-debug/TestComboBox.html
new file mode 100644
index 0000000..7c363e5
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestComboBox.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestComboBox.swf b/examples/OpenPyroExample/bin-debug/TestComboBox.swf
new file mode 100644
index 0000000..742c62e
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestComboBox.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestHDividedBox.html b/examples/OpenPyroExample/bin-debug/TestHDividedBox.html
new file mode 100644
index 0000000..b4beb02
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestHDividedBox.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestHDividedBox.swf b/examples/OpenPyroExample/bin-debug/TestHDividedBox.swf
new file mode 100644
index 0000000..e6a9c5a
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestHDividedBox.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestImage.html b/examples/OpenPyroExample/bin-debug/TestImage.html
new file mode 100644
index 0000000..f37a007
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestImage.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestImage.swf b/examples/OpenPyroExample/bin-debug/TestImage.swf
new file mode 100644
index 0000000..2093acc
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestImage.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestLayouts.html b/examples/OpenPyroExample/bin-debug/TestLayouts.html
new file mode 100644
index 0000000..af9d157
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestLayouts.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestLayouts.swf b/examples/OpenPyroExample/bin-debug/TestLayouts.swf
new file mode 100644
index 0000000..b1ecc11
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestLayouts.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestList.html b/examples/OpenPyroExample/bin-debug/TestList.html
new file mode 100644
index 0000000..c54e7d9
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestList.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestList.swf b/examples/OpenPyroExample/bin-debug/TestList.swf
new file mode 100644
index 0000000..34e7438
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestList.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestNestedContainers.html b/examples/OpenPyroExample/bin-debug/TestNestedContainers.html
new file mode 100644
index 0000000..f57040a
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestNestedContainers.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestNestedContainers.swf b/examples/OpenPyroExample/bin-debug/TestNestedContainers.swf
new file mode 100644
index 0000000..34d2941
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestNestedContainers.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestShapes.html b/examples/OpenPyroExample/bin-debug/TestShapes.html
new file mode 100644
index 0000000..f685509
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestShapes.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestShapes.swf b/examples/OpenPyroExample/bin-debug/TestShapes.swf
new file mode 100644
index 0000000..3e33077
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestShapes.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestSimpleList.html b/examples/OpenPyroExample/bin-debug/TestSimpleList.html
new file mode 100644
index 0000000..7692824
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestSimpleList.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestSimpleList.swf b/examples/OpenPyroExample/bin-debug/TestSimpleList.swf
new file mode 100644
index 0000000..d9fcf1f
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestSimpleList.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestSlider.html b/examples/OpenPyroExample/bin-debug/TestSlider.html
new file mode 100644
index 0000000..dc28830
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestSlider.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestSlider.swf b/examples/OpenPyroExample/bin-debug/TestSlider.swf
new file mode 100644
index 0000000..4069eef
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestSlider.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestStyleManager.html b/examples/OpenPyroExample/bin-debug/TestStyleManager.html
new file mode 100644
index 0000000..f9e51cf
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestStyleManager.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestStyleManager.swf b/examples/OpenPyroExample/bin-debug/TestStyleManager.swf
new file mode 100644
index 0000000..2c2a5f0
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestStyleManager.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestTree.html b/examples/OpenPyroExample/bin-debug/TestTree.html
new file mode 100644
index 0000000..4bc61a7
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestTree.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestTree.swf b/examples/OpenPyroExample/bin-debug/TestTree.swf
new file mode 100644
index 0000000..ee8f441
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestTree.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestVDividedBox.html b/examples/OpenPyroExample/bin-debug/TestVDividedBox.html
new file mode 100644
index 0000000..41b70f8
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestVDividedBox.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestVDividedBox.swf b/examples/OpenPyroExample/bin-debug/TestVDividedBox.swf
new file mode 100644
index 0000000..24d21b4
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestVDividedBox.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/TestViewStack.html b/examples/OpenPyroExample/bin-debug/TestViewStack.html
new file mode 100644
index 0000000..8c5eecd
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/TestViewStack.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/TestViewStack.swf b/examples/OpenPyroExample/bin-debug/TestViewStack.swf
new file mode 100644
index 0000000..34f193e
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/TestViewStack.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/assets/graphic_assets.fla b/examples/OpenPyroExample/bin-debug/assets/graphic_assets.fla
new file mode 100644
index 0000000..5b10d98
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/assets/graphic_assets.fla differ
diff --git a/examples/OpenPyroExample/bin-debug/assets/graphic_assets.swf b/examples/OpenPyroExample/bin-debug/assets/graphic_assets.swf
new file mode 100644
index 0000000..ea4ac60
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/assets/graphic_assets.swf differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/all-classes.html b/examples/OpenPyroExample/bin-debug/docs/all-classes.html
new file mode 100644
index 0000000..3eaf91e
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/docs/all-classes.html
@@ -0,0 +1,172 @@
+
+
+
+
+All Classes - API Documentation
+
+
+
+
+
+
Overrides the set measuredHeight property from MeasurableControl
+ to invalidate children (UIControl acknowledges that it can have
+ children whose dimensions are based on its own)
Overrides the set measuredWidth property from MeasurableControl
+ to invalidate children (UIControl acknowledges that it can have
+ children whose dimensions are based on its own)
+
+
+
minimum
+ — Property in class com.cimians.openPyro.controls.Slider
+
+
+
+
+
+
+
miterLimit
+ — Property in class com.cimians.openPyro.painters.Stroke
For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are set to the same as
+ the each other to create square buttons
UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight based on its
+ children IF explicit, percent and percentUnused width and height are
+ both not set
UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight based on its
+ children IF explicit, percent and percentUnused width and height are
+ both not set
Documentation for classes includes syntax, usage information, and
+code samples for methods, properties, and event handlers and listeners
+for those APIs that belong to a specific class in ActionScript. The
+classes are listed alphabetically. If you are not sure to which class a
+certain method or property belongs, you can look it up in the Index.
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are
+ set to the same as the each other to create square
+ buttons
+
+decrementButton:Button [read-write]Implementation
+
+ public function get decrementButton():Button
+
+ public function set decrementButton(value:Button):void
+
+
+incrementButton:Button [read-write]Implementation
+
+ public function get incrementButton():Button
+
+ public function set incrementButton(value:Button):void
+
+
+slider:Slider [read-write]Implementation
+
+ public function get slider():Slider
+
+ public function set slider(value:Slider):void
+
+
+
+
+
+
_visibleScroll
property
+
+
+
+protected var _visibleScroll:Number = NaN
+
+
+
Constructor detail
+
+
+
+
ScrollBar
()
constructor
+
+
+
+public function ScrollBar(direction:String)Parameters
+
+
+
direction:String
+
+
+
+
+
Method detail
+
+
+
+
initialize
()
method
+
+
+
+public override function initialize():void
+ At the very least, a scrollBar needs a slider
+ or some subclass of it.
+ Increment and Decrement Buttons are created
+ automatically when a skin is applied.
+
+
+
+
+
onSliderThumbDrag
()
method
+
+
+
+protected function onSliderThumbDrag(event:SliderEvent):voidParameters
+
+public function setScrollProperty(visibleScroll:Number, maxScroll:Number):voidParameters
+
+
+
visibleScroll:Number
+
+
+
+
+
+
maxScroll:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are
+ set to the same as the each other to create square
+ buttons
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+
+ A ClassFactory instance is a "factory object" which can be used
+ to generate instances of another class, each with identical properties.
+
+
+
+
+
+ Creates a new instance of the generator class,
+ with the properties specified by properties.
+
ClassFactory
+
+
+
+
+
+
+
Property detail
+
+
+
+
generator
property
+
+
+
+public var generator:Class
+ The Class that the newInstance() method uses
+ to generate objects from this factory object.
+
+
+
+
+
properties
property
+
+
+
+public var properties:Object = null
+ An Object whose name/value pairs specify the properties to be set
+ on each object generated by the newInstance() method.
+
For example, if you set properties to
+ { text: "Hello", width: 100 }, then every instance
+ of the generator class that is generated by calling
+ newInstance() will have its text set to
+ "Hello" and its width set to
+ 100.
+
The default value is null.
+
+
+
Constructor detail
+
+
+
+
ClassFactory
()
constructor
+
+
+
+public function ClassFactory(generator:Class = null)
+ Constructor.
+
Parameters
+
+
+
generator:Class (default = null) — The Class that the newInstance() method uses
+ to generate objects from this factory object.
+
+
+
+
+
+
Method detail
+
+
+
+
newInstance
()
method
+
+
+
+public function newInstance():*
+ Creates a new instance of the generator class,
+ with the properties specified by properties.
+
This method implements the newInstance() method
+ of the IFactory interface.
+protected var _dimensionsChanged:Boolean = false
+
+
+
+
+
displayListInvalidated
property
+
+
+
+protected var displayListInvalidated:Boolean = true
+ Flag to mark a dirty displaylist. It basically means it is
+ waiting for a call to updateDisplayList at some point
+
+
+
+
+
_explicitHeight
property
+
+
+
+protected var _explicitHeight:Number = NaN
+
+
+
+
+
explicitHeight
property
+
+
+
+explicitHeight:Number [read-write]
+ The height set in terms of actual pixels.
+ You do not call this function in your code.
+ Setting the width of the control to an actual
+ numeric value (rather than percent) calls this
+ function
+ Call this function only if you want to set
+ width without calling the invalidation methods
+
+ [TODO] This class should
+ have namespace access control (pyro_internal)
+
Implementation
+
+ public function get explicitHeight():Number
+
+ public function set explicitHeight(value:Number):void
+
+
+
+
+
+
_explicitWidth
property
+
+
+
+protected var _explicitWidth:Number = NaN
+
+
+
+
+
explicitWidth
property
+
+
+
+explicitWidth:Number [read-write]
+ The width set in terms of actual pixels.
+ You do not call this function in your code.
+ Setting the width of the control to an actual
+ numeric value (rather than percent) calls this
+ function
+ Call this function only if you want to set
+ width without calling the invalidation methods
+
+ [TODO] This class should
+ have namespace access control (pyro_internal)
+
Implementation
+
+ public function get explicitWidth():Number
+
+ public function set explicitWidth(value:Number):void
+
+
+
+
+
+
height
property
+
+
+
+height:Number [read-write]
+ Set/get the height of the control. If the height
+ is set to a different value from the one the
+ control is already at, it triggers the size
+ invalidation cycle
+
Implementation
+
+ public function get height():Number
+
+ public function set height(value:Number):void
+
+
+
+
+
+
initialized
property
+
+
+
+public var initialized:Boolean = false
+
+
+
+
+
_measuredHeight
property
+
+
+
+protected var _measuredHeight:Number = NaN
+
+
+
+
+
measuredHeight
property
+
+
+
+measuredHeight:Number [read-write]
+ Set the measured height of the control. This is
+ usually set by the same control's measure()
+ function. If the measuredHeight is changed,
+ the displayList is invalidated
+
Implementation
+
+ public function get measuredHeight():Number
+
+ public function set measuredHeight(value:Number):void
+
+
+
+
+
+
_measuredWidth
property
+
+
+
+protected var _measuredWidth:Number = NaN
+
+
+
+
+
measuredWidth
property
+
+
+
+measuredWidth:Number [read-write]Implementation
+
+ public function get measuredWidth():Number
+
+ public function set measuredWidth(value:Number):void
+
+
+
+
+
+
needsMeasurement
property
+
+
+
+public var needsMeasurement:Boolean = true
+ Only setting percent width/heights changes the
+ needsMeasurement flag which makes its parent
+ container call measure on it.
+ If width and height are set directly, measurement
+ is never called (although size invalidation
+ still does if size has changed)
+
+parentContainer:UIControl [read-write]Implementation
+
+ public function get parentContainer():UIControl
+
+ public function set parentContainer(value:UIControl):void
+
+
+
+
+
+
_percentHeight
property
+
+
+
+protected var _percentHeight:Number
+
+
+
+
+
percentHeight
property
+
+
+
+percentHeight:Number [read-write]Implementation
+
+ public function get percentHeight():Number
+
+ public function set percentHeight(value:Number):void
+
+
+
+
+
+
_percentUnusedHeight
property
+
+
+
+protected var _percentUnusedHeight:Number
+
+
+
+
+
percentUnusedHeight
property
+
+
+
+percentUnusedHeight:Number [read-write]
+ Set/get the percent height. If the value is
+ different from the earlier, it sets the measurement
+ flag and calls invalidateSize
+
Implementation
+
+ public function get percentUnusedHeight():Number
+
+ public function set percentUnusedHeight(value:Number):void
+
+
+
+
+
+
_percentUnusedWidth
property
+
+
+
+protected var _percentUnusedWidth:Number
+
+
+
+
+
percentUnusedWidth
property
+
+
+
+percentUnusedWidth:Number [read-write]
+ Set/get the percent width. If the value is
+ different from the earlier, it sets the measurement
+ flag and calls invalidateSize
+
Implementation
+
+ public function get percentUnusedWidth():Number
+
+ public function set percentUnusedWidth(value:Number):void
+
+
+
+
+
+
_percentWidth
property
+
+
+
+protected var _percentWidth:Number
+
+
+
+
+
percentWidth
property
+
+
+
+percentWidth:Number [read-write]Implementation
+
+ public function get percentWidth():Number
+
+ public function set percentWidth(value:Number):void
+
+
+
+
+
+
sizeInvalidated
property
+
+
+
+public var sizeInvalidated:Boolean = false
+ The flag to mark that the control's size
+ has been invalidated. This means the control
+ is now waiting for a validateSize call.
+
+
+
+
+
usesMeasurementStrategy
property
+
+
+
+usesMeasurementStrategy:Boolean [read-only]Implementation
+
+ public function get usesMeasurementStrategy():Boolean
+
+
+
+
+
+
width
property
+
+
+
+width:Number [read-write]
+ Set/get the width of the control. If the width
+ is set to a different value from the one the
+ control is already at, it triggers the size
+ invalidation cycle
+
Implementation
+
+ public function get width():Number
+
+ public function set width(value:Number):void
+
+
+
+
Constructor detail
+
+
+
+
MeasurableControl
()
constructor
+
+
+
+public function MeasurableControl()
+
+
+
Method detail
+
+
+
+
checkDisplayListValidation
()
method
+
+
+
+public function checkDisplayListValidation():void
+
+
+
+
+
doOnAdded
()
method
+
+
+
+public function doOnAdded():void
+ [Temp] This function is called automatically
+ by a parent UIControl if this is created as a
+ child of a UIControl. Else you have to call
+ this function for now.
+
+
+
+
+
doQueuedValidateSize
()
method
+
+
+
+protected function doQueuedValidateSize(event:Event):void
+ doQueueValidateSize is executed by the top level UIControl.
+
Parameters
+
+
+
event:Event
+
+
+
+
+
+
+
getExplicitOrMeasuredHeight
()
method
+
+
+
+public function getExplicitOrMeasuredHeight():Number
+ Returns the explicitly defined height or the measured
+ height computed by the measure function.
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
getExplicitOrMeasuredWidth
()
method
+
+
+
+public function getExplicitOrMeasuredWidth():Number
+ Returns the explicitly defined width or the measured
+ number computed by the measure function.
+
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
initialize
()
method
+
+
+
+public function initialize():void
+ This happens only once when a child is
+ first added to any parent. Subsequent
+ removeChild and addChild actions do not
+ trigger this function.
+
+
+
+
+
invalidateDisplayList
()
method
+
+
+
+protected function invalidateDisplayList():void
+
+
+
+
+
invalidateSize
()
method
+
+
+
+public function invalidateSize():void
+ Marks itself dirty and waits till either the container
+ to validateSize or validates itself at the next enterframe
+ if it has no parent container.
+
+ This method is overridden by UIControl. The code here
+ will only be useful for a Spacer type of component.
+
+
+
+
+
measure
()
method
+
+
+
+public function measure():void
+ Measure is called during the validateSize if
+ the needsmeasurement flag is set.
+ At this point, new measured width/heights are
+ calculated. If these values are different from
+ the values previously calculated, the
+ resizeHandler is queued for the next enterframe
+
+
+
+
+
onAddedToParent
()
method
+
+
+
+protected function onAddedToParent(event:Event):voidParameters
+
+
+
event:Event
+
+
+
+
+
+
+
queueValidateDisplayList
()
method
+
+
+
+public function queueValidateDisplayList():void
+
+
+
+
+
resizeHandler
()
method
+
+
+
+public function resizeHandler():void
+
+
+
+
+
updateDisplayList
()
method
+
+
+
+public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateDisplayList
()
method
+
+
+
+public function validateDisplayList(event:Event = null):void
+ validateDisplayList is called as a response to invalidateDisplayList.
+
Parameters
+
+
+
event:Event (default = null)
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public function validateSize():void
+ The validateSize function is called in response to
+ a component declaring its size invalid (usually
+ by calling invalidateSize()). The job of this
+ method is to compute the final width and height
+ (whether by calling measure if an explicit w/h
+ is not declared or not if an explicit w & h is
+ declared)
+
+
+
+ UIContainers extend UIControls and introduce
+ the concept of scrolling and layouts. If the
+ bounds of the children of a UIContainer, they
+ get clipped by the mask layer on top.
+
+ todo: Create UIContainer.clipContent = false/true function
+
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+
Parameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+
+
+
+
widthForMeasurement
()
method
+
+
+
+public override function widthForMeasurement():Number
+ When measure is called, it uses the widthForMeasurement and
+ heightForMeasurement to calculate the sizes for
+ percent-dimension based children
+
+
+ The UIControl is the basic building block for
+ pyro controls. UIControls can include other UIControls
+ as children but cannot use layouts to position them.
+
+
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
Implementation
+
+ public function get measuredHeight():Number
+
+ public function set measuredHeight(value:Number):void
+
+
+
+
+
+
measuredWidth
property
+
+
+
+measuredWidth:Number [read-write]
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
Implementation
+
+ public function get measuredWidth():Number
+
+ public function set measuredWidth(value:Number):void
+
+
+skinnedControl:UIControl [write-only]Implementation
+
+ public function set skinnedControl(value:UIControl):void
+
+
+
+
+
+
_styleName
property
+
+
+
+protected var _styleName:String
+
+
+
+
+
styleName
property
+
+
+
+styleName:String [read-write]
+ Defines the skin this component is registered to.
+ As long as a skin is registered with the same
+ name as this value, this control will get that
+ skin when instantiated or when that definition
+ changes.
+
+
Implementation
+
+ public function get styleName():String
+
+ public function set styleName(value:String):void
+
+
+public override function removeChild(d:DisplayObject):DisplayObject
+
Parameters
+
+
+
d:DisplayObject
+
+
+
+Returns
+
+
+
DisplayObject
+
+
+
+
+
+
+
setSize
()
method
+
+
+
+public function setSize(w:*, h:*):void
+ Convinience function for setting width and height
+ in one call. The parameters can either be Strings
+ or Numbers. When passing strings, you can append
+ a '%' character at the end of the string to set a
+ percent value
+
+
Parameters
+
+
+
w:* — Width either as a Number or as a String
+ ending with a % character
+
+
+
+
+
+
+
h:* — Height either as a Number or as a String
+ ending with a % character
+
+
+
+
+
+Throws
+
+
+
— if the datatype passed in is not a Number
+ or String
+
+
+
+
+
+
+
+
updateDisplayList
()
method
+
+
+
+public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ The validateSize function is called in response to
+ a component declaring its size invalid (usually
+ by calling invalidateSize()). The job of this
+ method is to compute the final width and height
+ (whether by calling measure if an explicit w/h
+ is not declared or not if an explicit w & h is
+ declared)
+
+
+
+
+
+
widthForMeasurement
()
method
+
+
+
+public function widthForMeasurement():Number
+ When measure is called, it uses the widthForMeasurement and
+ heightForMeasurement to calculate the sizes for
+ percent-dimension based children
+
[static]
+ Swaps the positions of two items if they are found in the
+ source array.
+
ArrayUtil
+
+
+
+
+
+
+
Method detail
+
+
+
+
createProgressiveArray
()
method
+
+
+
+public static function createProgressiveArray(n:Number, s:Number, e:Number):ArrayParameters
+
+
+
n:Number
+
+
+
+
+
+
s:Number
+
+
+
+
+
+
e:Number
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
createRepeatingArray
()
method
+
+
+
+public static function createRepeatingArray(n:Number, v:Number):ArrayParameters
+
+
+
n:Number
+
+
+
+
+
+
v:Number
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
getItemIndex
()
method
+
+
+
+public static function getItemIndex(src:Array, item:*):Number
+ Returns the index number of an item in the array if that
+ item exists. Else NaN is returned
+
+
Parameters
+
+
+
src:Array
+
+
+
+
+
+
item:*
+
+
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
insertArray
()
method
+
+
+
+public static function insertArray(sourceArray:Array, arrayToInsert:Array):Array
+ Inserts all the elements of the arrayToInsert Array into the sourceArray.
+ The elements are inserted at the end of the sourceArray.
+
+ TODO: This isnt the most efficient way to do it. There is a way using splice or something.
+
Parameters
+
+
+
sourceArray:Array
+
+
+
+
+
+
arrayToInsert:Array
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
insertAt
()
method
+
+
+
+public static function insertAt(src:Array, idx:Number, data:*):void
+ Inserts the data at the specified index of the array.
+ The operation is carried out on the source array and not
+ on a copy.
+
+
Parameters
+
+
+
src:Array — The source Array
+
+
+
+
+
+
+
idx:Number — The index at which data needs to be inserted.
+ The index can be greater than the length of the
+ array, in which case, all intermediate values are
+ initialized to undefined.
+
+
+
+
+
+
+
data:* — The data to be inserted into the Array.
+
+
+
+
+
+
+
+
remove
()
method
+
+
+
+public static function remove(src:Array, item:*):void
+ Removes the FIRST instance of the item passed in as a parameter
+
Parameters
+
+
+
src:Array
+
+
+
+
+
+
item:*
+
+
+
+
+
+
+
removeDuplicates
()
method
+
+
+
+public static function removeDuplicates(arr:Array):ArrayParameters
+
+
+
arr:Array
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
removeItemAt
()
method
+
+
+
+public static function removeItemAt(src:Array, idx:uint):voidParameters
+
+
+
src:Array
+
+
+
+
+
+
idx:uint
+
+
+
+
+
+
+
swapByIndex
()
method
+
+
+
+public static function swapByIndex(src:Array, idx1:Number, idx2:Number):voidParameters
+
+
+
src:Array
+
+
+
+
+
+
idx1:Number
+
+
+
+
+
+
idx2:Number
+
+
+
+
+
+
+
swapByValue
()
method
+
+
+
+public static function swapByValue(src:Array, item1:*, item2:*):void
+ Swaps the positions of two items if they are found in the
+ source array.
+
+
+
+
diff --git a/examples/OpenPyroExample/bin-debug/docs/cookies.js b/examples/OpenPyroExample/bin-debug/docs/cookies.js
new file mode 100644
index 0000000..d6d46ad
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/docs/cookies.js
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// ADOBE SYSTEMS INCORPORATED
+// Copyright 2006-2007 Adobe Systems Incorporated
+// All Rights Reserved.
+//
+// NOTICE: Adobe permits you to use, modify, and distribute this file
+// in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Read the JavaScript cookies tutorial at:
+ * http://www.netspade.com/articles/javascript/cookies.xml
+ */
+
+/**
+ * Sets a Cookie with the given name and value.
+ *
+ * name Name of the cookie
+ * value Value of the cookie
+ * [expires] Expiration date of the cookie (default: end of current session)
+ * [path] Path where the cookie is valid (default: path of calling document)
+ * [domain] Domain where the cookie is valid
+ * (default: domain of calling document)
+ * [secure] Boolean value indicating if the cookie transmission requires a
+ * secure transmission
+ */
+function setCookie(name, value, expires, path, domain, secure)
+{
+ document.cookie= name + "=" + escape(value) +
+ ((expires) ? "; expires=" + expires.toGMTString() : "") +
+ ((path) ? "; path=" + path : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ ((secure) ? "; secure" : "");
+}
+
+/**
+ * Gets the value of the specified cookie.
+ *
+ * name Name of the desired cookie.
+ *
+ * Returns a string containing value of specified cookie,
+ * or null if cookie does not exist.
+ */
+function getCookie(name)
+{
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+ if (begin == -1)
+ {
+ begin = dc.indexOf(prefix);
+ if (begin != 0) return null;
+ }
+ else
+ {
+ begin += 2;
+ }
+ var end = document.cookie.indexOf(";", begin);
+ if (end == -1)
+ {
+ end = dc.length;
+ }
+ return unescape(dc.substring(begin + prefix.length, end));
+}
+
+/**
+ * Deletes the specified cookie.
+ *
+ * name name of the cookie
+ * [path] path of the cookie (must be same as path used to create cookie)
+ * [domain] domain of the cookie (must be same as domain used to create cookie)
+ */
+function deleteCookie(name, path, domain)
+{
+ if (getCookie(name))
+ {
+ document.cookie = name + "=" +
+ ((path) ? "; path=" + path : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+ }
+}
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/collapsed.gif b/examples/OpenPyroExample/bin-debug/docs/images/collapsed.gif
new file mode 100644
index 0000000..f803408
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/collapsed.gif differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/detailHeaderRule.jpg b/examples/OpenPyroExample/bin-debug/docs/images/detailHeaderRule.jpg
new file mode 100644
index 0000000..e73a03b
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/detailHeaderRule.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/detailSectionHeader.jpg b/examples/OpenPyroExample/bin-debug/docs/images/detailSectionHeader.jpg
new file mode 100644
index 0000000..4979b55
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/detailSectionHeader.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/expanded.gif b/examples/OpenPyroExample/bin-debug/docs/images/expanded.gif
new file mode 100644
index 0000000..33779b0
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/expanded.gif differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/inherit-arrow.gif b/examples/OpenPyroExample/bin-debug/docs/images/inherit-arrow.gif
new file mode 100644
index 0000000..bfb4ea7
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/inherit-arrow.gif differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/inheritedSummary.gif b/examples/OpenPyroExample/bin-debug/docs/images/inheritedSummary.gif
new file mode 100644
index 0000000..800b34b
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/inheritedSummary.gif differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/logo.jpg b/examples/OpenPyroExample/bin-debug/docs/images/logo.jpg
new file mode 100644
index 0000000..01d0a14
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/logo.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/titleTableBottom.jpg b/examples/OpenPyroExample/bin-debug/docs/images/titleTableBottom.jpg
new file mode 100644
index 0000000..5c7c510
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/titleTableBottom.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/titleTableMiddle.jpg b/examples/OpenPyroExample/bin-debug/docs/images/titleTableMiddle.jpg
new file mode 100644
index 0000000..c878113
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/titleTableMiddle.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/images/titleTableTop.jpg b/examples/OpenPyroExample/bin-debug/docs/images/titleTableTop.jpg
new file mode 100644
index 0000000..f858cdf
Binary files /dev/null and b/examples/OpenPyroExample/bin-debug/docs/images/titleTableTop.jpg differ
diff --git a/examples/OpenPyroExample/bin-debug/docs/index-list.html b/examples/OpenPyroExample/bin-debug/docs/index-list.html
new file mode 100644
index 0000000..fe65c2d
--- /dev/null
+++ b/examples/OpenPyroExample/bin-debug/docs/index-list.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+Adobe Flex 2 Language Reference
+
+
+
+
+
+
+
+
+
+
+
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+ Link toNon-frame version.
+
+
Overrides the set measuredHeight property from MeasurableControl
+ to invalidate children (UIControl acknowledges that it can have
+ children whose dimensions are based on its own)
Overrides the set measuredWidth property from MeasurableControl
+ to invalidate children (UIControl acknowledges that it can have
+ children whose dimensions are based on its own)
+
+
+
minimum
+ — Property in class com.cimians.openPyro.controls.Slider
+
+
+
+
+
+
+
miterLimit
+ — Property in class com.cimians.openPyro.painters.Stroke
For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are set to the same as
+ the each other to create square buttons
UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight based on its
+ children IF explicit, percent and percentUnused width and height are
+ both not set
UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight based on its
+ children IF explicit, percent and percentUnused width and height are
+ both not set
Documentation for classes includes syntax, usage information, and
+code samples for methods, properties, and event handlers and listeners
+for those APIs that belong to a specific class in ActionScript. The
+classes are listed alphabetically. If you are not sure to which class a
+certain method or property belongs, you can look it up in the Index.
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
Overrides the set
+ measuredHeight property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
Overrides the set
+ measuredWidth property from MeasurableControl to
+ invalidate children (UIControl acknowledges that it can have children
+ whose dimensions are based on its own)
UIControl validateSize
+ extends the MeasurableControl's and can compute its
+ measuredWidth and measuredHeight based on its children IF explicit,
+ percent and percentUnused width and height are both not set
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are
+ set to the same as the each other to create square
+ buttons
+
+decrementButton:Button [read-write]Implementation
+
+ public function get decrementButton():Button
+
+ public function set decrementButton(value:Button):void
+
+
+incrementButton:Button [read-write]Implementation
+
+ public function get incrementButton():Button
+
+ public function set incrementButton(value:Button):void
+
+
+slider:Slider [read-write]Implementation
+
+ public function get slider():Slider
+
+ public function set slider(value:Slider):void
+
+
+
+
+
+
_visibleScroll
property
+
+
+
+protected var _visibleScroll:Number = NaN
+
+
+
Constructor detail
+
+
+
+
ScrollBar
()
constructor
+
+
+
+public function ScrollBar(direction:String)Parameters
+
+
+
direction:String
+
+
+
+
+
Method detail
+
+
+
+
initialize
()
method
+
+
+
+public override function initialize():void
+ At the very least, a scrollBar needs a slider
+ or some subclass of it.
+ Increment and Decrement Buttons are created
+ automatically when a skin is applied.
+
+
+
+
+
onSliderThumbDrag
()
method
+
+
+
+protected function onSliderThumbDrag(event:SliderEvent):voidParameters
+
+public function setScrollProperty(visibleScroll:Number, maxScroll:Number):voidParameters
+
+
+
visibleScroll:Number
+
+
+
+
+
+
maxScroll:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ For scrollBars, unless the dimension properites of the
+ buttons are set, the button's width and heights are
+ set to the same as the each other to create square
+ buttons
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+
+ A ClassFactory instance is a "factory object" which can be used
+ to generate instances of another class, each with identical properties.
+
+
+
+
+
+ Creates a new instance of the generator class,
+ with the properties specified by properties.
+
ClassFactory
+
+
+
+
+
+
+
Property detail
+
+
+
+
generator
property
+
+
+
+public var generator:Class
+ The Class that the newInstance() method uses
+ to generate objects from this factory object.
+
+
+
+
+
properties
property
+
+
+
+public var properties:Object = null
+ An Object whose name/value pairs specify the properties to be set
+ on each object generated by the newInstance() method.
+
For example, if you set properties to
+ { text: "Hello", width: 100 }, then every instance
+ of the generator class that is generated by calling
+ newInstance() will have its text set to
+ "Hello" and its width set to
+ 100.
+
The default value is null.
+
+
+
Constructor detail
+
+
+
+
ClassFactory
()
constructor
+
+
+
+public function ClassFactory(generator:Class = null)
+ Constructor.
+
Parameters
+
+
+
generator:Class (default = null) — The Class that the newInstance() method uses
+ to generate objects from this factory object.
+
+
+
+
+
+
Method detail
+
+
+
+
newInstance
()
method
+
+
+
+public function newInstance():*
+ Creates a new instance of the generator class,
+ with the properties specified by properties.
+
This method implements the newInstance() method
+ of the IFactory interface.
+protected var _dimensionsChanged:Boolean = false
+
+
+
+
+
displayListInvalidated
property
+
+
+
+protected var displayListInvalidated:Boolean = true
+ Flag to mark a dirty displaylist. It basically means it is
+ waiting for a call to updateDisplayList at some point
+
+
+
+
+
_explicitHeight
property
+
+
+
+protected var _explicitHeight:Number = NaN
+
+
+
+
+
explicitHeight
property
+
+
+
+explicitHeight:Number [read-write]
+ The height set in terms of actual pixels.
+ You do not call this function in your code.
+ Setting the width of the control to an actual
+ numeric value (rather than percent) calls this
+ function
+ Call this function only if you want to set
+ width without calling the invalidation methods
+
+ [TODO] This class should
+ have namespace access control (pyro_internal)
+
Implementation
+
+ public function get explicitHeight():Number
+
+ public function set explicitHeight(value:Number):void
+
+
+
+
+
+
_explicitWidth
property
+
+
+
+protected var _explicitWidth:Number = NaN
+
+
+
+
+
explicitWidth
property
+
+
+
+explicitWidth:Number [read-write]
+ The width set in terms of actual pixels.
+ You do not call this function in your code.
+ Setting the width of the control to an actual
+ numeric value (rather than percent) calls this
+ function
+ Call this function only if you want to set
+ width without calling the invalidation methods
+
+ [TODO] This class should
+ have namespace access control (pyro_internal)
+
Implementation
+
+ public function get explicitWidth():Number
+
+ public function set explicitWidth(value:Number):void
+
+
+
+
+
+
height
property
+
+
+
+height:Number [read-write]
+ Set/get the height of the control. If the height
+ is set to a different value from the one the
+ control is already at, it triggers the size
+ invalidation cycle
+
Implementation
+
+ public function get height():Number
+
+ public function set height(value:Number):void
+
+
+
+
+
+
initialized
property
+
+
+
+public var initialized:Boolean = false
+
+
+
+
+
_measuredHeight
property
+
+
+
+protected var _measuredHeight:Number = NaN
+
+
+
+
+
measuredHeight
property
+
+
+
+measuredHeight:Number [read-write]
+ Set the measured height of the control. This is
+ usually set by the same control's measure()
+ function. If the measuredHeight is changed,
+ the displayList is invalidated
+
Implementation
+
+ public function get measuredHeight():Number
+
+ public function set measuredHeight(value:Number):void
+
+
+
+
+
+
_measuredWidth
property
+
+
+
+protected var _measuredWidth:Number = NaN
+
+
+
+
+
measuredWidth
property
+
+
+
+measuredWidth:Number [read-write]Implementation
+
+ public function get measuredWidth():Number
+
+ public function set measuredWidth(value:Number):void
+
+
+
+
+
+
needsMeasurement
property
+
+
+
+public var needsMeasurement:Boolean = true
+ Only setting percent width/heights changes the
+ needsMeasurement flag which makes its parent
+ container call measure on it.
+ If width and height are set directly, measurement
+ is never called (although size invalidation
+ still does if size has changed)
+
+parentContainer:UIControl [read-write]Implementation
+
+ public function get parentContainer():UIControl
+
+ public function set parentContainer(value:UIControl):void
+
+
+
+
+
+
_percentHeight
property
+
+
+
+protected var _percentHeight:Number
+
+
+
+
+
percentHeight
property
+
+
+
+percentHeight:Number [read-write]Implementation
+
+ public function get percentHeight():Number
+
+ public function set percentHeight(value:Number):void
+
+
+
+
+
+
_percentUnusedHeight
property
+
+
+
+protected var _percentUnusedHeight:Number
+
+
+
+
+
percentUnusedHeight
property
+
+
+
+percentUnusedHeight:Number [read-write]
+ Set/get the percent height. If the value is
+ different from the earlier, it sets the measurement
+ flag and calls invalidateSize
+
Implementation
+
+ public function get percentUnusedHeight():Number
+
+ public function set percentUnusedHeight(value:Number):void
+
+
+
+
+
+
_percentUnusedWidth
property
+
+
+
+protected var _percentUnusedWidth:Number
+
+
+
+
+
percentUnusedWidth
property
+
+
+
+percentUnusedWidth:Number [read-write]
+ Set/get the percent width. If the value is
+ different from the earlier, it sets the measurement
+ flag and calls invalidateSize
+
Implementation
+
+ public function get percentUnusedWidth():Number
+
+ public function set percentUnusedWidth(value:Number):void
+
+
+
+
+
+
_percentWidth
property
+
+
+
+protected var _percentWidth:Number
+
+
+
+
+
percentWidth
property
+
+
+
+percentWidth:Number [read-write]Implementation
+
+ public function get percentWidth():Number
+
+ public function set percentWidth(value:Number):void
+
+
+
+
+
+
sizeInvalidated
property
+
+
+
+public var sizeInvalidated:Boolean = false
+ The flag to mark that the control's size
+ has been invalidated. This means the control
+ is now waiting for a validateSize call.
+
+
+
+
+
usesMeasurementStrategy
property
+
+
+
+usesMeasurementStrategy:Boolean [read-only]Implementation
+
+ public function get usesMeasurementStrategy():Boolean
+
+
+
+
+
+
width
property
+
+
+
+width:Number [read-write]
+ Set/get the width of the control. If the width
+ is set to a different value from the one the
+ control is already at, it triggers the size
+ invalidation cycle
+
Implementation
+
+ public function get width():Number
+
+ public function set width(value:Number):void
+
+
+
+
Constructor detail
+
+
+
+
MeasurableControl
()
constructor
+
+
+
+public function MeasurableControl()
+
+
+
Method detail
+
+
+
+
checkDisplayListValidation
()
method
+
+
+
+public function checkDisplayListValidation():void
+
+
+
+
+
doOnAdded
()
method
+
+
+
+public function doOnAdded():void
+ [Temp] This function is called automatically
+ by a parent UIControl if this is created as a
+ child of a UIControl. Else you have to call
+ this function for now.
+
+
+
+
+
doQueuedValidateSize
()
method
+
+
+
+protected function doQueuedValidateSize(event:Event):void
+ doQueueValidateSize is executed by the top level UIControl.
+
Parameters
+
+
+
event:Event
+
+
+
+
+
+
+
getExplicitOrMeasuredHeight
()
method
+
+
+
+public function getExplicitOrMeasuredHeight():Number
+ Returns the explicitly defined height or the measured
+ height computed by the measure function.
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
getExplicitOrMeasuredWidth
()
method
+
+
+
+public function getExplicitOrMeasuredWidth():Number
+ Returns the explicitly defined width or the measured
+ number computed by the measure function.
+
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
initialize
()
method
+
+
+
+public function initialize():void
+ This happens only once when a child is
+ first added to any parent. Subsequent
+ removeChild and addChild actions do not
+ trigger this function.
+
+
+
+
+
invalidateDisplayList
()
method
+
+
+
+protected function invalidateDisplayList():void
+
+
+
+
+
invalidateSize
()
method
+
+
+
+public function invalidateSize():void
+ Marks itself dirty and waits till either the container
+ to validateSize or validates itself at the next enterframe
+ if it has no parent container.
+
+ This method is overridden by UIControl. The code here
+ will only be useful for a Spacer type of component.
+
+
+
+
+
measure
()
method
+
+
+
+public function measure():void
+ Measure is called during the validateSize if
+ the needsmeasurement flag is set.
+ At this point, new measured width/heights are
+ calculated. If these values are different from
+ the values previously calculated, the
+ resizeHandler is queued for the next enterframe
+
+
+
+
+
onAddedToParent
()
method
+
+
+
+protected function onAddedToParent(event:Event):voidParameters
+
+
+
event:Event
+
+
+
+
+
+
+
queueValidateDisplayList
()
method
+
+
+
+public function queueValidateDisplayList():void
+
+
+
+
+
resizeHandler
()
method
+
+
+
+public function resizeHandler():void
+
+
+
+
+
updateDisplayList
()
method
+
+
+
+public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateDisplayList
()
method
+
+
+
+public function validateDisplayList(event:Event = null):void
+ validateDisplayList is called as a response to invalidateDisplayList.
+
Parameters
+
+
+
event:Event (default = null)
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public function validateSize():void
+ The validateSize function is called in response to
+ a component declaring its size invalid (usually
+ by calling invalidateSize()). The job of this
+ method is to compute the final width and height
+ (whether by calling measure if an explicit w/h
+ is not declared or not if an explicit w & h is
+ declared)
+
+
+
+ UIContainers extend UIControls and introduce
+ the concept of scrolling and layouts. If the
+ bounds of the children of a UIContainer, they
+ get clipped by the mask layer on top.
+
+ todo: Create UIContainer.clipContent = false/true function
+
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+
Parameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+
+
+
+
widthForMeasurement
()
method
+
+
+
+public override function widthForMeasurement():Number
+ When measure is called, it uses the widthForMeasurement and
+ heightForMeasurement to calculate the sizes for
+ percent-dimension based children
+
+
+ The UIControl is the basic building block for
+ pyro controls. UIControls can include other UIControls
+ as children but cannot use layouts to position them.
+
+
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ Overrides the set measuredHeight property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
Implementation
+
+ public function get measuredHeight():Number
+
+ public function set measuredHeight(value:Number):void
+
+
+
+
+
+
measuredWidth
property
+
+
+
+measuredWidth:Number [read-write]
+ Overrides the set measuredWidth property from
+ MeasurableControl to invalidate children
+ (UIControl acknowledges that it can have children whose
+ dimensions are based on its own)
+
Implementation
+
+ public function get measuredWidth():Number
+
+ public function set measuredWidth(value:Number):void
+
+
+skinnedControl:UIControl [write-only]Implementation
+
+ public function set skinnedControl(value:UIControl):void
+
+
+
+
+
+
_styleName
property
+
+
+
+protected var _styleName:String
+
+
+
+
+
styleName
property
+
+
+
+styleName:String [read-write]
+ Defines the skin this component is registered to.
+ As long as a skin is registered with the same
+ name as this value, this control will get that
+ skin when instantiated or when that definition
+ changes.
+
+
Implementation
+
+ public function get styleName():String
+
+ public function set styleName(value:String):void
+
+
+public override function removeChild(d:DisplayObject):DisplayObject
+
Parameters
+
+
+
d:DisplayObject
+
+
+
+Returns
+
+
+
DisplayObject
+
+
+
+
+
+
+
setSize
()
method
+
+
+
+public function setSize(w:*, h:*):void
+ Convinience function for setting width and height
+ in one call. The parameters can either be Strings
+ or Numbers. When passing strings, you can append
+ a '%' character at the end of the string to set a
+ percent value
+
+
Parameters
+
+
+
w:* — Width either as a Number or as a String
+ ending with a % character
+
+
+
+
+
+
+
h:* — Height either as a Number or as a String
+ ending with a % character
+
+
+
+
+
+Throws
+
+
+
— if the datatype passed in is not a Number
+ or String
+
+
+
+
+
+
+
+
updateDisplayList
()
method
+
+
+
+public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
+
+
+
unscaledWidth:Number
+
+
+
+
+
+
unscaledHeight:Number
+
+
+
+
+
+
+
validateSize
()
method
+
+
+
+public override function validateSize():void
+ UIControl validateSize extends the MeasurableControl's
+ and can compute its measuredWidth and measuredHeight
+ based on its children IF explicit, percent and
+ percentUnused width and height are both not set
+
+
+ The validateSize function is called in response to
+ a component declaring its size invalid (usually
+ by calling invalidateSize()). The job of this
+ method is to compute the final width and height
+ (whether by calling measure if an explicit w/h
+ is not declared or not if an explicit w & h is
+ declared)
+
+
+
+
+
+
widthForMeasurement
()
method
+
+
+
+public function widthForMeasurement():Number
+ When measure is called, it uses the widthForMeasurement and
+ heightForMeasurement to calculate the sizes for
+ percent-dimension based children
+
[static]
+ Swaps the positions of two items if they are found in the
+ source array.
+
ArrayUtil
+
+
+
+
+
+
+
Method detail
+
+
+
+
createProgressiveArray
()
method
+
+
+
+public static function createProgressiveArray(n:Number, s:Number, e:Number):ArrayParameters
+
+
+
n:Number
+
+
+
+
+
+
s:Number
+
+
+
+
+
+
e:Number
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
createRepeatingArray
()
method
+
+
+
+public static function createRepeatingArray(n:Number, v:Number):ArrayParameters
+
+
+
n:Number
+
+
+
+
+
+
v:Number
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
getItemIndex
()
method
+
+
+
+public static function getItemIndex(src:Array, item:*):Number
+ Returns the index number of an item in the array if that
+ item exists. Else NaN is returned
+
+
Parameters
+
+
+
src:Array
+
+
+
+
+
+
item:*
+
+
+
+Returns
+
+
+
Number
+
+
+
+
+
+
+
insertArray
()
method
+
+
+
+public static function insertArray(sourceArray:Array, arrayToInsert:Array):Array
+ Inserts all the elements of the arrayToInsert Array into the sourceArray.
+ The elements are inserted at the end of the sourceArray.
+
+ TODO: This isnt the most efficient way to do it. There is a way using splice or something.
+
Parameters
+
+
+
sourceArray:Array
+
+
+
+
+
+
arrayToInsert:Array
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
insertAt
()
method
+
+
+
+public static function insertAt(src:Array, idx:Number, data:*):void
+ Inserts the data at the specified index of the array.
+ The operation is carried out on the source array and not
+ on a copy.
+
+
Parameters
+
+
+
src:Array — The source Array
+
+
+
+
+
+
+
idx:Number — The index at which data needs to be inserted.
+ The index can be greater than the length of the
+ array, in which case, all intermediate values are
+ initialized to undefined.
+
+
+
+
+
+
+
data:* — The data to be inserted into the Array.
+
+
+
+
+
+
+
+
remove
()
method
+
+
+
+public static function remove(src:Array, item:*):void
+ Removes the FIRST instance of the item passed in as a parameter
+
Parameters
+
+
+
src:Array
+
+
+
+
+
+
item:*
+
+
+
+
+
+
+
removeDuplicates
()
method
+
+
+
+public static function removeDuplicates(arr:Array):ArrayParameters
+
+
+
arr:Array
+
+
+
+Returns
+
+
+
Array
+
+
+
+
+
+
+
removeItemAt
()
method
+
+
+
+public static function removeItemAt(src:Array, idx:uint):voidParameters
+
+
+
src:Array
+
+
+
+
+
+
idx:uint
+
+
+
+
+
+
+
swapByIndex
()
method
+
+
+
+public static function swapByIndex(src:Array, idx1:Number, idx2:Number):voidParameters
+
+
+
src:Array
+
+
+
+
+
+
idx1:Number
+
+
+
+
+
+
idx2:Number
+
+
+
+
+
+
+
swapByValue
()
method
+
+
+
+public static function swapByValue(src:Array, item1:*, item2:*):void
+ Swaps the positions of two items if they are found in the
+ source array.
+
+
+
+
diff --git a/src/docs/cookies.js b/src/docs/cookies.js
new file mode 100644
index 0000000..d6d46ad
--- /dev/null
+++ b/src/docs/cookies.js
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// ADOBE SYSTEMS INCORPORATED
+// Copyright 2006-2007 Adobe Systems Incorporated
+// All Rights Reserved.
+//
+// NOTICE: Adobe permits you to use, modify, and distribute this file
+// in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Read the JavaScript cookies tutorial at:
+ * http://www.netspade.com/articles/javascript/cookies.xml
+ */
+
+/**
+ * Sets a Cookie with the given name and value.
+ *
+ * name Name of the cookie
+ * value Value of the cookie
+ * [expires] Expiration date of the cookie (default: end of current session)
+ * [path] Path where the cookie is valid (default: path of calling document)
+ * [domain] Domain where the cookie is valid
+ * (default: domain of calling document)
+ * [secure] Boolean value indicating if the cookie transmission requires a
+ * secure transmission
+ */
+function setCookie(name, value, expires, path, domain, secure)
+{
+ document.cookie= name + "=" + escape(value) +
+ ((expires) ? "; expires=" + expires.toGMTString() : "") +
+ ((path) ? "; path=" + path : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ ((secure) ? "; secure" : "");
+}
+
+/**
+ * Gets the value of the specified cookie.
+ *
+ * name Name of the desired cookie.
+ *
+ * Returns a string containing value of specified cookie,
+ * or null if cookie does not exist.
+ */
+function getCookie(name)
+{
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+ if (begin == -1)
+ {
+ begin = dc.indexOf(prefix);
+ if (begin != 0) return null;
+ }
+ else
+ {
+ begin += 2;
+ }
+ var end = document.cookie.indexOf(";", begin);
+ if (end == -1)
+ {
+ end = dc.length;
+ }
+ return unescape(dc.substring(begin + prefix.length, end));
+}
+
+/**
+ * Deletes the specified cookie.
+ *
+ * name name of the cookie
+ * [path] path of the cookie (must be same as path used to create cookie)
+ * [domain] domain of the cookie (must be same as domain used to create cookie)
+ */
+function deleteCookie(name, path, domain)
+{
+ if (getCookie(name))
+ {
+ document.cookie = name + "=" +
+ ((path) ? "; path=" + path : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+ }
+}
diff --git a/src/docs/images/collapsed.gif b/src/docs/images/collapsed.gif
new file mode 100644
index 0000000..f803408
Binary files /dev/null and b/src/docs/images/collapsed.gif differ
diff --git a/src/docs/images/detailHeaderRule.jpg b/src/docs/images/detailHeaderRule.jpg
new file mode 100644
index 0000000..e73a03b
Binary files /dev/null and b/src/docs/images/detailHeaderRule.jpg differ
diff --git a/src/docs/images/detailSectionHeader.jpg b/src/docs/images/detailSectionHeader.jpg
new file mode 100644
index 0000000..4979b55
Binary files /dev/null and b/src/docs/images/detailSectionHeader.jpg differ
diff --git a/src/docs/images/expanded.gif b/src/docs/images/expanded.gif
new file mode 100644
index 0000000..33779b0
Binary files /dev/null and b/src/docs/images/expanded.gif differ
diff --git a/src/docs/images/inherit-arrow.gif b/src/docs/images/inherit-arrow.gif
new file mode 100644
index 0000000..bfb4ea7
Binary files /dev/null and b/src/docs/images/inherit-arrow.gif differ
diff --git a/src/docs/images/inheritedSummary.gif b/src/docs/images/inheritedSummary.gif
new file mode 100644
index 0000000..800b34b
Binary files /dev/null and b/src/docs/images/inheritedSummary.gif differ
diff --git a/src/docs/images/logo.jpg b/src/docs/images/logo.jpg
new file mode 100644
index 0000000..01d0a14
Binary files /dev/null and b/src/docs/images/logo.jpg differ
diff --git a/src/docs/images/titleTableBottom.jpg b/src/docs/images/titleTableBottom.jpg
new file mode 100644
index 0000000..5c7c510
Binary files /dev/null and b/src/docs/images/titleTableBottom.jpg differ
diff --git a/src/docs/images/titleTableMiddle.jpg b/src/docs/images/titleTableMiddle.jpg
new file mode 100644
index 0000000..c878113
Binary files /dev/null and b/src/docs/images/titleTableMiddle.jpg differ
diff --git a/src/docs/images/titleTableTop.jpg b/src/docs/images/titleTableTop.jpg
new file mode 100644
index 0000000..f858cdf
Binary files /dev/null and b/src/docs/images/titleTableTop.jpg differ
diff --git a/src/docs/index-list.html b/src/docs/index-list.html
new file mode 100644
index 0000000..fe65c2d
--- /dev/null
+++ b/src/docs/index-list.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+Adobe Flex 2 Language Reference
+
+
+
+
+
+
+
+
+
+
+
+ This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+ Link to Non-frame version.
+
+
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+
+ Link toNon-frame version.
+
+
+
+
+
+
+
diff --git a/src/org/openPyro/aurora/AuroraButtonSkin.as b/src/org/openPyro/aurora/AuroraButtonSkin.as
new file mode 100644
index 0000000..3bf69ce
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraButtonSkin.as
@@ -0,0 +1,258 @@
+package org.openPyro.aurora
+{
+ import org.openPyro.controls.Button;
+ import org.openPyro.controls.Label;
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.core.IStateFulClient;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.painters.GradientFillPainter;
+ import org.openPyro.painters.Stroke;
+
+ import flash.display.DisplayObject;
+ import flash.text.TextFormat;
+
+ public class AuroraButtonSkin extends UIControl implements IStateFulClient
+ {
+ protected var _cornerRadius:Number = 0
+ protected var gradientPainter:GradientFillPainter;
+ protected var _stroke:Stroke = new Stroke(1,0x777777,1,true);
+
+ public function AuroraButtonSkin()
+ {
+ this.mouseChildren=false;
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ if(skinnedControl)
+ {
+ skinnedControl.removeEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ }
+ super.skinnedControl = uic;
+ skinnedControl.addEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ if(uic is Button)
+ {
+ this.changeState(null, Button(uic).currentState);
+ updateLabel();
+ }
+ this.buttonMode = true;
+ this.useHandCursor = true;
+
+ }
+
+ protected function onSkinnedControlPropertyChange(event:PyroEvent):void
+ {
+ if(skinnedControl is Button)
+ {
+ updateLabel();
+ }
+ }
+
+ /////////////////// ICON /////////////////
+
+ protected var _icon:DisplayObject;
+ public function set icon(icn:DisplayObject):void
+ {
+ _icon = icn;
+ addChild(_icon);
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ ////////////////// LABEL /////////////////
+
+ protected var _labelFormat:TextFormat = new TextFormat("Arial",11, 0x111111,true);
+
+ public function set labelFormat(fmt:TextFormat):void
+ {
+ _labelFormat = fmt;
+ if(label)
+ {
+ label.textFormat = fmt;
+ }
+ if(skinnedControl)
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ public function get labelFormat():TextFormat
+ {
+ return _labelFormat;
+ }
+
+ protected var label:Label;
+
+ public function updateLabel():void
+ {
+ if(this.skinnedControl is Button)
+ {
+ var bttn:Button = Button(this.skinnedControl);
+ if(!bttn.label) return;
+ if(!label){
+ label = new Label();
+ label.textFormat = _labelFormat;
+ addChild(label);
+
+ }
+ label.text = bttn.label;
+ }
+ }
+
+ private var _labelAlign:String = "center";
+ public function set labelAlign(direction:String):void
+ {
+ _labelAlign = direction;
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ //////////// Colors ///////////////
+
+ private var _upColors:Array = [0xdfdfdf, 0xffffff];
+ private var _overColors:Array = [0xffffff,0xdfdfdf];
+ private var _downColors:Array = [0xdfdfdf,0xdfdfdf];
+
+ public function set upColors(clrs:Array):void
+ {
+ this._upColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set overColors(clrs:Array):void
+ {
+ this._overColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set downColors(clrs:Array):void
+ {
+ this._downColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ /**
+ * Shortcut function for setting colors of all 3 button states
+ * in one pass. Not recommended since there is no feedback to
+ * the user on rollover and rollout states.
+ */
+ public function set colors(clrs:Array):void
+ {
+ this._upColors = clrs;
+ this._overColors = clrs;
+ this._downColors = clrs;
+ if(this._skinnedControl)
+ {
+ invalidateDisplayList()
+ }
+ }
+
+ public function set stroke(str:Stroke):void
+ {
+ _stroke = str;
+ this.invalidateDisplayList();
+ }
+
+
+ public function set cornerRadius(cr:Number):void
+ {
+ this._cornerRadius = cr;
+ if(this.gradientPainter){
+ gradientPainter.cornerRadius = cr;
+ }
+ if(this._skinnedControl){
+ this.invalidateDisplayList();
+ }
+ }
+
+ ///////////////// Button Behavior ////////
+
+ public function changeState(fromState:String, toState:String):void
+ {
+ this.gradientPainter = new GradientFillPainter([0,0])
+ if(toState==ButtonEvent.UP)
+ {
+ gradientPainter.colors = _upColors;
+ gradientPainter.stroke = _stroke;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ gradientPainter.colors = _overColors;
+ gradientPainter.stroke = _stroke;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ gradientPainter.colors = _downColors;
+ // draw the focus stroke
+ gradientPainter.stroke = new Stroke(1,0x559DE6);
+ }
+ else
+ {
+ gradientPainter.colors = _upColors;
+ gradientPainter.stroke = _stroke;
+ }
+ gradientPainter.cornerRadius = _cornerRadius;
+ gradientPainter.rotation = Math.PI/2;
+
+ this.backgroundPainter = gradientPainter;
+ invalidateDisplayList();
+ }
+
+ override public function dispose():void
+ {
+ if(this.parent)
+ {
+ this.parent.removeChild(this);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(label){
+
+ label.textField.autoSize = "left";
+ label.y = (unscaledHeight-label.height)/2;
+
+ if(this._labelAlign == "center"){
+ label.x = (unscaledWidth-label.width)/2;
+ }
+ else if(_labelAlign == "left"){
+ label.x = 10;
+ }
+ }
+
+ if(_icon){
+ if(!label){
+ _icon.x = (unscaledWidth-_icon.width)/2;
+ _icon.y = (unscaledHeight-_icon.height)/2;
+ }
+ else{
+ if(_labelAlign == "left"){
+ _icon.x = label.x;
+ label.x += _icon.width+5;
+ }
+ else{
+ _icon.x = label.x-_icon.width-5;
+ }
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraCheckBoxSkin.as b/src/org/openPyro/aurora/AuroraCheckBoxSkin.as
new file mode 100644
index 0000000..a10c554
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraCheckBoxSkin.as
@@ -0,0 +1,152 @@
+package org.openPyro.aurora
+{
+ import org.openPyro.controls.Button;
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.painters.GradientFillPainter;
+ import org.openPyro.painters.Stroke;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+
+ public class AuroraCheckBoxSkin extends AuroraPainterButtonSkin
+ {
+
+ [Embed(source="/assets/graphic_assets.swf", symbol="checkIcon")]
+ private var TickGraphic:Class
+
+ public function AuroraCheckBoxSkin()
+ {
+ }
+
+ private var _checkIcon:DisplayObject
+
+ public var cornerRadius:Number = 0
+ public var boxLabelGap:Number = 10;
+
+ public function set checkIcon(icon:DisplayObject):void{
+ _checkIcon = icon
+ }
+
+ private var _uncheckIcon:DisplayObject
+ public function set uncheckIcon(icon:DisplayObject):void{
+ _uncheckIcon = icon;
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ super.skinnedControl = uic
+ checkSelectedStatus()
+ }
+
+ override protected function onSkinnedControlPropertyChange(event:PyroEvent):void{
+ super.onSkinnedControlPropertyChange(event);
+ checkSelectedStatus()
+ }
+
+ override public function changeState(fromState:String, toState:String):void
+ {
+ if(toState==ButtonEvent.UP)
+ {
+ this.backgroundPainter = upPainter;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ this.backgroundPainter = overPainter;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ this.backgroundPainter = downPainter;
+ if(_skinnedControl is Button){
+ var b:Button = _skinnedControl as Button;
+ checkSelectedStatus()
+ }
+ }
+ else
+ {
+ this.backgroundPainter = upPainter;
+ }
+ }
+
+ protected function checkSelectedStatus():void{
+ if(Button(_skinnedControl).toggle){
+ if(Button(_skinnedControl).selected){
+ if(!_checkIcon){
+ _checkIcon = createDefaultCheckIcon()
+
+ }
+ _checkIcon.visible = true
+ if(_uncheckIcon){
+ _uncheckIcon.visible = false;
+ }
+ }
+ else {
+ if(!_uncheckIcon){
+ _uncheckIcon = createDefaultUnCheckIcon()
+
+ }
+ _uncheckIcon.visible = true
+ if(_checkIcon){
+ _checkIcon.visible=false
+ }
+ }
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(!label){
+ if(_checkIcon)
+ _checkIcon.x = (unscaledWidth-_checkIcon.width)/2;
+ if(_uncheckIcon)
+ _uncheckIcon.x = (unscaledWidth-_uncheckIcon.width)/2
+ }
+ else{
+ if(_checkIcon){
+ _checkIcon.x = _skinnedControl.padding.left;
+ _checkIcon.y = (unscaledHeight-_checkIcon.height)/2;
+
+ }
+ if(_uncheckIcon){
+ _uncheckIcon.x = _skinnedControl.padding.left;;
+ _uncheckIcon.y = (unscaledHeight-_uncheckIcon.height)/2;
+ }
+ var checkIconW:Number = _checkIcon ? _checkIcon.width:0
+ var uncheckIconW:Number = _uncheckIcon?_uncheckIcon.width:0
+ label.x = Math.max(checkIconW, uncheckIconW)+boxLabelGap;
+ }
+
+ }
+
+ protected function createDefaultUnCheckIcon():Sprite{
+ var sp:Sprite = new Sprite()
+ var gr:GradientFillPainter = new GradientFillPainter([0xffffff, 0xdddddd])
+ gr.stroke = new Stroke(1,0x666666,1,true)
+ gr.rotation = Math.PI/2
+ gr.cornerRadius = cornerRadius
+ gr.draw(sp.graphics, 15,15)
+ addChild(sp)
+ return sp
+ }
+
+ protected function createDefaultCheckIcon():Sprite{
+ var sp:Sprite = new Sprite()
+ var gr:GradientFillPainter = new GradientFillPainter([0xffffff, 0xdddddd])
+ gr.stroke = new Stroke(1,0x666666,1,true)
+ gr.rotation = Math.PI/2
+ gr.cornerRadius = cornerRadius
+ gr.draw(sp.graphics, 15,15)
+ addChild(sp)
+
+ var tick:DisplayObject = new TickGraphic()
+ sp.addChild(tick)
+ sp.mouseChildren=false;
+ return sp
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraComboBoxSkin.as b/src/org/openPyro/aurora/AuroraComboBoxSkin.as
new file mode 100644
index 0000000..2167e1e
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraComboBoxSkin.as
@@ -0,0 +1,47 @@
+package org.openPyro.aurora
+{
+ import org.openPyro.controls.skins.IComboBoxSkin;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.skins.ISkin;
+
+ import flash.filters.DropShadowFilter;
+
+ public class AuroraComboBoxSkin implements IComboBoxSkin
+ {
+ protected var _buttonSkin:AuroraButtonSkin;
+ protected var _listSkin:AuroraContainerSkin;
+
+ public function AuroraComboBoxSkin() {
+
+ }
+
+ public function get buttonSkin():ISkin
+ {
+ _buttonSkin = new AuroraButtonSkin();
+ _buttonSkin.labelAlign = "left";
+ _buttonSkin.cornerRadius = 10;
+ _buttonSkin.filters = [new DropShadowFilter(.5,90,0,1,0,0)]
+ return _buttonSkin;
+ }
+
+ public function get listSkin():ISkin
+ {
+ _listSkin = new AuroraContainerSkin();
+ return _listSkin;
+ }
+
+ public function dispose():void
+ {
+
+ }
+
+ public function set skinnedControl(control:UIControl):void
+ {
+ if(_buttonSkin)
+ {
+ _buttonSkin.skinnedControl = control;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraContainerSkin.as b/src/org/openPyro/aurora/AuroraContainerSkin.as
new file mode 100644
index 0000000..5ca9a4e
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraContainerSkin.as
@@ -0,0 +1,44 @@
+package org.openPyro.aurora{
+ import org.openPyro.aurora.AuroraScrollBarSkin;
+ import org.openPyro.controls.skins.IScrollBarSkin;
+ import org.openPyro.controls.skins.IScrollableContainerSkin;
+ import org.openPyro.core.Direction;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.skins.ISkin;
+
+ public class AuroraContainerSkin implements IScrollableContainerSkin
+ {
+
+ private var _horizontalScrollBarSkin:AuroraScrollBarSkin;
+ private var _verticalScrollBarSkin:AuroraScrollBarSkin;
+
+ public function AuroraContainerSkin() {
+
+ }
+
+ public function get verticalScrollBarSkin():IScrollBarSkin
+ {
+ _verticalScrollBarSkin = new AuroraScrollBarSkin()
+ _verticalScrollBarSkin.direction = Direction.VERTICAL;
+ return _verticalScrollBarSkin;
+ }
+
+ public function get horizontalScrollBarSkin():IScrollBarSkin
+ {
+ _horizontalScrollBarSkin = new AuroraScrollBarSkin();
+ _horizontalScrollBarSkin.direction = Direction.HORIZONTAL;
+ return _horizontalScrollBarSkin;
+ }
+
+ public function set skinnedControl(uic:UIControl):void
+ {
+ }
+
+ public function dispose():void
+ {
+ _verticalScrollBarSkin.dispose();
+ _horizontalScrollBarSkin.dispose();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraHDividedBoxSkin.as b/src/org/openPyro/aurora/AuroraHDividedBoxSkin.as
new file mode 100644
index 0000000..b353115
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraHDividedBoxSkin.as
@@ -0,0 +1,15 @@
+package org.openPyro.aurora{
+ import org.openPyro.aurora.skinClasses.HDividerSkin;
+ import org.openPyro.controls.skins.IDividedBoxSkin;
+ import org.openPyro.core.UIControl;
+
+ public class AuroraHDividedBoxSkin extends AuroraContainerSkin implements IDividedBoxSkin
+ {
+ public function getNewDividerSkin():UIControl{
+ var dividerSkin:UIControl = new HDividerSkin();
+ dividerSkin.width = 8;
+ dividerSkin.percentUnusedHeight = 100;
+ return dividerSkin;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraPainterButtonSkin.as b/src/org/openPyro/aurora/AuroraPainterButtonSkin.as
new file mode 100644
index 0000000..5c5c706
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraPainterButtonSkin.as
@@ -0,0 +1,201 @@
+package org.openPyro.aurora{
+ import org.openPyro.controls.Button;
+ import org.openPyro.controls.Label;
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.core.IStateFulClient;
+ import org.openPyro.core.Padding;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.painters.IPainter;
+
+ import flash.display.DisplayObject;
+ import flash.text.TextFormat;
+
+ public class AuroraPainterButtonSkin extends UIControl implements IStateFulClient
+ {
+ /**
+ * A skin for buttons using different painters.
+ * Note: Only padding left and padding top are respected if align is set to
+ * left
+ */
+ public function AuroraPainterButtonSkin()
+ {
+ this.mouseChildren=false;
+ this._padding = new Padding(0,10, 0,0);
+ }
+
+ override public function set skinnedControl(uic:UIControl):void
+ {
+ if(skinnedControl)
+ {
+ skinnedControl.removeEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ }
+ super.skinnedControl = uic;
+ skinnedControl.addEventListener(PyroEvent.PROPERTY_CHANGE, onSkinnedControlPropertyChange)
+ if(uic is Button)
+ {
+ this.changeState(null, Button(uic).currentState);
+ updateLabel();
+ }
+ this.buttonMode = true;
+ this.useHandCursor = true;
+
+ }
+
+ protected function onSkinnedControlPropertyChange(event:PyroEvent):void
+ {
+ if(skinnedControl is Button)
+ {
+ updateLabel();
+ }
+ }
+
+ /////////////////// ICON /////////////////
+
+ protected var _icon:DisplayObject;
+ public function set icon(icn:DisplayObject):void
+ {
+ _icon = icn;
+ addChild(_icon);
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ ////////////////// LABEL /////////////////
+
+ protected var _labelFormat:TextFormat = new TextFormat("Arial",11, 0x111111,true);
+
+ public function set labelFormat(fmt:TextFormat):void
+ {
+ _labelFormat = fmt;
+ if(label)
+ {
+ label.textFormat = fmt;
+ }
+ if(skinnedControl)
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ public function get labelFormat():TextFormat
+ {
+ return _labelFormat;
+ }
+
+ protected var label:Label;
+
+ public function updateLabel():void{
+ if(this.skinnedControl is Button){
+ var bttn:Button = Button(this.skinnedControl);
+ if(!bttn.label) return;
+ if(!label){
+ label = new Label();
+ label.textFormat = _labelFormat;
+ addChild(label);
+
+ }
+
+ if(bttn.label != label.text){
+ label.text = bttn.label;
+ }
+ }
+ //this.invalidateDisplayList();
+ }
+
+ private var _labelAlign:String = "center";
+ public function set labelAlign(direction:String):void
+ {
+ _labelAlign = direction;
+ if(skinnedControl){
+ invalidateDisplayList();
+ }
+ }
+
+ //////////// Colors ///////////////
+
+ public var upPainter:IPainter;
+ public var overPainter:IPainter;
+ public var downPainter:IPainter;
+
+ public function set painters(painter:IPainter):void{
+ upPainter = overPainter = downPainter = painter;
+ this.invalidateDisplayList();
+ }
+
+/* public function set stroke(str:Stroke):void
+ {
+ _stroke = str;
+ this.invalidateDisplayList();
+ } */
+
+
+ ///////////////// Button Behavior ////////
+
+ public function changeState(fromState:String, toState:String):void
+ {
+ if(toState==ButtonEvent.UP)
+ {
+ this.backgroundPainter = upPainter;
+ }
+
+ else if(toState==ButtonEvent.OVER)
+ {
+ this.backgroundPainter = overPainter;
+ }
+
+ else if(toState == ButtonEvent.DOWN)
+ {
+ this.backgroundPainter = downPainter;
+ }
+ else
+ {
+ this.backgroundPainter = upPainter;
+ }
+ }
+
+ override public function dispose():void
+ {
+ if(this.parent)
+ {
+ this.parent.removeChild(this);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if(label){
+
+ label.textField.autoSize = "left";
+ label.y = (unscaledHeight-label.height)/2+_padding.top;
+
+ if(this._labelAlign == "center"){
+ label.x = (unscaledWidth-label.width)/2;
+ }
+ else if(_labelAlign == "left"){
+ label.x = _padding.left;
+ }
+ }
+
+ if(_icon){
+ if(!label){
+ _icon.x = (unscaledWidth-_icon.width)/2;
+ }
+ else{
+ if(_labelAlign == "left"){
+ _icon.x = label.x;
+ label.x += _icon.width+5;
+ }
+ else{
+ _icon.x = label.x-_icon.width-5;
+ }
+ }
+ _icon.y = (unscaledHeight-_icon.height)/2;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraScrollBarSkin.as b/src/org/openPyro/aurora/AuroraScrollBarSkin.as
new file mode 100644
index 0000000..627b2fc
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraScrollBarSkin.as
@@ -0,0 +1,84 @@
+package org.openPyro.aurora{
+ import org.openPyro.controls.skins.IScrollBarSkin;
+ import org.openPyro.controls.skins.ISliderSkin;
+ import org.openPyro.core.Direction;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.shapes.Triangle;
+ import org.openPyro.skins.ISkin;
+
+ public class AuroraScrollBarSkin implements IScrollBarSkin
+ {
+
+ public var direction:String = Direction.VERTICAL ;
+
+ private var _incrementButtonSkin:AuroraButtonSkin;
+ private var _decrementButtonSkin:AuroraButtonSkin;
+ private var _sliderSkin:AuroraSliderSkin;
+
+ public function AuroraScrollBarSkin()
+ {
+ }
+
+ public function get incrementButtonSkin():ISkin
+ {
+ _incrementButtonSkin = new AuroraButtonSkin();
+ if(direction == Direction.VERTICAL){
+ _incrementButtonSkin.icon = new Triangle(Direction.DOWN, 6,6)
+ }
+ else if(direction == Direction.HORIZONTAL){
+ _incrementButtonSkin.icon = new Triangle(Direction.RIGHT, 6,6)
+ }
+ _incrementButtonSkin.width = 15
+ _incrementButtonSkin.height= 15
+ return _incrementButtonSkin
+ }
+
+ public function get decrementButtonSkin():ISkin
+ {
+ _decrementButtonSkin = new AuroraButtonSkin();
+ if(direction == Direction.VERTICAL){
+ _decrementButtonSkin.icon = new Triangle(Direction.UP, 6,6)
+ }
+ else if(direction == Direction.HORIZONTAL){
+ _decrementButtonSkin.icon = new Triangle(Direction.LEFT, 6,6)
+ }
+ _decrementButtonSkin.width = 15
+ _decrementButtonSkin.height= 15
+ return _decrementButtonSkin
+
+ }
+
+ public function set skinnedControl(uic:UIControl):void
+ {
+ }
+
+ public function get sliderSkin():ISliderSkin
+ {
+ _sliderSkin = new AuroraSliderSkin();
+ if(direction == Direction.HORIZONTAL)
+ {
+ _sliderSkin.trackGradientRotation = Math.PI/2
+ }
+ return _sliderSkin;
+ }
+
+ public function dispose():void
+ {
+ if(_incrementButtonSkin && _incrementButtonSkin.parent)
+ {
+ _incrementButtonSkin.parent.removeChild(_incrementButtonSkin);
+ }
+ _incrementButtonSkin = null;
+
+ if(_decrementButtonSkin && _decrementButtonSkin.parent)
+ {
+ _decrementButtonSkin.parent.removeChild(_decrementButtonSkin);
+ }
+ _decrementButtonSkin = null;
+ if(_sliderSkin){
+ _sliderSkin.dispose();
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/AuroraSliderSkin.as b/src/org/openPyro/aurora/AuroraSliderSkin.as
new file mode 100644
index 0000000..8f39a82
--- /dev/null
+++ b/src/org/openPyro/aurora/AuroraSliderSkin.as
@@ -0,0 +1,49 @@
+package org.openPyro.aurora{
+
+ import org.openPyro.aurora.skinClasses.GradientRectSkin;
+ import org.openPyro.controls.skins.ISliderSkin;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.painters.Stroke;
+ import org.openPyro.skins.ISkin;
+
+ public class AuroraSliderSkin implements ISliderSkin
+ {
+
+ public var trackGradientRotation:Number=0;
+
+ private var track:GradientRectSkin;
+ private var _thumbSkin:AuroraButtonSkin;
+
+ public function AuroraSliderSkin()
+ {
+ }
+
+ public function get thumbSkin():ISkin
+ {
+ _thumbSkin = new AuroraButtonSkin();
+ return _thumbSkin;
+ }
+
+ public function set skinnedControl(uic:UIControl):void{}
+
+ public function get trackSkin():ISkin
+ {
+ track = new GradientRectSkin();
+ track.stroke = new Stroke(1,0xcccccc)
+ track.gradientRotation = trackGradientRotation;
+ return track;
+ }
+ public function dispose():void
+ {
+ if(_thumbSkin.parent)
+ {
+ _thumbSkin.parent.removeChild(_thumbSkin);
+ }
+ _thumbSkin = null;
+ if(track.parent){
+ track.parent.removeChild(track);
+ }
+ track = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/skinClasses/GradientRectSkin.as b/src/org/openPyro/aurora/skinClasses/GradientRectSkin.as
new file mode 100644
index 0000000..bda7929
--- /dev/null
+++ b/src/org/openPyro/aurora/skinClasses/GradientRectSkin.as
@@ -0,0 +1,39 @@
+package org.openPyro.aurora.skinClasses{
+ import org.openPyro.core.UIControl;
+ import org.openPyro.painters.GradientFillPainter;
+ import org.openPyro.painters.Stroke;
+
+ public class GradientRectSkin extends UIControl
+
+ {
+ protected var _gradientRotation:Number = 0;
+ protected var gradientFill:GradientFillPainter;
+
+ public function GradientRectSkin()
+ {
+ gradientFill = new GradientFillPainter([0x999999,0xdfdfdf],[.6,1],[1,255],_gradientRotation)
+ this.backgroundPainter = gradientFill;
+ }
+
+ public function set gradientRotation(r:Number):void
+ {
+ _gradientRotation = r;
+ gradientFill.rotation = _gradientRotation;
+ this.invalidateDisplayList();
+ }
+
+ protected var _stroke:Stroke = new Stroke(1,0x777777);
+
+ public function set stroke(str:Stroke):void{
+ _stroke = str;
+ gradientFill.stroke = str;
+ this.invalidateDisplayList();
+ }
+
+ public function get stroke():Stroke
+ {
+ return _stroke;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/aurora/skinClasses/HDividerSkin.as b/src/org/openPyro/aurora/skinClasses/HDividerSkin.as
new file mode 100644
index 0000000..f674f30
--- /dev/null
+++ b/src/org/openPyro/aurora/skinClasses/HDividerSkin.as
@@ -0,0 +1,30 @@
+package org.openPyro.aurora.skinClasses{
+ import org.openPyro.aurora.AuroraButtonSkin;
+ import org.openPyro.controls.Button;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.painters.GradientFillPainter;
+
+ public class HDividerSkin extends UIControl
+ {
+ public function HDividerSkin()
+ {
+ super();
+ }
+
+ private var closeButton:Button;
+ override protected function createChildren():void{
+ this.backgroundPainter = new GradientFillPainter([0x999999, 0xffffff, 0x999999]);
+ closeButton = new Button()
+ closeButton.skin = new AuroraButtonSkin()
+ closeButton.percentWidth=100;
+ closeButton.height = 70;
+ addChild(closeButton);
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ closeButton.y = (unscaledHeight-70)/2
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/charts/HBarChart.as b/src/org/openPyro/charts/HBarChart.as
new file mode 100644
index 0000000..1a09d67
--- /dev/null
+++ b/src/org/openPyro/charts/HBarChart.as
@@ -0,0 +1,55 @@
+package org.openPyro.charts
+{
+ import org.openPyro.controls.List;
+
+ import flash.display.DisplayObject;
+
+ public class HBarChart extends List
+ {
+
+ public function HBarChart(){
+ super();
+
+ //this.layout = new VLayout();
+ }
+
+ private var _yField:String = "value";
+ public function set yField(fieldName:String):void
+ {
+ _yField = fieldName;
+ }
+
+ private var maxYValue:Number = 0;
+ override public function set dataProvider(dpObject:Object):void
+ {
+
+ var dp:Array = dpObject as Array;
+ for(var i:uint=0; i maxYValue){
+ maxYValue = yfValue;
+ }
+ }
+ catch(e:Error)
+ {
+ continue;
+ }
+ }
+ super.dataProvider = dp;
+ }
+
+ override protected function setRendererData(renderer:DisplayObject, data:Object, index:int):void
+ {
+ super.setRendererData(renderer, data, index);
+ if(renderer is IVerticalChartItemRenderer)
+ {
+ IVerticalChartItemRenderer(renderer).maxYValue = this.maxYValue;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/charts/IHorizontalChartItemRenderer.as b/src/org/openPyro/charts/IHorizontalChartItemRenderer.as
new file mode 100644
index 0000000..bc4ab7a
--- /dev/null
+++ b/src/org/openPyro/charts/IHorizontalChartItemRenderer.as
@@ -0,0 +1,7 @@
+package org.openPyro.charts
+{
+ public interface IHorizontalChartItemRenderer
+ {
+ function set maxXValue(value:Number):void
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/charts/IVerticalChartItemRenderer.as b/src/org/openPyro/charts/IVerticalChartItemRenderer.as
new file mode 100644
index 0000000..582d546
--- /dev/null
+++ b/src/org/openPyro/charts/IVerticalChartItemRenderer.as
@@ -0,0 +1,7 @@
+package org.openPyro.charts
+{
+ public interface IVerticalChartItemRenderer
+ {
+ function set maxYValue(value:Number):void
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/charts/VBarChart.as b/src/org/openPyro/charts/VBarChart.as
new file mode 100644
index 0000000..2703ab7
--- /dev/null
+++ b/src/org/openPyro/charts/VBarChart.as
@@ -0,0 +1,56 @@
+package org.openPyro.charts
+{
+ import org.openPyro.controls.List;
+
+ import flash.display.DisplayObject;
+
+ public class VBarChart extends List
+ {
+
+ public function VBarChart(){
+ super();
+
+ //this.layout = new VLayout();
+ }
+
+ private var _xField:String = "value";
+ public function set xField(fieldName:String):void
+ {
+ _xField = fieldName;
+ }
+
+ private var maxXValue:Number = 0;
+ override public function set dataProvider(dpObject:Object):void
+ {
+
+ var dp:Array = dpObject as Array;
+ for(var i:uint=0; i maxXValue){
+ maxXValue = xfValue;
+ }
+ }
+ catch(e:Error)
+ {
+ trace("Could not find xValue value")
+ continue;
+ }
+ }
+ super.dataProvider = dp;
+ }
+
+ override protected function setRendererData(renderer:DisplayObject, data:Object, index:int):void
+ {
+ super.setRendererData(renderer, data, index);
+ if(renderer is IHorizontalChartItemRenderer)
+ {
+ IHorizontalChartItemRenderer(renderer).maxXValue = this.maxXValue;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/ArrayCollection.as b/src/org/openPyro/collections/ArrayCollection.as
new file mode 100644
index 0000000..014ca1f
--- /dev/null
+++ b/src/org/openPyro/collections/ArrayCollection.as
@@ -0,0 +1,105 @@
+package org.openPyro.collections
+{
+ import org.openPyro.collections.events.CollectionEvent;
+ import org.openPyro.collections.events.CollectionEventKind;
+ import org.openPyro.utils.ArrayUtil;
+
+ import flash.events.EventDispatcher;
+
+ public class ArrayCollection extends EventDispatcher implements ICollection
+ {
+ protected var _originalSource:Array;
+
+ public function ArrayCollection(source:Array = null)
+ {
+ if(!source){
+ source = new Array();
+ }
+ _source = source;
+ _originalSource = source;
+ _iterator = new ArrayIterator(this);
+ }
+
+ private var _source:Array;
+ private var _iterator:ArrayIterator;
+
+ public function set source(array:*):void
+ {
+ _source = array;
+ _originalSource = array;
+ dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGED));
+ }
+
+ public function get source():*
+ {
+ return _source;
+ }
+
+ public function get normalizedArray():Array{
+ return _source;
+ }
+
+ public function get length():int
+ {
+ if(_source){
+ return _source.length;
+ }
+ return 0;
+ }
+
+ public function addItems(items:Array):void{
+ addItemsAt(items, _source.length);
+ }
+
+ public function addItem(obj:*):void{
+ addItems([obj])
+ }
+
+ public function addItemsAt(items:Array, idx:Number):void{
+ var lastData:Object
+ if(idx==0 || _source.length==0){
+ // insert the data at the beginning
+ lastData = null;
+ }
+ else{
+ lastData = _source[idx-1];
+ }
+
+
+ ArrayUtil.insertArrayAtIndex(_source, items, idx);
+ var collectionEvent:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGED);
+ collectionEvent.delta = items;
+
+ collectionEvent.eventNode = lastData;
+ collectionEvent.kind = CollectionEventKind.ADD;
+ dispatchEvent(collectionEvent);
+ }
+
+ public function get iterator():IIterator
+ {
+ return _iterator;
+ }
+
+ public function getItemIndex(ob:Object):int
+ {
+ return _source.indexOf(ob);
+ }
+
+ public function getItemAt(index:int):*{
+ return _source[index];
+ }
+
+ public function removeItems(items:Array):void{
+
+ }
+
+ public function set filterFunction(f:Function):void{
+
+ }
+
+ public function refresh():void{
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/ArrayIterator.as b/src/org/openPyro/collections/ArrayIterator.as
new file mode 100644
index 0000000..c37bcf4
--- /dev/null
+++ b/src/org/openPyro/collections/ArrayIterator.as
@@ -0,0 +1,70 @@
+package org.openPyro.collections
+{
+ import org.openPyro.collections.events.CollectionEvent;
+ import org.openPyro.collections.events.IteratorEvent;
+
+ import flash.events.EventDispatcher;
+
+ public class ArrayIterator extends EventDispatcher implements IIterator
+ {
+ protected var _array:Array;
+ protected var _collection:ICollection;
+
+ public function ArrayIterator(collection:ICollection){
+ _collection = collection;
+ collection.addEventListener(CollectionEvent.COLLECTION_CHANGED, onCollectionChanged);
+ setSource()
+ }
+
+ private function onCollectionChanged(event:CollectionEvent):void{
+ setSource()
+ }
+
+ protected function setSource():void{
+ _array = _collection.normalizedArray as Array;
+ }
+
+ private var _cursorIndex:int = -1
+
+ public function getCurrent():Object{
+ return _array[_cursorIndex];
+ }
+
+
+ public function hasNext():Boolean{
+ return _cursorIndex < (_array.length - 1);
+ }
+ public function getNext():Object{
+ _cursorIndex++;
+ return _array[_cursorIndex];
+ }
+ public function hasPrevious():Boolean{
+ return _cursorIndex > 0;
+ }
+ public function getPrevious():Object{
+ _cursorIndex--;
+ return _array[_cursorIndex];
+ }
+
+
+ public function set cursorIndex(idx:int):void{
+ if(_cursorIndex != idx){
+ _cursorIndex = idx;
+ dispatchEvent(new IteratorEvent(IteratorEvent.ITERATOR_MOVED));
+ }
+ }
+
+ public function get cursorIndex():int{
+ return _cursorIndex;
+ }
+
+ public function get normalizedArray():Array{
+ return _array;
+ }
+
+ public function reset():void{
+ _cursorIndex = -1;
+ dispatchEvent(new IteratorEvent(IteratorEvent.ITERATOR_RESET));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/CollectionHelpers.as b/src/org/openPyro/collections/CollectionHelpers.as
new file mode 100644
index 0000000..ba0e340
--- /dev/null
+++ b/src/org/openPyro/collections/CollectionHelpers.as
@@ -0,0 +1,18 @@
+package org.openPyro.collections
+{
+ import org.openPyro.collections.ICollection;
+
+ public class CollectionHelpers
+ {
+ public static function sourceToCollection(src:Object):ICollection{
+ if(src is Array){
+ return new ArrayCollection(src as Array);
+ }
+ else if(src is XML){
+ return new XMLCollection(src as XML)
+ }
+ else return ICollection(src);
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/ICollection.as b/src/org/openPyro/collections/ICollection.as
new file mode 100644
index 0000000..d6c91b0
--- /dev/null
+++ b/src/org/openPyro/collections/ICollection.as
@@ -0,0 +1,21 @@
+package org.openPyro.collections
+{
+ import flash.events.IEventDispatcher;
+
+ public interface ICollection extends IEventDispatcher
+ {
+ function get length():int;
+ function get normalizedArray():Array;
+ function get iterator():IIterator;
+ function set filterFunction(f:Function):void
+ function refresh():void;
+
+ /**
+ * The dataToIndex function returns the index
+ * of the data as it appears witin the ICollection's
+ * source after all filters have been applied
+ */
+ function getItemIndex(data:Object):int;
+ //function removeItem(data:Object):void;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/IIterator.as b/src/org/openPyro/collections/IIterator.as
new file mode 100644
index 0000000..0e07710
--- /dev/null
+++ b/src/org/openPyro/collections/IIterator.as
@@ -0,0 +1,16 @@
+package org.openPyro.collections
+{
+ import flash.events.IEventDispatcher;
+
+ public interface IIterator extends IEventDispatcher
+ {
+ function getCurrent():Object;
+ function hasNext():Boolean;
+ function getNext():Object;
+ function hasPrevious():Boolean;
+ function getPrevious():Object;
+ function set cursorIndex(idx:int):void;
+ function get cursorIndex():int;
+ function reset():void;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/XMLCollection.as b/src/org/openPyro/collections/XMLCollection.as
new file mode 100644
index 0000000..5bf674e
--- /dev/null
+++ b/src/org/openPyro/collections/XMLCollection.as
@@ -0,0 +1,174 @@
+package org.openPyro.collections
+{
+ import org.openPyro.collections.events.CollectionEvent;
+ import org.openPyro.collections.events.CollectionEventKind;
+ import org.openPyro.utils.ArrayUtil;
+ import org.openPyro.utils.XMLUtil;
+
+ import flash.events.EventDispatcher;
+
+ public class XMLCollection extends EventDispatcher implements ICollection
+ {
+ private var _xml:XML;
+ private var _normalizedArray:Array;
+ private var _unfilteredNormalizedArray:Array;
+ private var _originalNormalizedArray:Array;
+ private var _iterator:ArrayIterator;
+
+ public function XMLCollection(xml:XML=null)
+ {
+ _xml = xml;
+ _normalizedArray = new Array();
+ parseNode(_xml, 0, null);
+ _originalNormalizedArray = _normalizedArray.concat();
+ _unfilteredNormalizedArray = _normalizedArray.concat();
+ _iterator = new ArrayIterator(this);
+ }
+
+
+ protected function parseNode(node:XML, depth:int, parentNodeDescriptor:XMLNodeDescriptor):void{
+
+ var desc:XMLNodeDescriptor = new XMLNodeDescriptor()
+ desc.node = node
+ desc.depth = depth
+ desc.parent = parentNodeDescriptor;
+ _normalizedArray.push(desc);
+ depth++;
+ for(var i:int=0; i 0){
+ var newNode:XMLNodeDescriptor = allChildNodes.shift();
+ visibleChildNodes.push(newNode);
+ if(!newNode.isLeaf() && !newNode.open){
+ var closedNodeChildren:Array = getChildNodes(newNode);
+ for(var i:int=0; i 0){
+ return false
+ }
+ return true;
+ }
+
+ public function get nodeString():String{
+ return node.toXMLString();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/events/CollectionEvent.as b/src/org/openPyro/collections/events/CollectionEvent.as
new file mode 100644
index 0000000..fa31fa4
--- /dev/null
+++ b/src/org/openPyro/collections/events/CollectionEvent.as
@@ -0,0 +1,36 @@
+package org.openPyro.collections.events
+{
+ import flash.events.Event;
+
+ public class CollectionEvent extends Event
+ {
+ public static const COLLECTION_CHANGED:String = "collectionChanged";
+
+ /**
+ * The difference between the old state and the new state
+ */
+ public var delta:Array;
+
+ /**
+ *
+ */
+ public var kind:String;
+
+ /**
+ * The data node around near which this event happened.
+ * For example, in case of elements added to a tree the property is used
+ * to find what the parentNode of the newly added
+ * branch is.
+ *
+ * Note: This is not the DisplayObject associated with the data
+ */
+ public var eventNode:Object;
+
+ public function CollectionEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/events/CollectionEventKind.as b/src/org/openPyro/collections/events/CollectionEventKind.as
new file mode 100644
index 0000000..1f64c56
--- /dev/null
+++ b/src/org/openPyro/collections/events/CollectionEventKind.as
@@ -0,0 +1,9 @@
+package org.openPyro.collections.events
+{
+ public class CollectionEventKind
+ {
+ public static const ADD:String = "add"
+ public static const REMOVE:String = "remove"
+ public static const RESET:String = "reset"
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/collections/events/IteratorEvent.as b/src/org/openPyro/collections/events/IteratorEvent.as
new file mode 100644
index 0000000..23e5689
--- /dev/null
+++ b/src/org/openPyro/collections/events/IteratorEvent.as
@@ -0,0 +1,16 @@
+package org.openPyro.collections.events
+{
+ import flash.events.Event;
+
+ public class IteratorEvent extends Event
+ {
+ public static const ITERATOR_MOVED:String = "iteratorMoved";
+ public static const ITERATOR_RESET:String = "iteratorReset";
+
+ public function IteratorEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/containers/DividedBox.as b/src/org/openPyro/containers/DividedBox.as
new file mode 100644
index 0000000..de3e1e7
--- /dev/null
+++ b/src/org/openPyro/containers/DividedBox.as
@@ -0,0 +1,112 @@
+package org.openPyro.containers
+{
+ import org.openPyro.containers.events.DividerEvent;
+ import org.openPyro.controls.skins.IDividedBoxSkin;
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.core.UIContainer;
+
+ import flash.display.DisplayObject;
+ import flash.display.InteractiveObject;
+ import flash.events.MouseEvent;
+
+ [Event(name="dividerDoubleClick", type="org.openPyro.containers.events.DividerEvent" )]
+
+ public class DividedBox extends UIContainer
+ {
+ public function DividedBox()
+ {
+ super();
+ }
+
+ protected var dividers:Array = new Array();
+
+
+ protected var _dividerFactory:ClassFactory;
+ public function set dividerFactory(f:ClassFactory):void{
+ _dividerFactory = f;
+ }
+ public function get dividerFactory():ClassFactory{
+ return _dividerFactory;
+ }
+
+ override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
+ if(contentPane.numChildren > 0){
+ contentPane.addChild(getNewDivider())
+ }
+ return super.addChildAt(child, index);
+ }
+
+
+ protected function getNewDivider():DisplayObject{
+ var divider:DisplayObject
+ if(this._skin){
+ divider = IDividedBoxSkin(_skin).getNewDividerSkin();
+ }
+ else{
+ if(!_dividerFactory){
+ _dividerFactory = defaultDividerFactory;
+ }
+ divider = _dividerFactory.newInstance();
+ }
+ dividers.push(divider);
+ InteractiveObject(divider).doubleClickEnabled = true;
+ divider.addEventListener(MouseEvent.MOUSE_DOWN, onDividerMouseDown);
+ divider.addEventListener(MouseEvent.CLICK, onDividerClick);
+ divider.addEventListener(MouseEvent.DOUBLE_CLICK, onDividerDoubleClick);
+ return divider;
+ }
+
+ protected function get defaultDividerFactory():ClassFactory{
+ throw new Error("Method needs overriding")
+ return new ClassFactory();
+ /// override
+ }
+
+ protected function onDividerMouseDown(event:MouseEvent):void{
+ throw new Error("DividerMouseDown needs overriding")
+ }
+
+ protected function onDividerDoubleClick(event:MouseEvent):void{
+ var evt:DividerEvent = new DividerEvent(DividerEvent.DIVIDER_DOUBLE_CLICK)
+ evt.divider = event.currentTarget as DisplayObject;
+ evt.dividerIndex = dividers.indexOf(event.currentTarget);
+ dispatchEvent(evt);
+ }
+
+ protected function onDividerClick(event:MouseEvent):void{
+ var evt:DividerEvent = new DividerEvent(DividerEvent.DIVIDER_CLICK)
+ evt.divider = event.currentTarget as DisplayObject;
+ evt.dividerIndex = dividers.indexOf(event.currentTarget);
+ dispatchEvent(evt);
+ }
+
+ /*
+ Removes the child required and also the previous divider or the next one if one
+ was created
+ */
+ override public function removeChild(child:DisplayObject):DisplayObject{
+
+ var prevDivider:DisplayObject;
+ for(var i:int=0; i _previouslySelectedIndex)
+ {
+ transitionDirectionMultiplier = trans* -1 ;
+ }
+ else
+ {
+ transitionDirectionMultiplier = trans* +1
+ }
+ break;
+ }
+ }
+
+
+ //animate
+
+ var oldViewEffectDescriptor:EffectDescriptor = new EffectDescriptor(_previouslySelectedChild, 1)
+ var newViewEffectDescriptor:EffectDescriptor = new EffectDescriptor(_selectedChild, 1)
+
+ if(_transitionDirection == Direction.HORIZONTAL){
+ _selectedChild.x = -1*transitionDirectionMultiplier*this.width;
+ oldViewEffectDescriptor.properties = {x:transitionDirectionMultiplier*this.width, ease:Quart.easeOut}
+ newViewEffectDescriptor.properties = {x:0, ease:Quart.easeOut}
+ }
+ else if(_transitionDirection == Direction.VERTICAL)
+ {
+ _selectedChild.y = -1*transitionDirectionMultiplier*this.height;
+ oldViewEffectDescriptor.properties = {y:transitionDirectionMultiplier*this.height, ease:Quart.easeOut}
+ newViewEffectDescriptor.properties = {y:0, ease:Quart.easeOut}
+ }
+ animationEffect.effectDescriptors = [oldViewEffectDescriptor, newViewEffectDescriptor];
+ animationEffect.start();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/containers/VDividedBox.as b/src/org/openPyro/containers/VDividedBox.as
new file mode 100644
index 0000000..f0d52b4
--- /dev/null
+++ b/src/org/openPyro/containers/VDividedBox.as
@@ -0,0 +1,146 @@
+package org.openPyro.containers
+{
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.layout.ILayout;
+ import org.openPyro.layout.VLayout;
+ import org.openPyro.managers.DragManager;
+ import org.openPyro.managers.events.DragEvent;
+ import org.openPyro.painters.GradientFillPainter;
+
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+ import flash.utils.getQualifiedClassName;
+
+ /**
+ *
+ */
+ public class VDividedBox extends DividedBox
+ {
+ /**
+ * Constructor
+ */
+ public function VDividedBox(){
+ super();
+ _styleName = "VDividedBox";
+ }
+
+ override public function initialize():void{
+ super.layout = new VLayout();
+ super.initialize()
+ }
+
+ override protected function get defaultDividerFactory():ClassFactory{
+ var df:ClassFactory = new ClassFactory(UIControl);
+ df.properties = {percentWidth:100, height:6, backgroundPainter:new GradientFillPainter([0x999999, 0x666666])}
+ return df;
+ }
+
+ override protected function onDividerMouseDown(event:MouseEvent):void{
+ var dragManager:DragManager = DragManager.getInstance()
+ dragManager.addEventListener(DragEvent.DRAG_COMPLETE, onDividerDragComplete);
+ dragManager.makeDraggable(DisplayObject(event.currentTarget),
+ new Rectangle(0,0,0,this.height-DisplayObject(event.currentTarget).height));
+ }
+
+
+ protected function onDividerDragComplete(event:DragEvent):void{
+ var dragManager:DragManager = DragManager.getInstance()
+ dragManager.removeEventListener(DragEvent.DRAG_COMPLETE, onDividerDragComplete);
+
+ /*
+ If the divider moves up, delta is -ve, otherwise +ve
+ */
+ var delta:Number = event.mouseYDelta//point.y - event.dragInitiator.y
+
+ var topUIC:MeasurableControl
+ var bottomUIC:MeasurableControl
+
+ for(var i:int=0; imaxDropDownHeight, the list
+ * tries to create a scrollbar as long as the IComboButtonSkin
+ * specifies a List skin with Scrollbars defined.
+ *
+ * @see org.openPyro.controls.skins.IComboBoxSkin
+ */
+ public function set maxDropDownHeight(value:Number):void
+ {
+ _maxDropDownHeight = value;
+ }
+
+ /**
+ * @private
+ */
+ public function get maxDropDownHeight():Number
+ {
+ return _maxDropDownHeight;
+ }
+
+ public function open():void
+ {
+ if(_isOpen) return;
+ _isOpen = true;
+
+
+
+ if(!_list)
+ {
+ _list = new List()
+ _list.skin = new AuroraContainerSkin()
+ _list.layout = new VLayout(-1);
+ var renderers:ClassFactory = new ClassFactory(DefaultListRenderer)
+ renderers.properties = {percentWidth:100, height:25}
+ _list.itemRenderer = renderers;
+ _list.filters = [new DropShadowFilter(2,90, 0, .5,2,2)];
+
+ listHolder.addChildAt(_list,0);
+ var overlayManager:OverlayManager = OverlayManager.getInstance()
+ if(!overlayManager.overlayContainer){
+ var sprite:Sprite = new Sprite()
+ this.stage.addChild(sprite)
+ overlayManager.overlayContainer = sprite
+ }
+
+ overlayManager.showOnOverlay(listHolder, this);
+
+
+
+
+ //overlayManager.showPopUp(listHolder, false, false);
+
+
+ _list.width = this.width;
+
+ if(!isNaN(_maxDropDownHeight))
+ {
+ _list.height = _maxDropDownHeight;
+ }
+ _list.dataProvider = _dataProvider;
+ _list.addEventListener(ListEvent.ITEM_CLICK, onListItemClick);
+ _list.addEventListener(ListEvent.CHANGE, onListChange);
+ _list.validateSize()
+
+ }
+
+ _list.selectedIndex = _selectedIndex;
+
+ // draw the mask //
+
+ this._maskShape.graphics.clear()
+ this._maskShape.graphics.beginFill(0xff0000,.4)
+ this._maskShape.graphics.drawRect(-4,this.height+2,this.width+8, _list.height+4)
+ this._maskShape.graphics.endFill()
+ listHolder.mask = _maskShape;
+ _list.y = this.height-_list.height
+ TweenMax.to(_list, .5, {y:this.height+2, onComplete:function():void{
+ stage.addEventListener(MouseEvent.CLICK, onStageClick)
+ }})
+
+ }
+
+ protected function onStageClick(event:MouseEvent):void{
+ trace("curre "+ (event.currentTarget))
+ trace("tgt "+ (event.target))
+ if(this._isOpen){
+ close();
+ }
+ }
+
+ protected function onListItemClick(event:ListEvent):void
+ {
+ this._bttn.label = _bttnLabelFunction(_list.selectedItem);
+ _selectedIndex = _list.selectedIndex;
+ dispatchEvent(event);
+ close()
+ }
+
+ public function get selectedIndex():int
+ {
+ return _selectedIndex;
+ }
+
+ protected function onListChange(event:ListEvent):void
+ {
+ _selectedIndex = _list.selectedIndex;
+ dispatchEvent(event.clone());
+ }
+
+ public function close():void
+ {
+ if(!_isOpen) return;
+ stage.removeEventListener(MouseEvent.CLICK, onStageClick)
+ _isOpen = false;
+ TweenMax.to(_list, .5, {y:this.height-_list.height})
+ }
+
+
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_bttn){
+ _bttn.width = unscaledWidth;
+ _bttn.height = unscaledHeight;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Image.as b/src/org/openPyro/controls/Image.as
new file mode 100644
index 0000000..038c062
--- /dev/null
+++ b/src/org/openPyro/controls/Image.as
@@ -0,0 +1,189 @@
+package org.openPyro.controls
+{
+ import org.openPyro.core.UIControl;
+
+ import flash.display.Loader;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLRequest;
+ import flash.system.LoaderContext;
+
+ public class Image extends UIControl
+ {
+ private var _sourceURL:String = "";
+ private var _loader:Loader;
+
+ public function Image() {
+ super();
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+ _loader = new Loader();
+ _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
+ _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
+ addChild(_loader);
+
+ if(!_loaderContext)
+ {
+ _loaderContext = new LoaderContext(true);
+ }
+
+ if(_autoLoad && (_sourceURL != "")){
+ _loader.load(new URLRequest(_sourceURL), _loaderContext);
+ }
+ }
+
+ protected var _autoLoad:Boolean = true;
+ public function set autoLoad(b:Boolean):void
+ {
+ _autoLoad = b;
+ }
+
+ public function get autoLoad():Boolean
+ {
+ return _autoLoad;
+ }
+
+ public function set source(url:String):void
+ {
+ if(url == _sourceURL) return;
+ _sourceURL = url;
+ if(_loader && _autoLoad){
+ _loader.load(new URLRequest(url), _loaderContext);
+ }
+ }
+
+ private var _loaderContext:LoaderContext
+
+ /**
+ * The LoaderContext that is used when loading an
+ * image.
+ */
+ public function set loaderContext(context:LoaderContext):void
+ {
+ _loaderContext = context;
+ }
+
+ /**
+ * @private
+ */
+ public function get loaderContext():LoaderContext
+ {
+ return _loaderContext;
+ }
+
+ /**
+ * Returns the raw loader being used to load the image
+ */
+ public function get loader():Loader
+ {
+ return _loader;
+ }
+
+ protected var _originalContentWidth:Number = NaN;
+ protected var _originalContentHeight:Number = NaN;
+
+ protected function onLoadComplete(event:Event):void
+ {
+ _originalContentWidth = _loader.content.width;
+ _originalContentHeight = _loader.content.height;
+ dispatchEvent(new Event(Event.COMPLETE));
+ forceInvalidateDisplayList = true;
+ invalidateSize();
+ invalidateDisplayList()
+ }
+ override protected function doChildBasedValidation():void{
+ if(!_loader || !_loader.content) return;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth)){
+ measuredWidth = _originalContentWidth + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ measuredHeight = _originalContentWidth + _padding.top + _padding.bottom;
+ }
+ }
+
+ public function get contentWidth():Number{
+ return _loader.content.width;
+ }
+
+ public function get contentHeight():Number{
+ return _loader.content.height;
+ }
+
+ public function get originalContentWidth():Number{
+ return _originalContentWidth
+ }
+
+ public function get originalContentHeight():Number{
+ return _originalContentHeight;
+ }
+
+
+ protected function onIOError(event:IOErrorEvent):void
+ {
+ //todo: Put broken thumb skin here//
+ }
+
+ protected var _scaleToFit:Boolean = true;
+ public function get scaleToFit():Boolean
+ {
+ return _scaleToFit;
+ }
+
+ public function set scaleToFit(value:Boolean):void
+ {
+ _scaleToFit = value;
+ if(_scaleToFit && _loader && _loader.content)
+ {
+ scaleImageContent()
+ }
+ }
+
+
+
+ protected var _maintainAspectRatio:Boolean = true;
+ public function set maintainAspectRatio(value:Boolean):void
+ {
+ _maintainAspectRatio = value;
+ }
+ public function get maintainAspectRatio():Boolean
+ {
+ return _maintainAspectRatio;
+ }
+
+ protected function scaleImageContent():void
+ {
+
+ var scaleX:Number;
+ var scaleY:Number;
+ scaleX = width / _originalContentWidth;
+ scaleY = height / _originalContentHeight;
+
+ if(_maintainAspectRatio)
+ {
+ var scale:Number = Math.min(scaleX, scaleY);
+ _loader.content.width = _originalContentWidth*scale;
+ _loader.content.height = _originalContentHeight*scale;
+ }
+ else
+ {
+ _loader.content.width = _originalContentWidth*scaleX;
+ _loader.content.height = _originalContentHeight*scaleY;
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_loader && _loader.content && _scaleToFit){
+ scaleImageContent()
+ }
+ _loader.x = _padding.left
+ _loader.y = _padding.top;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Label.as b/src/org/openPyro/controls/Label.as
new file mode 100644
index 0000000..1dba7f2
--- /dev/null
+++ b/src/org/openPyro/controls/Label.as
@@ -0,0 +1,139 @@
+package org.openPyro.controls
+{
+ import org.openPyro.core.UIControl;
+ import org.openPyro.utils.StringUtil;
+
+ import flash.text.TextField;
+ import flash.text.TextFormat;
+
+ public class Label extends UIControl
+ {
+ protected var _textField:TextField;
+
+ public function Label()
+ {
+ super();
+ }
+
+ override protected function createChildren():void{
+ _textField = new TextField();
+ setTextFieldProperties()
+ addChild(_textField);
+
+ if(_format){
+ _textField.defaultTextFormat = _format;
+ }
+ if(_text){
+ _textField.text = _text
+ }
+ }
+
+ protected function setTextFieldProperties():void{
+ _textField.selectable = false;
+ //_textField.border = true;
+ }
+
+ /**
+ * Returns the raw textfield used to render
+ * the text
+ */
+ public function get textField():TextField
+ {
+ return _textField;
+ }
+
+ protected var _format:TextFormat;
+
+ /**
+ * Sets the TextFormat on the
+ * label.
+ *
+ * @see flash.text.TextFormat
+ */
+ public function set textFormat(tf:TextFormat):void
+ {
+ _format = tf;
+ if(!_textField)return;
+
+ _textField.defaultTextFormat = tf;
+ if(_text){
+ this.text = _text;
+ }
+ }
+
+ public function get textFormat():TextFormat{
+ return _format
+ }
+
+
+ protected var _text:String = "";
+
+ /**
+ * Sets the string that will be displayed
+ * on the label
+ */
+ public function set text(str:String):void
+ {
+ if(_text == str) return;
+ this._text = str;
+ if(!_textField)return;
+ this.invalidateSize();
+ this.forceInvalidateDisplayList=true
+ this.invalidateDisplayList();
+ }
+
+ public function get text():String{
+ return _text;
+ }
+
+ override protected function doChildBasedValidation():void
+ {
+ //
+ // Set the _textField's text so that we can measure based on
+ // the textWidths
+ //
+ if(!_textField) return;
+ _textField.text = _text;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ var computedWidth:Number = this._textField.textWidth+5 + _padding.left + _padding.right;
+ if(!isNaN(_maximumWidth)){
+ computedWidth = Math.min(computedWidth, _maximumWidth);
+ }
+ super.measuredWidth = computedWidth;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ var computedHeight:Number = this._textField.textHeight+5 + _padding.top + _padding.bottom;
+ if(!isNaN(_maximumHeight)){
+ computedHeight = Math.min(computedHeight, _maximumHeight)
+ }
+ super.measuredHeight = computedHeight;
+ }
+
+ //
+ // Measured Width and height may not have changed so updateDisplaylist may not
+ // be called. So do the text truncation again (may be redundant though)
+ //
+ if(_textField.textWidth > _textField.width){
+
+ StringUtil.omitWordsToFit(_textField);
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ _textField.x = this._padding.left;
+ _textField.y = this._padding.top;
+ _textField.width = unscaledWidth - _padding.left - _padding.right;
+ _textField.height = unscaledHeight - _padding.top - _padding.bottom;
+ _textField.text = _text;
+ if(_textField.textWidth > _textField.width){
+ StringUtil.omitWordsToFit(_textField);
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/List.as b/src/org/openPyro/controls/List.as
new file mode 100644
index 0000000..d0c6ec4
--- /dev/null
+++ b/src/org/openPyro/controls/List.as
@@ -0,0 +1,435 @@
+package org.openPyro.controls
+{
+ import org.openPyro.collections.CollectionHelpers;
+ import org.openPyro.collections.ICollection;
+ import org.openPyro.collections.IIterator;
+ import org.openPyro.collections.events.CollectionEvent;
+ import org.openPyro.collections.events.CollectionEventKind;
+ import org.openPyro.collections.events.IteratorEvent;
+ import org.openPyro.controls.events.ListEvent;
+ import org.openPyro.controls.listClasses.BaseListData;
+ import org.openPyro.controls.listClasses.DefaultListRenderer;
+ import org.openPyro.controls.listClasses.IListDataRenderer;
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.core.IDataRenderer;
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.ObjectPool;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.layout.VLayout;
+ import org.openPyro.utils.ArrayUtil;
+ import org.openPyro.utils.StringUtil;
+
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+
+ [Event(name="change", type="org.openPyro.controls.events.ListEvent")]
+ [Event(name="itemClick", type="org.openPyro.controls.events.ListEvent")]
+
+ public class List extends UIContainer
+ {
+
+ /**
+ * Resets scrolls when the dataProvider changes
+ */
+ public var autoResetScrollOnDataProviderChange:Boolean = true
+
+
+ public function List()
+ {
+ super();
+ this._labelFunction = StringUtil.toStringLabel
+ _layout = new VLayout();
+ }
+
+ protected var _labelFunction:Function = StringUtil.toStringLabel
+ public function set labelFunction(func:Function):void{
+ _labelFunction = func;
+ /*
+ * TODO: Change label functions on all itemRenderers
+ */
+ }
+
+ public function get labelFunction():Function{
+ return _labelFunction;
+ }
+
+
+ override protected function createChildren():void
+ {
+ if(!this._rendererPool){
+ var cf:ClassFactory = new ClassFactory(DefaultListRenderer);
+ cf.properties = {percentWidth:100, height:25};
+ _rendererPool = new ObjectPool(cf)
+ }
+ }
+
+ protected var renderers:Array = new Array();
+ protected var _rendererPool:ObjectPool;
+ protected var selectedRenderer:DisplayObject;
+
+ protected var _dataProvider:ICollection;
+ protected var _originalRawDataProvider:Object;
+
+ public function set dataProvider(dp:Object):void{
+ if(dp == _originalRawDataProvider){
+ return;
+ }
+ _originalRawDataProvider =dp
+ if(autoResetScrollOnDataProviderChange){
+ verticalScrollPosition = 0
+ horizontalScrollPosition=0
+ }
+ if(_dataProvider){
+ _dataProvider.removeEventListener(CollectionEvent.COLLECTION_CHANGED, onSourceCollectionChanged);
+ _dataProvider.iterator.addEventListener(IteratorEvent.ITERATOR_MOVED, onIteratorMoved);
+ }
+ convertDataToCollection(dp)
+ _dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGED, onSourceCollectionChanged);
+ _dataProvider.iterator.addEventListener(IteratorEvent.ITERATOR_MOVED, onIteratorMoved);
+ createRenderers()
+ }
+
+ public function get originalRawDataProvider():Object{
+ return _originalRawDataProvider;
+ }
+
+ protected function createRenderers():void{
+ if(!_rendererPool) return;
+ returnRenderersToPool()
+ var renderer:DisplayObject;
+
+ var iterator:IIterator = _dataProvider.iterator;
+ iterator.reset();
+
+ while(iterator.hasNext())
+ {
+ var listData:Object = iterator.getNext();
+ renderer = DisplayObject(_rendererPool.getObject());
+ setRendererData(renderer, listData, iterator.cursorIndex);
+ renderers.push(renderer);
+ contentPane.addChildAt(renderer,0);
+
+ }
+ // reset the iterator to -1
+ iterator.reset()
+
+ displayListInvalidated = true;
+ this.forceInvalidateDisplayList = true;
+ this.invalidateSize();
+ this.invalidateDisplayList();
+ _selectedIndex = -1;
+ }
+
+ public function get dataProvider():Object{
+ return _dataProvider;
+ }
+
+ /**
+ * Converts an Array to ArrayCollection or xml to
+ * XMLCollection. Written as a separate function so
+ * that overriding classes may massage the data as
+ * needed
+ */
+ protected function convertDataToCollection(dp:Object):void{
+ this._dataProvider = CollectionHelpers.sourceToCollection(dp);
+ }
+
+ private function onSourceCollectionChanged(event:CollectionEvent):void{
+
+ if(event.kind == CollectionEventKind.REMOVE){
+ handleDataProviderItemsRemoved(event)
+ }
+
+ else if(event.kind == CollectionEventKind.ADD){
+ handDataProviderItemsAdded(event)
+ }
+ else if(event.kind == CollectionEventKind.RESET){
+ createRenderers();
+ }
+
+ this.displayListInvalidated = true
+ this.layoutInvalidated = true;
+ this.invalidateSize()
+ }
+
+ protected function onIteratorMoved(event:IteratorEvent):void{
+ var data:Object = _dataProvider.iterator.getCurrent();
+ var renderer:DisplayObject = dataToItemRenderer(data);
+ if(renderer is IListDataRenderer){
+ IListDataRenderer(renderer).selected = true;
+ }
+ selectedRenderer = renderer;
+ dispatchEvent(new ListEvent(ListEvent.CHANGE));
+ }
+
+ protected function handleDataProviderItemsRemoved(event:CollectionEvent):void
+ {
+ var childNodesData:Array = event.delta;
+
+ var renderer:DisplayObject
+ for(var i:int=0; i=0; l--){
+ //(this.renderers.length == 0)?0:this.renderers[this.renderers.length-1].y
+ var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
+ var listData:Object = childNodesData[l]
+ setRendererData(newRenderer, listData, l);
+ this.contentPane.addChild(newRenderer);
+
+ newRenderer.y = tgtY;
+
+ renderers.unshift(newRenderer);
+
+ }
+
+ }
+
+ else{
+ //trace(XMLNodeDescriptor(eventSourceData).nodeString);
+ for(var j:int=0; j=0; k--){
+ var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
+ var listData:Object = childNodesData[k]
+ setRendererData(newRenderer, listData, k);
+ this.contentPane.addChildAt(newRenderer,0);
+ newRenderer.y = positionRefNode.y - newRenderer.height;
+ positionRefNode = newRenderer;
+ ArrayUtil.insertAt(renderers, (j+1), newRenderer);
+ }
+ break;
+ }
+ }
+ }
+ this.forceInvalidateDisplayList=true;
+ invalidateSize();
+ invalidateDisplayList();
+ }
+
+ protected function returnRenderersToPool():void{
+ var renderer:DisplayObject
+ while(renderers.length > 0)
+ {
+ renderer = renderers.shift();
+ if(renderer.parent)
+ {
+ renderer.parent.removeChild(renderer);
+ }
+ _rendererPool.returnToPool(renderer);
+ }
+ }
+
+ protected function setRendererData(renderer:DisplayObject, data:Object, index:int):void
+ {
+ if(renderer is IListDataRenderer){
+ var listRenderer:IListDataRenderer = renderer as IListDataRenderer;
+ var baseListData:BaseListData = new BaseListData()
+ baseListData.list = this;
+ baseListData.rowIndex = index;
+
+ listRenderer.baseListData = baseListData;
+
+ /*
+ If the list Renderer is a measurable control,
+ make sure the renderer is initialized before you
+ set the data property. That way all children have
+ been created and can be populated w/ data.
+ */
+ if(listRenderer is MeasurableControl){
+ if(MeasurableControl(listRenderer).initialized){
+ listRenderer.data = data;
+ }
+ else{
+ MeasurableControl(listRenderer).addEventListener(PyroEvent.INITIALIZE,
+ function(event:PyroEvent):void{
+ listRenderer.data = data;
+ MeasurableControl(listRenderer).removeEventListener(PyroEvent.INITIALIZE, arguments.callee);
+ })
+ }
+ }
+ else{
+ listRenderer.data = data;
+ }
+ }
+ renderer.addEventListener(MouseEvent.CLICK, handleRendererClick);
+ }
+
+
+ protected function handleRendererClick(event:MouseEvent):void
+ {
+ // dont react if the click is coming from a currently
+ // selected child.
+ if(!(event.currentTarget is IListDataRenderer) || IListDataRenderer(event.currentTarget).selected) return;
+
+
+ if(selectedRenderer && selectedRenderer is IListDataRenderer){
+ IListDataRenderer(selectedRenderer).selected = false;
+ }
+ var newIndex:int = itemRendererToIndex(event.currentTarget as DisplayObject);
+ if(newIndex != selectedIndex){
+ selectedIndex = newIndex;
+ selectedRenderer = event.currentTarget as DisplayObject;
+ if(selectedRenderer is IListDataRenderer){
+ IListDataRenderer(selectedRenderer).selected = true;
+ }
+ }
+
+ dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK));
+ }
+
+
+ public function dataToItemRendererIndex(data:*):int
+ {
+ for(var i:uint=0; i 0){
+ renderer = renderers.shift();
+ if(renderer.parent){
+ renderer.parent.removeChild(renderer);
+ renderer = null;
+ }
+ }
+ }
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ }
+
+ override public function get layoutChildren():Array{
+ return this.renderers;
+ }
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/ScrollBar.as b/src/org/openPyro/controls/ScrollBar.as
new file mode 100644
index 0000000..d59c3f2
--- /dev/null
+++ b/src/org/openPyro/controls/ScrollBar.as
@@ -0,0 +1,335 @@
+package org.openPyro.controls
+{
+ import org.openPyro.controls.events.ScrollEvent;
+ import org.openPyro.controls.events.SliderEvent;
+ import org.openPyro.controls.scrollBarClasses.HScrollBarLayout;
+ import org.openPyro.controls.scrollBarClasses.VScrollBarLayout;
+ import org.openPyro.controls.skins.IScrollBarSkin;
+ import org.openPyro.core.Direction;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.skins.ISkin;
+
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ [Event(name="scroll",type="org.openPyro.controls.events.ScrollEvent")]
+
+ public class ScrollBar extends UIContainer
+ {
+
+ protected var _direction:String;
+ protected var _slider:Slider;
+
+ public function ScrollBar(direction:String)
+ {
+ this._direction = direction;
+ super();
+ _styleName = "ScrollBar"
+ }
+
+ /**
+ * At the very least, a scrollBar needs a slider
+ * or some subclass of it.
+ * Increment and Decrement Buttons are created
+ * automatically when a skin is applied.
+ */
+ override public function initialize():void
+ {
+ if(!_slider)
+ {
+ slider = new Slider(_direction);
+ slider.addEventListener(PyroEvent.UPDATE_COMPLETE, onSliderUpdateComplete)
+ slider.minimum = _minimum
+ slider.maximum = _maximum;
+ }
+ //if(!_layout)
+ //{
+ if(this._direction == Direction.HORIZONTAL)
+ {
+ _layout = new HScrollBarLayout()
+ }
+ else if(this._direction == Direction.VERTICAL)
+ {
+ _layout = new VScrollBarLayout();
+ }
+ //}
+ this._layout.container = this;
+ super.initialize();
+
+ }
+
+ public function get direction():String
+ {
+ return _direction;
+ }
+
+ override public function set skin(skinImpl:ISkin):void
+ {
+ super.skin = skinImpl;
+ if(_skin is IScrollBarSkin)
+ {
+ var scrollBarSkin:IScrollBarSkin = IScrollBarSkin(skinImpl);
+ if(scrollBarSkin.sliderSkin)
+ {
+ if(!_slider)
+ {
+ slider = new Slider(this._direction);
+ slider.minimum = _minimum
+ slider.maximum = _maximum
+ slider.addEventListener(PyroEvent.UPDATE_COMPLETE, onSliderUpdateComplete)
+ }
+ _slider.skin = scrollBarSkin.sliderSkin;
+ }
+ if(scrollBarSkin.incrementButtonSkin)
+ {
+ this.incrementButtonSkin = scrollBarSkin.incrementButtonSkin;
+ }
+ if(scrollBarSkin.decrementButtonSkin)
+ {
+ this.decrementButtonSkin = scrollBarSkin.decrementButtonSkin;
+ }
+ }
+ }
+
+ protected function onSliderUpdateComplete(event:PyroEvent):void
+ {
+ updateScrollUI()
+ }
+
+ protected var _incrementButton:Button;
+ public function set incrementButton(b:Button):void
+ {
+ _incrementButton = b;
+ /*if(_direction == Direction.VERTICAL)
+ {
+ b.percentUnusedWidth=100
+ }
+ if(_direction == Direction.HORIZONTAL)
+ {
+ b.percentUnusedHeight = 100;
+ }*/
+ _incrementButton.addEventListener(MouseEvent.CLICK, onIncrementButtonClick);
+ $addChild(b);
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ public function get incrementButton():Button
+ {
+ return _incrementButton;
+ }
+
+ protected var _incrementButtonSkin:ISkin;
+ public function set incrementButtonSkin(skin:ISkin):void
+ {
+ _incrementButtonSkin = skin;
+ if(!_incrementButton)
+ {
+ incrementButton = new Button();
+ // trigger invalidateDL to retrigger the layout
+ //this.invalidateDisplayList();
+ }
+ _incrementButton.skin = skin;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ protected var _decrementButton:Button;
+ public function set decrementButton(b:Button):void
+ {
+ _decrementButton = b;
+ /*if(_direction == Direction.VERTICAL)
+ {
+ b.percentUnusedWidth=100;
+ }
+ if(_direction == Direction.HORIZONTAL)
+ {
+ b.percentUnusedHeight = 100;
+ }*/
+ _decrementButton.addEventListener(MouseEvent.CLICK, onDecrementButtonClick)
+ $addChild(b);
+ invalidateSize()
+ //invalidateDisplayList();
+ }
+
+ /**
+ * The height/width the scrollbar must scroll
+ * when one of the scroll buttons is clicked on.
+ */
+ public var incrementalScrollDelta:Number=25;
+ private function onDecrementButtonClick(event:Event):void{
+ if(_slider.direction == Direction.HORIZONTAL){
+ _slider.thumbButton.x = Math.max(0, _slider.thumbButton.x - incrementalScrollDelta)
+ }
+ else if(slider.direction == Direction.VERTICAL){
+ _slider.thumbButton.y = Math.max(0, _slider.thumbButton.y - incrementalScrollDelta)
+ }
+ _slider.dispatchScrollEvent()
+
+ }
+ private function onIncrementButtonClick(event:Event):void{
+ //_slider.value = Math.min(1, _slider.value + incrementalScrollDelta/_slider.height)
+ if(_slider.direction == Direction.HORIZONTAL){
+ _slider.thumbButton.x = Math.min(_slider.width-_slider.thumbButton.width,_slider.thumbButton.x + incrementalScrollDelta);
+ }
+ else if(slider.direction == Direction.VERTICAL){
+ _slider.thumbButton.y = Math.min(_slider.height-_slider.thumbButton.height, _slider.thumbButton.y + incrementalScrollDelta)
+ }
+ _slider.dispatchScrollEvent()
+ }
+
+ public function get decrementButton():Button
+ {
+ return _decrementButton;
+ }
+
+ protected var _decrementButtonSkin:ISkin;
+ public function set decrementButtonSkin(skin:ISkin):void
+ {
+ _decrementButtonSkin = skin;
+ if(!_decrementButton)
+ {
+ decrementButton = new Button()
+ }
+ _decrementButton.skin = skin;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ public function set slider(sl:Slider):void{
+
+ if(_slider)
+ {
+ _slider.removeEventListener(SliderEvent.CHANGE, onSliderThumbDrag);
+ removeChild(_slider);
+ _slider = null;
+ }
+
+ _slider = sl;
+ _slider.addEventListener(SliderEvent.CHANGE, onSliderThumbDrag);
+ this.$addChild(_slider);
+ if(_direction == Direction.HORIZONTAL){
+ _slider.explicitWidth = NaN;
+ _slider.percentUnusedWidth = 100;
+ _slider.percentUnusedHeight = 100;
+ }
+ else if(_direction==Direction.VERTICAL){
+ _slider.explicitHeight = NaN;
+ _slider.percentUnusedWidth = 100;
+ _slider.percentUnusedHeight = 100;
+ }
+ _slider.minimum = 0;
+ _slider.maximum = 1;
+ this.invalidateSize()
+ //this.invalidateDisplayList()
+ }
+
+ public function get slider():Slider
+ {
+ return _slider;
+ }
+
+ private var _sliderThumbPosition:Number = 0;
+ protected function onSliderThumbDrag(event:SliderEvent):void
+ {
+ var scrollEvent:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
+ scrollEvent.direction = this._direction;
+ scrollEvent.delta = _slider.value - _sliderThumbPosition;
+ scrollEvent.value = this._slider.value;
+ dispatchEvent(scrollEvent);
+ _sliderThumbPosition = _slider.value;
+ }
+
+ /**
+ * For scrollBars, unless the dimension properites of the
+ * buttons are set, the button's width and heights are
+ * set to the same as the each other to create square
+ * buttons
+ */
+ override public function validateSize():void
+ {
+ super.validateSize();
+
+ }
+
+
+ private var _value:Number = 0;
+ private var _minimum:Number = 0;
+ private var _maximum:Number = 100;
+
+ public function set minimum(value:Number):void
+ {
+ _minimum = value;
+ if(_slider)
+ {
+ _slider.minimum = value;
+ }
+ }
+
+ public function get minimum():Number
+ {
+ return _minimum;
+ }
+
+ public function set maximum(value:Number):void
+ {
+ _maximum = value;
+ if(_slider)
+ {
+ _slider.maximum = value
+ }
+ }
+
+ public function get maximum():Number
+ {
+ return _maximum;
+ }
+
+ public function set value(v:Number):void{
+ _value = v;
+ if(_slider){
+ _slider.value = v;
+ }
+ }
+
+ public function get value():Number
+ {
+ return _slider.value
+ }
+
+
+ protected var _visibleScroll:Number = NaN;
+ protected var _maxScroll:Number=NaN;
+ protected var _scrollButtonSize:Number = NaN;
+
+ public function setScrollProperty(visibleScroll:Number, maxScroll:Number):void
+ {
+
+ //trace("Setting scroll py >> "+visibleScroll, maxScroll, _slider.height, this.height);
+ //trace(">> "+this.height, this.incrementButton.height, this.decrementButton.height);
+ //if(visibleScroll == _visibleScroll && maxScroll == _maxScroll) return;
+
+ _visibleScroll = visibleScroll;
+ _maxScroll = maxScroll;
+ updateScrollUI()
+ }
+
+ protected function updateScrollUI():void
+ {
+ if(!_slider) return;
+ if(this._direction == Direction.VERTICAL)
+ {
+ _scrollButtonSize = Math.floor(_visibleScroll*_slider.height/_maxScroll)
+ _slider.thumbButtonHeight = _scrollButtonSize
+
+ }
+ else if(this._direction == Direction.HORIZONTAL)
+ {
+ _scrollButtonSize = Math.floor(_visibleScroll*_slider.width/_maxScroll);
+ _slider.thumbButtonWidth = _scrollButtonSize;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Slider.as b/src/org/openPyro/controls/Slider.as
new file mode 100644
index 0000000..0bcf074
--- /dev/null
+++ b/src/org/openPyro/controls/Slider.as
@@ -0,0 +1,313 @@
+package org.openPyro.controls
+{
+ import org.openPyro.controls.events.ButtonEvent;
+ import org.openPyro.controls.events.SliderEvent;
+ import org.openPyro.controls.skins.ISliderSkin;
+ import org.openPyro.core.Direction;
+ import org.openPyro.core.UIControl;
+ import org.openPyro.skins.ISkin;
+
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+
+ [Event(name="thumbDrag", type="org.openPyro.controls.events.SliderEvent")]
+
+ public class Slider extends UIControl
+ {
+
+ protected var _direction:String;
+ protected var _thumbButton:Button;
+ protected var _trackSkin:DisplayObject;
+ protected var _isThumbPressed:Boolean = false;
+ protected var _thumbButtonHeight:Number=NaN;
+ protected var _thumbButtonWidth:Number = NaN;
+
+ public function Slider(direction:String)
+ {
+ super();
+ this._direction = direction;
+ this._styleName = "Slider";
+ }
+
+ public function get direction():String
+ {
+ return _direction;
+ }
+
+ override public function initialize():void
+ {
+ super.initialize()
+ if(!_thumbButton)
+ {
+ thumbButton = new Button();
+ }
+ }
+
+ override public function set skin(skinImpl:ISkin):void{
+ super.skin = skinImpl;
+ if(skinImpl is ISliderSkin)
+ {
+ var sliderSkin:ISliderSkin = ISliderSkin(skinImpl);
+ if(sliderSkin.trackSkin && sliderSkin.trackSkin is DisplayObject)
+ this.trackSkin = DisplayObject(sliderSkin.trackSkin);
+ if(sliderSkin.thumbSkin)
+ {
+ if(!this._thumbButton)
+ {
+ thumbButton = new Button();
+ }
+ this.thumbSkin = sliderSkin.thumbSkin;
+ }
+
+ }
+ this.invalidateSize()
+ }
+
+ public function set thumbButton(button:Button):void
+ {
+ if(_thumbButton){
+ _thumbButton.removeEventListener(ButtonEvent.DOWN, onThumbDown);
+ removeChild(_thumbButton)
+ _thumbButton =null;
+ }
+ _thumbButton = button;
+ _thumbButton.x = 0;
+ _thumbButton.addEventListener(ButtonEvent.DOWN, onThumbDown);
+
+ /*
+ Buttons by default return to their 'up' state when
+ the mouse moves out, but slider buttons do not.
+ */
+ _thumbButton.mouseOutHandler = function(event:MouseEvent):void{}
+
+ if(_direction == Direction.VERTICAL)
+ {
+ if(isNaN(_thumbButton.explicitWidth) && isNaN(_thumbButton.percentUnusedWidth))
+ {
+ _thumbButton.percentUnusedWidth = 100;
+ }
+ _thumbButton.height = _thumbButtonHeight;
+ }
+ else if(_direction == Direction.HORIZONTAL)
+ {
+ if(isNaN(_thumbButton.explicitHeight) && isNaN(_thumbButton.percentUnusedHeight))
+ {
+ _thumbButton.percentUnusedHeight = 100;
+ }
+ _thumbButton.width = 100;
+ }
+
+ addChild(_thumbButton);
+
+ if(this._thumbSkin)
+ {
+ _thumbButton.skin = _thumbSkin;
+ }
+
+
+ /*
+ set the state
+ */
+ if(_isThumbPressed){
+ // _thumbButton.setState
+ }
+ }
+
+ public function get thumbButton():Button
+ {
+ return _thumbButton;
+ }
+
+ protected var _thumbSkin:ISkin
+ public function set thumbSkin(skin:ISkin):void
+ {
+ _thumbSkin = skin;
+ if(this._thumbButton)
+ {
+ _thumbButton.skin = skin
+ }
+ _thumbButton.width = _thumbButtonWidth;
+ }
+
+ private var _value:Number = 0;
+ private var _minimum:Number = 0;
+ private var _maximum:Number = 100;
+
+
+ public function get minimum():Number{
+ return _minimum;
+ }
+
+ public function set minimum(value:Number):void
+ {
+ _minimum = value;
+ }
+
+ public function get maximum():Number{
+ return _maximum;
+ }
+
+ public function set maximum(value:Number):void
+ {
+ _maximum = value;
+ }
+
+ protected var boundsRect:Rectangle;
+
+ private function onThumbDown(event:ButtonEvent):void{
+ this._isThumbPressed = true;
+ if(_direction == Direction.HORIZONTAL)
+ {
+ boundsRect = new Rectangle(0,0,width-_thumbButton.width, 0);
+ }
+ else
+ {
+ boundsRect = new Rectangle(0,0,0, height-_thumbButton.height);
+ }
+ _thumbButton.startDrag(false,boundsRect)
+ this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ _thumbButton.addEventListener(ButtonEvent.UP, onThumbUp);
+ stage.addEventListener(MouseEvent.MOUSE_UP, onThumbUp);
+
+ }
+
+ private function onEnterFrame(event:Event):void{
+ if(_isThumbPressed){
+ //compute slider value
+ dispatchScrollEvent()
+ }
+ }
+
+ public function dispatchScrollEvent():void
+ {
+ var computedValue:Number
+ if(_direction == Direction.HORIZONTAL)
+ {
+ computedValue = (_thumbButton.x/(this.width-_thumbButton.width))*(_maximum-_minimum);
+ thumbButtonX = _thumbButton.x;
+ }
+ else
+ {
+ computedValue = (_thumbButton.y/(this.height-_thumbButton.height))*(_maximum-_minimum);
+ thumbButtonY = _thumbButton.y;
+ }
+ if(computedValue != _value)
+ {
+ _value = computedValue;
+ dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG));
+ dispatchEvent(new SliderEvent(SliderEvent.CHANGE));
+ }
+ }
+
+ private function onThumbUp(event:Event):void{
+ this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
+ stage.removeEventListener(MouseEvent.MOUSE_UP, onThumbUp);
+ _thumbButton.stopDrag();
+ this._isThumbPressed=false;
+ }
+
+ public function set trackSkin(trackSkin:DisplayObject):void{
+ if(_trackSkin)
+ {
+ _trackSkin.removeEventListener(MouseEvent.CLICK, onTrackSkinClick);
+ }
+ _trackSkin = trackSkin;
+ _trackSkin.addEventListener(MouseEvent.CLICK, onTrackSkinClick);
+ _trackSkin.x = 0;
+ addChildAt(_trackSkin,0);
+ this.invalidateDisplayList();
+ }
+
+ protected var thumbButtonX:Number = 0
+ protected var thumbButtonY:Number = 0
+
+
+ public function onTrackSkinClick(event:MouseEvent):void
+ {
+ if(_direction == Direction.HORIZONTAL)
+ {
+ thumbButtonX = Math.min(event.localX, (this.width-_thumbButton.width))
+ _thumbButton.x = thumbButtonX
+ }
+ else if(_direction == Direction.VERTICAL)
+ {
+ thumbButtonY = Math.min(event.localY, (this.height - _thumbButton.height))
+ _thumbButton.y = thumbButtonY
+ }
+ dispatchScrollEvent()
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_trackSkin)
+ {
+ _trackSkin.width = unscaledWidth;
+ _trackSkin.height = unscaledHeight;
+ if(_trackSkin is UIControl)
+ {
+ UIControl(_trackSkin).validateSize();
+ UIControl(_trackSkin).validateDisplayList()
+ }
+
+ /*
+ Position the thumb button wherever it was supposed to
+ be. For some reason updateDisplaylist keeps sending the button
+ to 0,0
+ */
+ this._thumbButton.y = this.thumbButtonY;
+ this._thumbButton.x = this.thumbButtonX;
+ }
+
+
+ }
+
+ public function get value():Number{
+ return _value;
+ }
+
+ public function set value(v:Number):void{
+ _value = v;
+ if(!thumbButton) return;
+ if(_direction == Direction.HORIZONTAL)
+ {
+ _thumbButton.x = v*(this.width-_thumbButton.width)/(_maximum-_minimum) ;
+ thumbButtonX = _thumbButton.x;
+ }
+ else
+ {
+ _thumbButton.y = v*(this.height-_thumbButton.height)/(_maximum-_minimum) ;
+ thumbButtonY = _thumbButton.y;
+ }
+ dispatchEvent(new SliderEvent(SliderEvent.CHANGE));
+ }
+
+ public function set thumbButtonHeight(value:Number):void
+ {
+ _thumbButtonHeight = value;
+ if(_thumbButton)
+ {
+ _thumbButton.height = Math.max(value,_minThumbHeight);
+ }
+ }
+
+ protected var _minThumbHeight:Number = 50;
+ public function set minThumbHeight(value:Number):void
+ {
+ this._minThumbHeight = value;
+ }
+
+
+ public function set thumbButtonWidth(value:Number):void
+ {
+ _thumbButtonWidth = value;
+ if(_thumbButton)
+ {
+ _thumbButton.width = value;
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Spacer.as b/src/org/openPyro/controls/Spacer.as
new file mode 100644
index 0000000..6cb236b
--- /dev/null
+++ b/src/org/openPyro/controls/Spacer.as
@@ -0,0 +1,13 @@
+package org.openPyro.controls
+{
+ import org.openPyro.core.MeasurableControl;
+
+ public class Spacer extends MeasurableControl
+ {
+ public function Spacer()
+ {
+ super();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Text.as b/src/org/openPyro/controls/Text.as
new file mode 100644
index 0000000..372d72f
--- /dev/null
+++ b/src/org/openPyro/controls/Text.as
@@ -0,0 +1,18 @@
+package org.openPyro.controls
+{
+ import flash.events.FullScreenEvent;
+
+ public class Text extends Label
+ {
+ public function Text()
+ {
+ super();
+ //_textField.border = true
+ }
+
+ override protected function setTextFieldProperties():void{
+ _textField.autoSize = "left"
+ _textField.wordWrap = true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/TextInput.as b/src/org/openPyro/controls/TextInput.as
new file mode 100644
index 0000000..1467ee5
--- /dev/null
+++ b/src/org/openPyro/controls/TextInput.as
@@ -0,0 +1,54 @@
+package org.openPyro.controls
+{
+ import org.openPyro.events.PyroEvent;
+
+ import flash.events.Event;
+ import flash.events.KeyboardEvent;
+ import flash.text.TextFieldType;
+ import flash.ui.Keyboard;
+
+ [Event(name="enter", type="org.openPyro.events.PyroEvent")]
+ [Event(name="change", type="flash.events.Event")]
+
+ public class TextInput extends Text
+ {
+ public function TextInput()
+ {
+ super();
+ }
+
+ override protected function setTextFieldProperties():void{
+ //_textField.border = true;
+ _textField.addEventListener(KeyboardEvent.KEY_UP, onKeyUp)
+ _textField.type = TextFieldType.INPUT;
+ _textField.addEventListener(Event.CHANGE, onTextInputChange);
+ _textField.displayAsPassword = _displayAsPassword;
+ _textField.wordWrap = true;
+ _textField.multiline = false;
+ }
+
+ private var _displayAsPassword:Boolean = false;
+ public function set password(b:Boolean):void{
+ _displayAsPassword = b;
+ }
+
+ protected function onTextInputChange(event:Event):void{
+ _text = _textField.text;
+ dispatchEvent(event);
+ }
+
+ protected function onKeyUp(event:KeyboardEvent):void{
+ if(event.keyCode == Keyboard.ENTER){
+ dispatchEvent(new PyroEvent(PyroEvent.ENTER));
+ }
+ }
+
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ _textField.width = width;
+ _textField.height = height;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/Tree.as b/src/org/openPyro/controls/Tree.as
new file mode 100644
index 0000000..b841509
--- /dev/null
+++ b/src/org/openPyro/controls/Tree.as
@@ -0,0 +1,114 @@
+package org.openPyro.controls
+{
+ import org.openPyro.collections.XMLCollection;
+ import org.openPyro.collections.XMLNodeDescriptor;
+ import org.openPyro.controls.events.TreeEvent;
+ import org.openPyro.controls.treeClasses.DefaultTreeItemRenderer;
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.core.ObjectPool;
+ import org.openPyro.layout.VLayout;
+ import org.openPyro.painters.FillPainter;
+
+ import flash.display.DisplayObject;
+ import flash.profiler.showRedrawRegions;
+
+ public class Tree extends List
+ {
+ public function Tree()
+ {
+ super();
+ _labelFunction = function(data:XMLNodeDescriptor):String{
+ if(data.node.nodeKind() == "element"){
+ return String(data.node.@label)
+ }
+ return String(data.node);
+ }
+ this.backgroundPainter = new FillPainter(0xffffff);
+ }
+
+ override protected function createChildren():void
+ {
+ if(!this._rendererPool){
+ var cf:ClassFactory = new ClassFactory(DefaultTreeItemRenderer);
+ cf.properties = {percentWidth:100, height:25};
+ _rendererPool = new ObjectPool(cf)
+ }
+ VLayout(this.layout).animationDuration = 0;
+
+ }
+
+ override protected function convertDataToCollection(dp:Object):void{
+ super.convertDataToCollection(dp);
+ if(!_showRoot){
+ XMLCollection(_dataProvider).normalizedArray.shift();
+ }
+ }
+
+ protected var _showRoot:Boolean = true;
+ public function set showRoot(value:Boolean):void {
+ _showRoot = value;
+ }
+
+ public function get showRoot():Boolean{
+ return _showRoot
+ }
+
+ override protected function setRendererData(renderer:DisplayObject, data:Object, index:int):void{
+ super.setRendererData(renderer, data, index);
+ renderer.addEventListener(TreeEvent.ROTATOR_CLICK, handleRotatorClick);
+ }
+
+ protected function handleRotatorClick(event:TreeEvent):void
+ {
+
+ var node:XMLNodeDescriptor = event.nodeDescriptor;
+ if(node.isLeaf()) {
+ return;
+ }
+ // for a non leaf node
+ if(node.open){
+ closeNode(node);
+ }
+ else{
+ openNode(node);
+ }
+ }
+
+ public function closeNode(node:XMLNodeDescriptor):void{
+ if(node.isLeaf()) {
+ return;
+ }
+ node.open = false;
+ var childNodesData:Array = XMLCollection(this.dataProvider).getOpenChildNodes(node)
+ XMLCollection(this.dataProvider).removeItems(childNodesData);
+ }
+
+ public function openNode(node:XMLNodeDescriptor):void{
+ if(node.isLeaf()) {
+ return;
+ }
+ node.open = true;
+ var childNodesData:Array = XMLCollection(this.dataProvider).getOpenChildNodes(node)
+ XMLCollection(this.dataProvider).addItems(childNodesData, node);
+ }
+
+ public function getNodeByLabel(str:String):XMLNodeDescriptor{
+ var normalizedArray:Array = _dataProvider.normalizedArray
+ for(var i:int=0; i> updateDl")
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/ButtonEvent.as b/src/org/openPyro/controls/events/ButtonEvent.as
new file mode 100644
index 0000000..2575d23
--- /dev/null
+++ b/src/org/openPyro/controls/events/ButtonEvent.as
@@ -0,0 +1,16 @@
+package org.openPyro.controls.events
+{
+ import flash.events.Event;
+
+ public class ButtonEvent extends Event
+ {
+ public static const UP:String = "up";
+ public static const OVER:String = "over";
+ public static const DOWN:String = "down";
+
+ public function ButtonEvent(type:String)
+ {
+ super(type)
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/DropDownEvent.as b/src/org/openPyro/controls/events/DropDownEvent.as
new file mode 100644
index 0000000..161826e
--- /dev/null
+++ b/src/org/openPyro/controls/events/DropDownEvent.as
@@ -0,0 +1,15 @@
+package org.openPyro.controls.events
+{
+ import flash.events.Event;
+
+ public class DropDownEvent extends Event
+ {
+ public static const OPEN:String = "open";
+ public static const CLOSE:String = "close";
+
+ public function DropDownEvent(type:String)
+ {
+ super(type);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/ListEvent.as b/src/org/openPyro/controls/events/ListEvent.as
new file mode 100644
index 0000000..e246b14
--- /dev/null
+++ b/src/org/openPyro/controls/events/ListEvent.as
@@ -0,0 +1,23 @@
+package org.openPyro.controls.events
+{
+ import flash.events.Event;
+
+ public class ListEvent extends Event
+ {
+ public static const CHANGE:String = "change";
+ public static const ITEM_CLICK:String = "itemClick";
+
+ public function ListEvent(type:String)
+ {
+ super(type)
+ }
+
+ override public function clone():Event
+ {
+ var listEvent:ListEvent = new ListEvent(this.type)
+ return listEvent;
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/ScrollEvent.as b/src/org/openPyro/controls/events/ScrollEvent.as
new file mode 100644
index 0000000..38d1f78
--- /dev/null
+++ b/src/org/openPyro/controls/events/ScrollEvent.as
@@ -0,0 +1,20 @@
+package org.openPyro.controls.events
+{
+ import flash.events.Event;
+
+ public class ScrollEvent extends Event
+ {
+
+ public static const SCROLL:String = "scroll";
+ public static const CHANGE:String = "change";
+
+ public var direction:String;
+ public var delta:Number;
+ public var value:Number;
+
+ public function ScrollEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/SliderEvent.as b/src/org/openPyro/controls/events/SliderEvent.as
new file mode 100644
index 0000000..dec92a6
--- /dev/null
+++ b/src/org/openPyro/controls/events/SliderEvent.as
@@ -0,0 +1,18 @@
+package org.openPyro.controls.events
+{
+ import flash.events.Event;
+
+ public class SliderEvent extends Event
+ {
+ public static const CHANGE:String = "change";
+ public static const THUMB_PRESS:String = "thumbPress";
+ public static const THUMB_DRAG:String = "thumbDrag";
+ public static const THUMB_RELEASE:String = "thumbRelease";
+
+ public function SliderEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/events/TreeEvent.as b/src/org/openPyro/controls/events/TreeEvent.as
new file mode 100644
index 0000000..6ed63f1
--- /dev/null
+++ b/src/org/openPyro/controls/events/TreeEvent.as
@@ -0,0 +1,17 @@
+package org.openPyro.controls.events
+{
+ import org.openPyro.collections.XMLNodeDescriptor;
+
+ public class TreeEvent extends ListEvent
+ {
+ public static const ROTATOR_CLICK:String = "rotatorClick";
+
+ public var nodeDescriptor:XMLNodeDescriptor;
+
+ public function TreeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/listClasses/BaseListData.as b/src/org/openPyro/controls/listClasses/BaseListData.as
new file mode 100644
index 0000000..f122bfe
--- /dev/null
+++ b/src/org/openPyro/controls/listClasses/BaseListData.as
@@ -0,0 +1,16 @@
+package org.openPyro.controls.listClasses
+{
+ import org.openPyro.controls.List;
+
+
+ public class BaseListData
+ {
+ public var list:List
+ public var rowIndex:int;
+
+ public function BaseListData()
+ {
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/listClasses/DefaultListRenderer.as b/src/org/openPyro/controls/listClasses/DefaultListRenderer.as
new file mode 100644
index 0000000..fb1c3b4
--- /dev/null
+++ b/src/org/openPyro/controls/listClasses/DefaultListRenderer.as
@@ -0,0 +1,131 @@
+package org.openPyro.controls.listClasses
+{
+ import org.openPyro.core.UIControl;
+ import org.openPyro.painters.FillPainter;
+ import org.openPyro.painters.IPainter;
+
+ import flash.events.MouseEvent;
+ import flash.text.TextField;
+ import flash.text.TextFormat;
+
+ public class DefaultListRenderer extends UIControl implements IListDataRenderer
+ {
+
+ protected var _labelField:TextField;
+
+ protected var _rollOverBackgroundPainter:IPainter;
+ protected var _rollOutBackgroundPainter:IPainter;
+
+ public function DefaultListRenderer() {
+ super();
+ }
+
+ override protected function createChildren():void
+ {
+ super.createChildren();
+ this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler)
+ this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler)
+ _labelField = new TextField()
+ _labelField.selectable=false;
+
+ if(!_labelFormat){
+ _labelField.defaultTextFormat= new TextFormat("Arial",12)
+ }
+ else{
+ _labelField.defaultTextFormat = _labelFormat;
+ }
+ addChild(_labelField);
+ if(_data && _baseListData && _baseListData.list){
+ _labelField.text = _baseListData.list.labelFunction(_data);
+ }
+
+ if(!_rollOverBackgroundPainter){
+ _rollOverBackgroundPainter = new FillPainter(0x559DE6)
+ }
+ if(!_rollOutBackgroundPainter){
+ _rollOutBackgroundPainter = new FillPainter(0xffffff)
+ }
+ this.backgroundPainter = this._rollOutBackgroundPainter
+ }
+
+ protected var _baseListData:BaseListData;
+ public function set baseListData(value:BaseListData):void{
+ _baseListData = value
+ }
+ public function set rollOutBackgroundPainter(painter:IPainter):void
+ {
+ this._rollOutBackgroundPainter = painter;
+ }
+
+ public function set rollOverBackgroundPainter(painter:IPainter):void
+ {
+ this._rollOverBackgroundPainter = painter;
+ }
+
+ protected var _labelFormat:TextFormat;
+ public function set labelFormat(format:TextFormat):void
+ {
+ _labelFormat = format;
+ if(_labelField){
+ _labelField.defaultTextFormat = format;
+ }
+ }
+
+ public function get labelFormat():TextFormat{
+ return _labelFormat;
+ }
+
+ protected function mouseOverHandler(event:MouseEvent):void
+ {
+ this.backgroundPainter = _rollOverBackgroundPainter;
+ }
+
+ protected function mouseOutHandler(event:MouseEvent):void
+ {
+ if(!_selected){
+ this.backgroundPainter = _rollOutBackgroundPainter;
+ }
+ }
+
+ protected var _data:*;
+
+ public function set data(value:Object):void{
+ _data = value;
+ _labelField.text = _baseListData.list.labelFunction(_data);
+ }
+
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ private var _selected:Boolean = false;
+ public function set selected(b:Boolean):void
+ {
+ _selected = b;
+ if(_selected){
+ this.backgroundPainter = _rollOverBackgroundPainter;
+ }
+ else{
+ this.backgroundPainter = _rollOutBackgroundPainter;
+ }
+ invalidateDisplayList();
+
+ }
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ _labelField.x = _labelField.y = 5;
+ _labelField.width = unscaledWidth-10
+ _labelField.height = Math.max(unscaledHeight-10,20);
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/listClasses/IListDataRenderer.as b/src/org/openPyro/controls/listClasses/IListDataRenderer.as
new file mode 100644
index 0000000..c88a555
--- /dev/null
+++ b/src/org/openPyro/controls/listClasses/IListDataRenderer.as
@@ -0,0 +1,13 @@
+package org.openPyro.controls.listClasses
+{
+ import org.openPyro.controls.List;
+ import org.openPyro.core.IDataRenderer;
+
+ public interface IListDataRenderer extends IDataRenderer
+ {
+ function set baseListData(data:BaseListData):void;
+ function set selected(b:Boolean):void;
+ function get selected():Boolean;
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/scrollBarClasses/HScrollBarLayout.as b/src/org/openPyro/controls/scrollBarClasses/HScrollBarLayout.as
new file mode 100644
index 0000000..1b8477a
--- /dev/null
+++ b/src/org/openPyro/controls/scrollBarClasses/HScrollBarLayout.as
@@ -0,0 +1,77 @@
+package org.openPyro.controls.scrollBarClasses
+{
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.layout.ILayout;
+
+ public class HScrollBarLayout implements ILayout
+ {
+ protected var _scrollBar:ScrollBar;
+
+ public function HScrollBarLayout() {
+
+ }
+
+ public function set container(container:UIContainer):void
+ {
+ _scrollBar = ScrollBar(container);
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ return _scrollBar.width;
+ }
+
+ public function getMaxHeight(children:Array):Number
+ {
+ return _scrollBar.height;
+ }
+
+ public function layout(children:Array):void
+ {
+ var allocatedWidth:Number = 0;
+ if(_scrollBar.decrementButton)
+ {
+ _scrollBar.decrementButton.x =0;
+ allocatedWidth+=_scrollBar.decrementButton.width;
+ }
+ if(_scrollBar.incrementButton)
+ {
+ _scrollBar.incrementButton.x = _scrollBar.width-_scrollBar.decrementButton.width;
+ allocatedWidth+=_scrollBar.incrementButton.width;
+ }
+ if(_scrollBar.slider && _scrollBar.decrementButton)
+ {
+ _scrollBar.slider.x = _scrollBar.decrementButton.width;
+
+ _scrollBar.slider.width = _scrollBar.width-allocatedWidth;
+ }
+
+ // Immediately validate the size and displaylist of the slider
+ // else we get a lag (flicker) in the drawing.
+ if(_scrollBar.slider && _scrollBar.slider is MeasurableControl)
+ {
+ _scrollBar.slider.validateSize();
+ _scrollBar.slider.validateDisplayList();
+ }
+
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ public function set initX(n:Number):void
+ {
+
+ }
+
+ public function set initY(n:Number):void
+ {
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/scrollBarClasses/VScrollBarLayout.as b/src/org/openPyro/controls/scrollBarClasses/VScrollBarLayout.as
new file mode 100644
index 0000000..0f09f9a
--- /dev/null
+++ b/src/org/openPyro/controls/scrollBarClasses/VScrollBarLayout.as
@@ -0,0 +1,79 @@
+package org.openPyro.controls.scrollBarClasses
+{
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.layout.ILayout;
+
+ import flash.display.DisplayObject;
+
+ public class VScrollBarLayout implements ILayout
+ {
+ protected var _scrollBar:ScrollBar;
+
+ public function VScrollBarLayout() {
+
+ }
+
+ public function set container(container:UIContainer):void
+ {
+ _scrollBar = ScrollBar(container);
+ }
+
+
+ public function getMaxWidth(children:Array):Number
+ {
+ return _scrollBar.width;
+ }
+
+ public function getMaxHeight(children:Array):Number
+ {
+ return _scrollBar.height;
+ }
+
+ public function layout(children:Array):void
+ {
+ var allocatedHeight:Number = 0;
+ if(_scrollBar.decrementButton)
+ {
+ _scrollBar.decrementButton.y =0;
+ allocatedHeight+=_scrollBar.decrementButton.height;
+ }
+ if(_scrollBar.incrementButton)
+ {
+ _scrollBar.incrementButton.y = _scrollBar.height-_scrollBar.incrementButton.height;
+ allocatedHeight+=_scrollBar.incrementButton.height;
+ }
+ if(_scrollBar.slider && _scrollBar.decrementButton)
+ {
+ _scrollBar.slider.y = _scrollBar.decrementButton.height;
+
+ _scrollBar.slider.height = _scrollBar.height-allocatedHeight;
+ }
+
+ // Immediately validate the size and displaylist of the slider
+ // else we get a lag (flicker) in the drawing.
+ if(_scrollBar.slider && _scrollBar.slider is MeasurableControl)
+ {
+ _scrollBar.slider.validateSize();
+ _scrollBar.slider.validateDisplayList();
+ }
+ }
+
+ public function set initX(n:Number):void
+ {
+
+ }
+
+ public function set initY(n:Number):void
+ {
+
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/skins/IComboBoxSkin.as b/src/org/openPyro/controls/skins/IComboBoxSkin.as
new file mode 100644
index 0000000..89c54f4
--- /dev/null
+++ b/src/org/openPyro/controls/skins/IComboBoxSkin.as
@@ -0,0 +1,10 @@
+package org.openPyro.controls.skins
+{
+ import org.openPyro.skins.ISkin;
+
+ public interface IComboBoxSkin extends ISkin
+ {
+ function get buttonSkin():ISkin;
+ function get listSkin():ISkin;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/skins/IDividedBoxSkin.as b/src/org/openPyro/controls/skins/IDividedBoxSkin.as
new file mode 100644
index 0000000..83057f7
--- /dev/null
+++ b/src/org/openPyro/controls/skins/IDividedBoxSkin.as
@@ -0,0 +1,9 @@
+package org.openPyro.controls.skins
+{
+ import org.openPyro.core.UIControl;
+
+ public interface IDividedBoxSkin
+ {
+ function getNewDividerSkin():UIControl;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/skins/IScrollBarSkin.as b/src/org/openPyro/controls/skins/IScrollBarSkin.as
new file mode 100644
index 0000000..d9d6ce4
--- /dev/null
+++ b/src/org/openPyro/controls/skins/IScrollBarSkin.as
@@ -0,0 +1,12 @@
+package org.openPyro.controls.skins
+{
+ import org.openPyro.skins.ISkin;
+
+ public interface IScrollBarSkin extends ISkin
+ {
+ function get incrementButtonSkin():ISkin;
+ function get decrementButtonSkin():ISkin;
+ function get sliderSkin():ISliderSkin;
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/skins/IScrollableContainerSkin.as b/src/org/openPyro/controls/skins/IScrollableContainerSkin.as
new file mode 100644
index 0000000..6a4b92c
--- /dev/null
+++ b/src/org/openPyro/controls/skins/IScrollableContainerSkin.as
@@ -0,0 +1,10 @@
+package org.openPyro.controls.skins
+{
+ import org.openPyro.skins.ISkin;
+
+ public interface IScrollableContainerSkin extends ISkin
+ {
+ function get verticalScrollBarSkin():IScrollBarSkin;
+ function get horizontalScrollBarSkin():IScrollBarSkin;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/skins/ISliderSkin.as b/src/org/openPyro/controls/skins/ISliderSkin.as
new file mode 100644
index 0000000..678a1da
--- /dev/null
+++ b/src/org/openPyro/controls/skins/ISliderSkin.as
@@ -0,0 +1,10 @@
+package org.openPyro.controls.skins
+{
+ import org.openPyro.skins.ISkin;
+
+ public interface ISliderSkin extends ISkin
+ {
+ function get trackSkin():ISkin;
+ function get thumbSkin():ISkin;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/controls/treeClasses/DefaultTreeItemRenderer.as b/src/org/openPyro/controls/treeClasses/DefaultTreeItemRenderer.as
new file mode 100644
index 0000000..28f9dc4
--- /dev/null
+++ b/src/org/openPyro/controls/treeClasses/DefaultTreeItemRenderer.as
@@ -0,0 +1,156 @@
+package org.openPyro.controls.treeClasses
+{
+ import org.openPyro.collections.XMLNodeDescriptor;
+ import org.openPyro.controls.events.TreeEvent;
+ import org.openPyro.controls.listClasses.DefaultListRenderer;
+ import org.openPyro.layout.HLayout;
+ import org.openPyro.painters.TrianglePainter;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.IEventDispatcher;
+ import flash.events.MouseEvent;
+
+ [Event(name="rotatorClick", type="org.openPyro.controls.events.TreeEvent")]
+
+ public class DefaultTreeItemRenderer extends DefaultListRenderer
+ {
+
+ [Embed(source="../../../../assets/folder.png")]
+ protected var folderIconClass:Class
+
+ public function DefaultTreeItemRenderer()
+ {
+ super();
+ }
+
+ private var folderIcon:DisplayObject;
+ private var leafIcon:DisplayObject;
+ private var rotator:Sprite;
+ private var arrow:Sprite;
+
+ override protected function createChildren():void{
+ super.createChildren()
+ }
+
+ override public function set data(value:Object):void{
+ if(_data && _data is IEventDispatcher){
+ IEventDispatcher(_data).removeEventListener(XMLNodeDescriptor.BRANCH_VISIBILITY_CHANGED, setRotatorDirection);
+ }
+ super.data = value;
+
+ if(_data is IEventDispatcher){
+ IEventDispatcher(_data).addEventListener(XMLNodeDescriptor.BRANCH_VISIBILITY_CHANGED, setRotatorDirection);
+ }
+
+ if(!XMLNodeDescriptor(value).isLeaf()){
+ if(!folderIcon){
+ folderIcon = new folderIconClass();
+ }
+ if(!folderIcon.parent){
+ addChild(folderIcon);
+ }
+ if(!rotator){
+ rotator = new Sprite();
+ rotator.graphics.beginFill(0x000000,0)
+ rotator.graphics.drawRect(0,0, 20,20);
+ rotator.graphics.endFill()
+
+
+ arrow = new Sprite();
+
+ var trianglePainter:TrianglePainter = new TrianglePainter(TrianglePainter.CENTERED);
+ trianglePainter.draw(arrow.graphics, 8,8)
+ //rotator.addChild(arrow)
+ addChild(arrow)
+ arrow.cacheAsBitmap = true;
+
+ rotator.buttonMode = true;
+ rotator.useHandCursor = true
+
+ rotator.addEventListener(MouseEvent.CLICK, onRotatorClick)//,true,1,true)
+ rotator.mouseChildren=false;
+ }
+ if(!rotator.parent){
+ addChild(rotator);
+ }
+ }
+ else{
+ if(folderIcon && folderIcon.parent){
+ removeChild(folderIcon);
+ folderIcon = null;
+ }
+ if(rotator && rotator.parent){
+ removeChild(rotator);
+ rotator = null
+ }
+ if(arrow && arrow.parent){
+ removeChild(arrow);
+ arrow = null
+ }
+
+
+ }
+ this.forceInvalidateDisplayList=true
+ this.invalidateDisplayList()
+ }
+
+ private function onRotatorClick(event:MouseEvent):void{
+ event.stopImmediatePropagation()
+ event.preventDefault();
+ var treeEvent:TreeEvent = new TreeEvent(TreeEvent.ROTATOR_CLICK);
+ treeEvent.nodeDescriptor = XMLNodeDescriptor(_data);
+ dispatchEvent(treeEvent);
+ }
+
+ private function setRotatorDirection(event:Event=null):void{
+
+ if(!rotator || !rotator.parent) return;
+ if(XMLNodeDescriptor(_data).open){
+ arrow.rotation = 90
+ }
+ else{
+ arrow.rotation = 0
+ }
+ }
+
+ private var rendererLayout:HLayout = new HLayout(5)
+
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(rotator && rotator.parent){
+ rotator.y = (unscaledHeight-rotator.height)/2
+ }
+
+ setRotatorDirection()
+
+ rendererLayout.initX = XMLNodeDescriptor(_data).depth*15+10
+ rendererLayout.initY = 5;
+ var children:Array = []
+ if(rotator && rotator.parent){
+ children.push(rotator)
+ }
+ else{
+ rendererLayout.initX+=10;
+ }
+ if(folderIcon && folderIcon.parent){
+ children.push(folderIcon)
+ }
+ else{
+ rendererLayout.initX+=10
+ }
+ children.push(_labelField);
+
+ if(arrow){
+ arrow.x = rotator.x+ (rotator.width - arrow.width)/2+arrow.width/2
+ arrow.y = rotator.y+ (rotator.height - arrow.height)/2+arrow.height/2;
+
+ }
+
+
+ rendererLayout.layout(children);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/ClassFactory.as b/src/org/openPyro/core/ClassFactory.as
new file mode 100644
index 0000000..d1d9690
--- /dev/null
+++ b/src/org/openPyro/core/ClassFactory.as
@@ -0,0 +1,73 @@
+package org.openPyro.core
+{
+
+ /**
+ * A ClassFactory instance is a "factory object" which can be used
+ * to generate instances of another class, each with identical properties.
+ *
+ */
+
+ public class ClassFactory
+ {
+
+ /**
+ * The Class that the newInstance() method uses
+ * to generate objects from this factory object.
+ */
+ public var generator:Class;
+
+ /**
+ * An Object whose name/value pairs specify the properties to be set
+ * on each object generated by the newInstance() method.
+ *
+ *
For example, if you set properties to
+ * { text: "Hello", width: 100 }, then every instance
+ * of the generator class that is generated by calling
+ * newInstance() will have its text set to
+ * "Hello" and its width set to
+ * 100.
+ *
+ * @default null
+ */
+ public var properties:Object = null;
+
+ /**
+ * Constructor.
+ *
+ * @param generator The Class that the newInstance() method uses
+ * to generate objects from this factory object.
+ */
+ public function ClassFactory(generator:Class = null)
+ {
+ super();
+
+ this.generator = generator;
+
+ }
+
+ /**
+ * Creates a new instance of the generator class,
+ * with the properties specified by properties.
+ *
+ *
This method implements the newInstance() method
+ * of the IFactory interface.
+ *
+ * @return The new instance that was created.
+ */
+ public function newInstance():*
+ {
+ var instance:Object = new generator();
+
+ if (properties != null)
+ {
+ for (var p:String in properties)
+ {
+ instance[p] = properties[p];
+ }
+ }
+
+ return instance;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/Direction.as b/src/org/openPyro/core/Direction.as
new file mode 100644
index 0000000..129105c
--- /dev/null
+++ b/src/org/openPyro/core/Direction.as
@@ -0,0 +1,13 @@
+package org.openPyro.core
+{
+ public class Direction
+ {
+ public static const VERTICAL:String = "vertical";
+ public static const HORIZONTAL:String = "horizontal";
+ public static const UP:String = "up";
+ public static const DOWN:String = "down";
+ public static const LEFT:String = "left";
+ public static const RIGHT:String = "right";
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/IDataRenderer.as b/src/org/openPyro/core/IDataRenderer.as
new file mode 100644
index 0000000..39a105f
--- /dev/null
+++ b/src/org/openPyro/core/IDataRenderer.as
@@ -0,0 +1,8 @@
+package org.openPyro.core
+{
+ public interface IDataRenderer
+ {
+ function set data(d:Object):void;
+ function get data():Object;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/ISerializable.as b/src/org/openPyro/core/ISerializable.as
new file mode 100644
index 0000000..dc25d13
--- /dev/null
+++ b/src/org/openPyro/core/ISerializable.as
@@ -0,0 +1,17 @@
+package org.openPyro.core{
+
+ public interface ISerializable{
+
+ /**
+ * Called by any component requiring the
+ * serialized (string) form of the Object
+ */
+ function serialize():String;
+
+ /**
+ * Probably not called by any external class
+ * but encapsulates the string to Object mapping
+ */
+ function deserialize(str:String):void;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/IStateFulClient.as b/src/org/openPyro/core/IStateFulClient.as
new file mode 100644
index 0000000..f6a15a5
--- /dev/null
+++ b/src/org/openPyro/core/IStateFulClient.as
@@ -0,0 +1,7 @@
+package org.openPyro.core
+{
+ public interface IStateFulClient
+ {
+ function changeState(fromState:String, toState:String):void;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/MeasurableControl.as b/src/org/openPyro/core/MeasurableControl.as
new file mode 100644
index 0000000..f7e85ad
--- /dev/null
+++ b/src/org/openPyro/core/MeasurableControl.as
@@ -0,0 +1,812 @@
+package org.openPyro.core{
+ import org.openPyro.events.PyroEvent;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+
+ [Event(name="preInitialize", type="org.openPyro.events.PyroEvent")]
+ [Event(name="initialize", type="org.openPyro.events.PyroEvent")]
+ [Event(name="sizeInvalidated", type="org.openPyro.events.PyroEvent")]
+ [Event(name="sizeValidated", type="org.openPyro.events.PyroEvent")]
+ [Event(name="sizeChanged", type="org.openPyro.events.PyroEvent")]
+ [Event(name="updateComplete", type="org.openPyro.events.PyroEvent")]
+
+ [Event(name="propertyChange", type="org.openPyro.events.PyroEvent")]
+ [Event(name="resize", type="flash.events.Event")]
+
+
+ /**
+ * The Measurable control is the basic class that
+ * participates in Pyro's measurement strategy. Measurable controls understand
+ * a variety of properties like explicit height/width which is set if you set the
+ * width or height property with an actual neumerical value, or percentUnusedWidth
+ * and percentUnusedHeight which are set if the control's size is based on
+ * measurement of the parent control. Controls can also be sized using the
+ * percentWidth or percentHeight which is based on the parent's size without taking
+ * the other children in the parent under consideration.
+ *
+ * Note: As of right now percentWidth and percentHeight may not be respected
+ * by certain containers like DividedBoxes
+ */
+ public class MeasurableControl extends Sprite{
+
+ public function MeasurableControl(){
+ this.addEventListener(Event.ADDED, onAddedToParent);
+ super.visible = false;
+ }
+
+ /**
+ * The event listener executed when this component
+ * has been added to the parent.
+ */
+ protected function onAddedToParent(event:Event):void{
+ if(!this.parent) return;
+ this.removeEventListener(Event.ADDED, onAddedToParent);
+ this.addEventListener(Event.REMOVED, onRemovedFromParent,false,0,true);
+ this._parentContainer = this.parent as UIControl;
+ if(!_parentContainer)
+ {
+ doOnAdded();
+ }
+ }
+
+ /**
+ * Property indicates whether a control has been initialized
+ * or not. Initialization happens the first time the control
+ * is added to the parent.
+ */
+ public var initialized:Boolean = false;
+
+ /**
+ * This happens only once when a child is
+ * first added to any parent. Subsequent
+ * removeChild and addChild actions do not
+ * trigger this function but rather directly call
+ * validateSize.
+ */
+ public function initialize():void
+ {
+ dispatchEvent(new PyroEvent(PyroEvent.PREINITIALIZE))
+ createChildren();
+ dispatchEvent(new PyroEvent(PyroEvent.INITIALIZE));
+ initialized = true;
+ this.validateSize();
+ }
+
+ /**
+ * This is where the new children should
+ * be created and then added to the displaylist.
+ * Similar to Flex's createChildren() method.
+ */
+ protected function createChildren():void{}
+
+ protected var _explicitWidth:Number = NaN;
+ protected var _explicitHeight:Number = NaN;
+
+ /**
+ * The width set in terms of actual pixels.
+ * You do not call this function in your code.
+ * Setting the width of the control to an actual
+ * numeric value (rather than percent) calls this
+ * function
+ * Call this function only if you want to set
+ * width without calling the invalidation methods
+ *
+ * [TODO] This class should
+ * have namespace access control (pyro_internal)
+ */
+ public function set explicitWidth(w:Number):void{
+ _explicitWidth = w;
+ }
+
+ /** The height set in terms of actual pixels.
+ * You do not call this function in your code.
+ * Setting the width of the control to an actual
+ * numeric value (rather than percent) calls this
+ * function
+ * Call this function only if you want to set
+ * width without calling the invalidation methods
+ *
+ * [TODO] This class should
+ * have namespace access control (pyro_internal)
+ */
+ public function get explicitWidth():Number{
+ return _explicitWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitHeight(h:Number):void{
+ _explicitHeight = h;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitHeight():Number{
+ return this._explicitHeight;
+ }
+
+ /**
+ * Set/get the width of the control. If the width
+ * is set to a different value from the one the
+ * control is already at, it triggers the size
+ * invalidation cycle
+ */
+ override public function set width(n:Number):void{
+ if(n == _explicitWidth) return
+ this._explicitWidth = n
+ _dimensionsChanged = true;
+ displayListInvalidated = true;
+ if(!initialized) return;
+ invalidateSize();
+ }
+
+ /**
+ * @private
+ */
+ override public function get width():Number{
+ return this.getExplicitOrMeasuredWidth()
+ }
+
+ /**
+ * Set/get the height of the control. If the height
+ * is set to a different value from the one the
+ * control is already at, it triggers the size
+ * invalidation cycle
+ */
+ override public function set height(n:Number):void{
+ if (n == _explicitHeight) return;
+ this._explicitHeight = n
+ displayListInvalidated = true;
+ _dimensionsChanged=true;
+ if(!initialized) return;
+ invalidateSize();
+ //invalidateDisplayList();
+ }
+
+ /**
+ * @private
+ */
+ override public function get height():Number{
+ return this.getExplicitOrMeasuredHeight();
+ }
+
+ protected var _maximumWidth:Number = NaN;
+ public function set maximumWidth(n:Number):void{
+ _maximumWidth = n;
+ invalidateSize();
+ }
+
+ public function get maximumWidth():Number{
+ return _maximumWidth;
+ }
+
+ protected var _maximumHeight:Number = NaN;
+ public function set maximumHeight(n:Number):void{
+ _maximumHeight = n;
+ invalidateSize();
+ }
+
+ public function get maximumHeight():Number{
+ return _maximumHeight;
+ }
+
+
+ protected var _percentUnusedWidth:Number;
+ protected var _percentUnusedHeight:Number;
+
+ /**
+ * Only setting percent width/heights changes the
+ * needsMeasurement flag which makes its parent
+ * container call measure on it.
+ * If width and height are set directly, measurement
+ * is never called (although size invalidation
+ * still does if size has changed)
+ */
+ public var needsMeasurement:Boolean=true;
+
+ /**
+ * Set/get the percent width. If the value is
+ * different from the earlier, it sets the measurement
+ * flag and calls invalidateSize
+ */
+ public function set percentUnusedWidth(w:Number):void{
+ if(w == _percentUnusedWidth) return
+ _percentUnusedWidth = w;
+ if(!initialized) return;
+ invalidateSize()
+ }
+
+ /**
+ * @private
+ */
+ public function get percentUnusedWidth():Number{
+ return _percentUnusedWidth;
+ }
+
+ /**
+ * Set/get the percent height. If the value is
+ * different from the earlier, it sets the measurement
+ * flag and calls invalidateSize
+ */
+ public function set percentUnusedHeight(h:Number):void{
+ if(h==_percentUnusedHeight) return;
+ //needsMeasurement = true;
+ _percentUnusedHeight = h;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ protected var _percentWidth:Number
+ public function set percentWidth(w:Number):void
+ {
+ if(w==_percentWidth) return;
+ _percentWidth = w;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ public function get percentWidth():Number
+ {
+ return _percentWidth
+ }
+
+ protected var _percentHeight:Number
+ public function set percentHeight(h:Number):void
+ {
+ if(h==_percentHeight) return;
+ _percentHeight = h;
+ if(!initialized) return;
+ this.invalidateSize()
+ }
+
+ public function get percentHeight():Number
+ {
+ return _percentHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function get percentUnusedHeight():Number{
+ return _percentUnusedHeight;
+ }
+
+ protected var _parentContainer:UIControl;
+
+ public function set parentContainer(c:UIControl):void{
+ this._parentContainer = c;
+ }
+
+ public function get parentContainer():UIControl
+ {
+ return _parentContainer;
+ }
+
+ /**
+ * The flag to mark that the control's size
+ * has been invalidated. This means the control
+ * is now waiting for a validateSize call.
+ */
+ public var sizeInvalidated:Boolean=false;
+
+ /**
+ * Marks itself dirty and waits till either the container
+ * to validateSize or validates itself at the next enterframe
+ * if it has no parent container.
+ *
+ * This method is overridden by UIControl. The code here
+ * will only be useful for a Spacer type of component.
+ */
+ public function invalidateSize(event:PyroEvent=null):void{
+ if(sizeInvalidated) return;
+ sizeInvalidated=true;
+ dispatchEvent(new PyroEvent(PyroEvent.SIZE_INVALIDATED));
+ if(!this._parentContainer){
+ /*
+ * If this is not contained in a OpenPyro control,
+ * take the responsibility for validating the
+ * displaylist
+ */
+ this.addEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
+ }
+
+ }
+
+ /**
+ * doQueueValidateSize is executed by the top level UIControl.
+ */
+ protected function doQueuedValidateSize(event:Event):void
+ {
+ this.removeEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
+ this.validateSize();
+ }
+
+ /**
+ * This property defines whether measure() will be called during
+ * validateSize() or not.
+ */
+ public function get usesMeasurementStrategy():Boolean{
+ if(isNaN(this._explicitHeight) || isNaN(this._explicitWidth)){
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ /**
+ * The validateSize function is called in response to
+ * a component declaring its size invalid (usually
+ * by calling invalidateSize()). The job of this
+ * method is to compute the final width and height
+ * (whether by calling measure if an explicit w/h
+ * is not declared or not if an explicit w & h is
+ * declared)
+ *
+ * @see invalidateSize()
+ * @see measure()
+ * @see usesMeasurementStrategy
+ */
+ public function validateSize():void{
+ if(usesMeasurementStrategy){
+ measure();
+ checkDisplayListValidation()
+ sizeInvalidated=false;
+ }
+ else{
+ sizeInvalidated=false;
+ if(displayListInvalidated){
+ queueValidateDisplayList();
+ }
+ }
+ for(var j:uint=0; jmeasure function.
+ *
+ */
+ public function getExplicitOrMeasuredWidth():Number{
+ if(!isNaN(this._explicitWidth)){
+ return _explicitWidth
+ }
+ else{
+ return _measuredWidth
+ }
+ }
+
+ /**
+ * Returns the explicitly defined height or the measured
+ * height computed by the measure function.
+ */
+ public function getExplicitOrMeasuredHeight():Number{
+ if(!isNaN(this._explicitHeight)){
+ return _explicitHeight
+ }
+ else{
+ return _measuredHeight
+ }
+ }
+
+ private function onRemovedFromParent(event:Event):void{
+ this.addEventListener(Event.ADDED, onAddedToParent);
+ }
+
+
+ ///////// Utils ///////////
+
+ public function cancelMouseEvents():void{
+ this.addEventListener(MouseEvent.MOUSE_OVER, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_DOWN, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_OUT, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.MOUSE_MOVE, disableEvent, true, 1,true);
+ //this.addEventListener(MouseEvent.MOUSE_UP, disableEvent, true, 1,true);
+ this.addEventListener(MouseEvent.CLICK, disableEvent, true, 1,true);
+ _mouseActionsDisabled = true
+
+ }
+
+ public function enableMouseEvents():void{
+ //this.removeEventListener(MouseEvent.MOUSE_UP, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_OVER, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_DOWN, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_OUT, disableEvent,true);
+ this.removeEventListener(MouseEvent.CLICK, disableEvent,true);
+ this.removeEventListener(MouseEvent.MOUSE_MOVE, disableEvent,true);
+ _mouseActionsDisabled = false;
+ }
+
+ protected function disableEvent(event:Event):void{
+ event.stopImmediatePropagation()
+ event.preventDefault()
+ }
+
+ protected var _mouseActionsDisabled:Boolean = false;
+ public function get mouseActionsDisabled():Boolean{
+ return _mouseActionsDisabled;
+ }
+
+ /**
+ * Utility function to check if a mouseEvent happened
+ * while the mouse was over the displayObject
+ */
+ public function isMouseOver(event:MouseEvent):Boolean{
+ if(event.localX < this.width && event.localX > 0 &&
+ event.localY < this.height && event.localY > 0){
+ return true
+ }
+ else{
+ return false
+ }
+ }
+
+
+ /**
+ * @private
+ * Since the addChild function is overridden in all MeasurableControls,
+ * this function is defined to keep the native implementation available
+ */
+ public final function $addChild(child:DisplayObject):DisplayObject
+ {
+ return super.addChild(child);
+ }
+
+ /**
+ * @private
+ * Since the addChild function is overridden in all MeasurableControls,
+ * this function is defined to keep the native implementation available
+ */
+ public final function $addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ return super.addChildAt(child,index);
+ }
+
+ private var _includeInLayout:Boolean = true
+
+ /**
+ * @private
+ */
+ public function set includeInLayout(value:Boolean):void{
+ _includeInLayout = value
+ }
+
+ /**
+ * Specifies whether this control participates in the
+ * layout system in OpenPyro. For example if you have 3
+ * UIControls sitting in a container with a
+ * HLayout layout, but the second control as the
+ * includeInLayout property set to false, the layout will
+ * not position that control.
+ */
+ public function get includeInLayout():Boolean{
+ return _includeInLayout;
+ }
+
+ /**
+ * @private
+ */
+ public final function get $width():Number
+ {
+ return super.width
+ }
+
+ /**
+ * @private
+ */
+ final public function set $width(w:Number):void
+ {
+ super.width = w;
+ }
+
+ /**
+ * @private
+ */
+ final public function get $height():Number
+ {
+ return super.height
+ }
+
+ /**
+ * @private
+ */
+ final public function set $height(h:Number):void
+ {
+ super.height = h;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/ObjectPool.as b/src/org/openPyro/core/ObjectPool.as
new file mode 100644
index 0000000..7f59dcf
--- /dev/null
+++ b/src/org/openPyro/core/ObjectPool.as
@@ -0,0 +1,43 @@
+package org.openPyro.core{
+
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.utils.ArrayUtil;
+
+ /**
+ * ObjectPools are used to reuse created objects
+ * rather than create new one every time one is needed.
+ */
+ public class ObjectPool{
+
+ private var availableObjects:Array;
+ private var populatedObjects:Array;
+ private var _classFactory:ClassFactory;
+
+ public function ObjectPool(classFactory:ClassFactory){
+ _classFactory = classFactory;
+ availableObjects = new Array();
+ populatedObjects = new Array();
+ }
+
+ public function getObject():Object{
+ var r:Object;
+ if(availableObjects.length > 0){
+ r = availableObjects.pop();
+ }
+ else{
+ r = _classFactory.newInstance();
+ }
+ populatedObjects.push(r);
+ return r;
+ }
+
+ public function hasReusableObject():Boolean{
+ return (availableObjects.length > 0);
+ }
+
+ public function returnToPool(r:Object):void{
+ ArrayUtil.removeItemAt(populatedObjects, populatedObjects.indexOf(r));
+ this.availableObjects.push(r);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/Padding.as b/src/org/openPyro/core/Padding.as
new file mode 100644
index 0000000..7ab5375
--- /dev/null
+++ b/src/org/openPyro/core/Padding.as
@@ -0,0 +1,45 @@
+package org.openPyro.core
+{
+ /**
+ * Defines a padding object that is used by different
+ * systems (like Painters) to define active areas in a
+ * control
+ */
+ public class Padding
+ {
+
+ private var _top:Number;
+ private var _right:Number;
+ private var _bottom:Number;
+ private var _left:Number;
+
+ public function Padding(top:Number=0, right:Number=0, bottom:Number=0, left:Number=0)
+ {
+ _top = top;
+ _right = right;
+ _bottom = bottom;
+ _left = left;
+ }
+
+ public function get top():Number
+ {
+ return _top;
+ }
+
+ public function get right():Number
+ {
+ return _right;
+ }
+
+ public function get left():Number
+ {
+ return _left;
+ }
+
+ public function get bottom():Number
+ {
+ return _bottom;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/UIContainer.as b/src/org/openPyro/core/UIContainer.as
new file mode 100644
index 0000000..a9ca260
--- /dev/null
+++ b/src/org/openPyro/core/UIContainer.as
@@ -0,0 +1,786 @@
+package org.openPyro.core{
+ import org.openPyro.controls.ScrollBar;
+ import org.openPyro.controls.events.ScrollEvent;
+ import org.openPyro.controls.skins.IScrollableContainerSkin;
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.layout.AbsoluteLayout;
+ import org.openPyro.layout.IContainerMeasurementHelper;
+ import org.openPyro.layout.ILayout;
+
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+
+ /**
+ * UIContainers extend UIControls and introduce
+ * the concept of scrolling and layouts. If the
+ * bounds of the children of a UIContainer, they
+ * get clipped by the mask layer on top.
+ *
+ * todo: Create UIContainer.clipContent = false/true function
+ *
+ * @see #layout
+ */
+ public class UIContainer extends UIControl{
+
+ protected var contentPane:UIControl;
+ protected var _horizontalScrollPolicy:Boolean = true
+ protected var _verticalScrollPolicy:Boolean = true;
+
+ public function UIContainer(){
+ super();
+ contentPane = new UIControl();
+ contentPane.name = "contentPane_"+this.name
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function initialize():void
+ {
+ /*
+ Since the first time the container is
+ validated, it may cause scrollbars to
+ be added immediately, the contentPane
+ is added before any of that so that
+ scrollbars are not placed under it
+ */
+ $addChild(contentPane);
+ this.addEventListener(MouseEvent.MOUSE_WHEEL, handleMouseWheel);
+
+ super.initialize();
+
+ contentPane.percentUnusedWidth = 100;
+ contentPane.percentUnusedHeight = 100;
+ contentPane.doOnAdded()
+
+ this.addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver, true)
+
+ }
+
+ public static var mouseOverDisabled:Boolean = false;
+
+ private function handleMouseOver(event:MouseEvent):void{
+ if(UIContainer.mouseOverDisabled){
+ event.stopImmediatePropagation()
+ event.preventDefault()
+ }
+ }
+
+ public function set horizontalScrollPolicy(b:Boolean):void{
+ _horizontalScrollPolicy = b;
+ }
+ public function get horizontalScrollPolicy():Boolean{
+ return _horizontalScrollPolicy
+ }
+
+ public function set verticalScrollPolicy(b:Boolean):void{
+ _verticalScrollPolicy = b;
+ }
+
+ public function get verticalScrollPolicy():Boolean{
+ return _verticalScrollPolicy;
+ }
+
+
+ override public function addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ var ch:DisplayObject = contentPane.addChild(child);
+ if(child is MeasurableControl)
+ {
+ var control:MeasurableControl = child as MeasurableControl;
+ control.parentContainer = this;
+ control.addEventListener(PyroEvent.SIZE_INVALIDATED, invalidateSize);
+ control.addEventListener(PyroEvent.SIZE_CHANGED, queueValidateDisplayList);
+ control.doOnAdded()
+ }
+ return ch;
+ }
+
+ override public function getChildByName(name:String):DisplayObject{
+ return contentPane.getChildByName(name);
+ }
+
+ override public function removeChild(child:DisplayObject):DisplayObject{
+ return contentPane.removeChild(child)
+ }
+
+ public function removeAllChildren():void{
+ while(this.contentPane.numChildren>0){
+ contentPane.removeChildAt(0);
+ }
+ }
+
+ override protected function doChildBasedValidation():void
+ {
+ var child:DisplayObject;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ super.measuredWidth = _layout.getMaxWidth(this.layoutChildren) + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ super.measuredHeight = _layout.getMaxHeight(this.layoutChildren) + _padding.top + _padding.bottom;
+ }
+ }
+
+
+ private var _explicitlyAllocatedWidth:Number = 0;
+ private var _explicitlyAllocatedHeight:Number = 0;
+
+ /**
+ * This property are modified by IContainerMeasurementHelpers.
+ * which most container layouts implement.
+ *
+ * @see org.openPyro.layout.IContainerMeasurementHelper
+ */
+ public function set explicitlyAllocatedWidth(w:Number):void
+ {
+ _explicitlyAllocatedWidth = w;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitlyAllocatedWidth():Number
+ {
+ return _explicitlyAllocatedWidth ;
+ }
+
+ /**
+ * This property are modified by IContainerMeasurementHelpers.
+ * which most container layouts implement.
+ *
+ * @see org.openPyro.layout.IContainerMeasurementHelper
+ */
+ public function set explicitlyAllocatedHeight(h:Number):void
+ {
+ _explicitlyAllocatedHeight = h;
+ }
+
+ /**
+ * @private
+ */
+ public function get explicitlyAllocatedHeight():Number
+ {
+ return _explicitlyAllocatedHeight;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * If validateSize is called on UIContainers, the container does
+ * a check at the end to see if the children layout requires a
+ * scroll and if the scrollbar needs to be created. If so, it
+ * creates the scrollbars and calls validateSize again.
+ */
+ override public function validateSize():void
+ {
+ _contentHeight = this._layout.getMaxHeight(this.layoutChildren);
+ _contentWidth = this._layout.getMaxWidth(this.layoutChildren);
+ _explicitlyAllocatedWidth = _padding.left+_padding.right
+ _explicitlyAllocatedHeight = _padding.top+_padding.bottom;
+ var layoutChildrenArray:Array = layoutChildren;
+
+ _layout.initX = this.padding.left;
+ _layout.initY = this.padding.top;
+
+ if(_layout is IContainerMeasurementHelper)
+ {
+ IContainerMeasurementHelper(_layout).calculateSizes(layoutChildrenArray, this)
+ }
+ super.validateSize();
+
+ if(this._verticalScrollBar && _verticalScrollBar.visible)
+ {
+ this.explicitlyAllocatedWidth-=_verticalScrollBar.width
+ _verticalScrollBar.setScrollProperty(this.scrollHeight, this._contentHeight);
+ }
+
+ if(this._horizontalScrollBar && _horizontalScrollBar.visible)
+ {
+ this.explicitlyAllocatedHeight-=_horizontalScrollBar.height
+ _horizontalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ if(_verticalScrollBar)
+ {
+ if(_horizontalScrollBar && _horizontalScrollBar.visible){
+ _verticalScrollBar.height = this.height - _horizontalScrollBar.height//setActualSize(_verticalScrollBar.width,this.height - _horizontalScrollBar.height);
+ }
+ else{
+ _verticalScrollBar.height = this.height
+ }
+ }
+ if(_horizontalScrollBar)
+ {
+ if(_verticalScrollBar && _verticalScrollBar.visible)
+ {
+ _horizontalScrollBar.width = this.width-_verticalScrollBar.width;
+ }
+ else{
+ _horizontalScrollBar.width = this.width;
+ }
+ }
+ checkRevalidation()
+ }
+
+ protected var _layout:ILayout = new AbsoluteLayout()
+ protected var layoutInvalidated:Boolean = true;
+ /**
+ * Containers can be assigned different layouts
+ * which control the positioning of the
+ * different controls.
+ *
+ * @see org.openPyro.layout
+ */
+ public function get layout():ILayout
+ {
+ return _layout;
+ }
+
+ /**
+ * @private
+ */
+ public function set layout(l:ILayout):void
+ {
+ if(_layout == l) return
+ layoutInvalidated = true;
+ _layout = l;
+ _layout.container = this;
+ if(!initialized) return;
+
+ this.invalidateSize()
+ }
+
+ /**
+ * Returns an Array of displayObjects whose positions
+ * are controlled by the ILayout object.
+ * These do not include, for example, the scrollbars.
+ *
+ * @see org.openPyro.layout
+ */
+ public function get layoutChildren():Array
+ {
+ var children:Array = new Array();
+ if(!contentPane) return children;
+ for(var i:uint=0; i this.height)
+ {
+ setVerticalScrollBar();
+ }
+ }
+
+ protected var scrollBarsChanged:Boolean = false;
+
+ protected function checkRevalidation():void
+ {
+ if(_horizontalScrollPolicy){
+ checkNeedsHScrollBar()
+ }
+ if(_verticalScrollPolicy)
+ {
+ checkNeedsVScrollBar()
+ }
+
+ if(needsHorizontalScrollBar &&
+ this._skin &&
+ this._skin is IScrollableContainerSkin &&
+ IScrollableContainerSkin(_skin).horizontalScrollBarSkin)
+ {
+ if(!_horizontalScrollBar)
+ {
+ createHScrollBar();
+ }
+ if(_horizontalScrollBar.visible==false)
+ {
+ _horizontalScrollBar.visible = true;
+ scrollBarsChanged = true;
+ }
+ }
+ else
+ {
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true)
+ {
+ _horizontalScrollBar.visible = false;
+ scrollBarsChanged = true;
+ }
+ }
+ if(needsVerticalScrollBar &&
+ this._skin &&
+ this._skin is IScrollableContainerSkin &&
+ IScrollableContainerSkin(_skin).verticalScrollBarSkin)
+ {
+ if(!_verticalScrollBar)
+ {
+ createVScrollBar();
+ }
+ if(_verticalScrollBar.visible == false)
+ {
+ _verticalScrollBar.visible = true;
+ scrollBarsChanged=true;
+ }
+ }
+ else
+ {
+ if(_verticalScrollBar && _verticalScrollBar.visible == true)
+ {
+ _verticalScrollBar.visible = false;
+ scrollBarsChanged = true;
+ }
+ }
+
+ if(scrollBarsChanged)
+ {
+ scrollBarsChanged = false;
+ dispatchEvent(new PyroEvent(PyroEvent.SCROLLBARS_CHANGED));
+ validateSize();
+ }
+ }
+
+ protected var _contentHeight:Number = 0;
+ protected var _contentWidth:Number = 0;
+
+ public function get contentHeight():Number{
+ return _contentHeight;
+ }
+ public function get contentWidth():Number{
+ return _contentWidth;
+ }
+
+
+ protected var needsVerticalScrollBar:Boolean = false;
+ protected var needsHorizontalScrollBar:Boolean = false;
+
+ protected function checkNeedsVScrollBar():void
+ {
+ //_contentHeight = this._layout.getMaxHeight(this.layoutChildren);
+ if(_contentHeight > this.height){
+ needsVerticalScrollBar = true
+ }
+ else{
+ needsVerticalScrollBar = false;
+ }
+ }
+ protected function checkNeedsHScrollBar():void
+ {
+ _contentWidth = this._layout.getMaxWidth(this.layoutChildren);
+ if(_contentWidth > this.width){
+ needsHorizontalScrollBar = true
+ }
+ else{
+ needsHorizontalScrollBar = false;
+ }
+ }
+
+ protected function createVScrollBar():void
+ {
+ _verticalScrollBar = new ScrollBar(Direction.VERTICAL);
+ _verticalScrollBar.maximum = 1;
+ _verticalScrollBar.minimum = 0;
+ _verticalScrollBar.incrementalScrollDelta = _verticalScrollIncrement;
+ _verticalScrollBar.name = "vscrollbar_"+this.name;
+ _verticalScrollBar.width = 15;
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = true;
+ })
+ _verticalScrollBar.addEventListener(PyroEvent.SIZE_VALIDATED, onVerticalScrollBarSizeValidated);
+ _verticalScrollBar.addEventListener(PyroEvent.UPDATE_COMPLETE, onVScrollBarUpdateComplete);
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+
+ _verticalScrollBar.skin = IScrollableContainerSkin(_skin).verticalScrollBarSkin;
+ _verticalScrollBar.addEventListener(ScrollEvent.SCROLL, onVerticalScroll)
+ _verticalScrollBar.doOnAdded()
+ _verticalScrollBar.visible = false;
+ $addChild(_verticalScrollBar);
+ _verticalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ }
+
+ protected function hideVScrollBar():void
+ {
+ if(_verticalScrollBar)
+ {
+ _verticalScrollBar.visible=false;
+ }
+ }
+
+ protected function createHScrollBar():void
+ {
+ _horizontalScrollBar = new ScrollBar(Direction.HORIZONTAL);
+ _horizontalScrollBar.maximum = 1
+ _horizontalScrollBar.minimum = 0
+ _horizontalScrollBar.incrementalScrollDelta = _horizontalScrollIncrement
+ _horizontalScrollBar.name = "hscrollbar_"+this.name;
+ _horizontalScrollBar.height = 15;
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = true;
+ })
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ _horizontalScrollBar.addEventListener(PyroEvent.SIZE_VALIDATED, onHorizontalScrollBarSizeValidated)
+ _horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, onHorizontalScroll);
+ _horizontalScrollBar.parentContainer = this;
+ _horizontalScrollBar.doOnAdded()
+ _horizontalScrollBar.skin = IScrollableContainerSkin(_skin).horizontalScrollBarSkin;
+ _horizontalScrollBar.visible = false;
+ $addChild(_horizontalScrollBar);
+ _horizontalScrollBar.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent):void{
+ mouseOverDisabled = false;
+ })
+ }
+
+ protected function onHorizontalScrollBarSizeValidated(event:PyroEvent):void
+ {
+ _horizontalScrollBar.removeEventListener(PyroEvent.SIZE_VALIDATED, onHorizontalScrollBarSizeValidated)
+ _horizontalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ protected function onVerticalScrollBarSizeValidated(event:PyroEvent):void
+ {
+ _verticalScrollBar.removeEventListener(PyroEvent.SIZE_VALIDATED, onVerticalScrollBarSizeValidated)
+ _verticalScrollBar.setScrollProperty(this.scrollWidth, contentWidth);
+ }
+
+ protected function hideHScrollBar():void
+ {
+ if(_horizontalScrollBar)
+ {
+ _horizontalScrollBar.visible=false;
+ }
+ }
+
+ protected function setVerticalScrollBar():void{
+ if(_verticalScrollBar.parent != this)
+ {
+ addChild(_verticalScrollBar);
+ }
+ _verticalScrollBar.height = this.height;
+ }
+
+ protected function handleMouseWheel(event:MouseEvent):void{
+ if(this.verticalScrollBar){
+ var scrollDelta:Number = verticalScrollBar.value - event.delta*.02;
+ scrollDelta = Math.min(scrollDelta, 1)
+ scrollDelta = Math.max(0, scrollDelta);
+ verticalScrollBar.value = scrollDelta;
+ }
+ }
+
+ public function set horizontalScrollPosition(value:Number):void{
+ if(!_horizontalScrollBar) return
+ if(value > 1){
+ throw new Error("UIContainer scrollpositions range from 0 to 1")
+ }
+ this._horizontalScrollBar.value = value;
+ }
+
+ public function get horizontalScrollPosition():Number{
+ return _horizontalScrollBar.value;
+ }
+
+ private var _horizontalScrollIncrement:Number = 25;
+ public function set horizontalScrollIncrement(n:Number):void{
+ _horizontalScrollIncrement = n;
+ if(_horizontalScrollBar){
+ _horizontalScrollBar.incrementalScrollDelta = n;
+ }
+ }
+
+ public function get horizontalScrollIncrement():Number{
+ return _horizontalScrollIncrement
+ }
+
+ private var _verticalScrollIncrement:Number = 25;
+ public function set verticalScrollIncrement(n:Number):void{
+ _verticalScrollIncrement = n;
+ if(_verticalScrollBar){
+ _verticalScrollBar.incrementalScrollDelta = n;
+ }
+ }
+
+ public function get verticalScrollIncrement():Number{
+ return _verticalScrollIncrement
+ }
+
+
+ /**
+ * Sets the scrollposition of the vertical scrollbar
+ * The valid values are between 0 and 1
+ */
+ public function set verticalScrollPosition(value:Number):void{
+ if(!_verticalScrollBar) return;
+ if(value > 1){
+ throw new Error("UIContainer scrollpositions range from 0 to 1")
+ }
+ this._verticalScrollBar.value = value;
+ }
+
+ public function get verticalScrollPosition():Number{
+ return _verticalScrollBar.value;
+ }
+
+ protected var scrollY:Number = 0;
+ protected var scrollX:Number = 0;
+
+ /**
+ * Event listener for when the vertical scrollbar is
+ * used.
+ */
+ protected function onVerticalScroll(event:ScrollEvent):void
+ {
+ var scrollAbleHeight:Number = this._contentHeight - this.height;
+ if(_horizontalScrollBar)
+ {
+ scrollAbleHeight+=_horizontalScrollBar.height;
+ }
+ scrollY = event.value*scrollAbleHeight
+ setContentMask()
+ }
+
+ /**
+ * Event listener for when the horizontal scrollbar is
+ * used.
+ */
+ protected function onHorizontalScroll(event:ScrollEvent):void
+ {
+ var scrollAbleWidth:Number = this.contentWidth - this.width;
+ if(_verticalScrollBar)
+ {
+ scrollAbleWidth+=_verticalScrollBar.width;
+ }
+ scrollX = event.value*scrollAbleWidth
+ setContentMask()
+ }
+
+ /**
+ * Unlike UIControls, UIContainers do not apply a skin directly on
+ * themselves but interpret the skin file and apply them to the
+ * different children. So updateDisplayList here does not call
+ * super.updateDisplayList()
+ *
+ * @inheritDoc
+ */
+ override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ if(layoutInvalidated)
+ {
+ doLayoutChildren()
+ }
+ if(_verticalScrollBar && _verticalScrollBar.visible==true)
+ {
+ _verticalScrollBar.x = this.width - _verticalScrollBar.width;
+ }
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true)
+ {
+ _horizontalScrollBar.y = this.height - _horizontalScrollBar.height;
+ }
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0,unscaledWidth, unscaledHeight);
+ this.setContentMask()
+ }
+ }
+
+
+ protected var _clipContent:Boolean = true;
+
+ public function set clipContent(b:Boolean):void
+ {
+ if(!b) this.scrollRect = null;
+ _clipContent = b;
+ }
+
+ public function get clipContent():Boolean
+ {
+ return _clipContent;
+ }
+
+ /**
+ * Lays out the layoutChildren based ILayout
+ * object.
+ *
+ * @see #layoutChildren
+ */
+ override public function doLayoutChildren():void
+ {
+ _layout.layout(this.layoutChildren);
+ layoutInvalidated = false;
+ }
+
+ /**
+ * Event listener for the vertical scrollbar's
+ * creation and validation event.
+ */
+ protected function onVScrollBarUpdateComplete(event:PyroEvent):void
+ {
+ if(_horizontalScrollBar){
+ _horizontalScrollBar.y = _verticalScrollBar.height;
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0, this.width, this.height);
+ this.setContentMask()
+ }
+ }
+ }
+
+ /**
+ * Event listener for the horizontal scrollbar's
+ * creation and validation event.
+ */
+ protected function onHScrollBarUpdateComplete(event:PyroEvent):void
+ {
+ if(_verticalScrollBar){
+ _verticalScrollBar.x = _horizontalScrollBar.width;
+ if(_clipContent){
+ //this.scrollRect = new Rectangle(0,0, this.width, this.height);
+ this.setContentMask()
+ }
+ }
+ }
+
+ protected function setContentMask():void{
+ var contentW:Number = width
+ var contentH:Number = height;
+
+ if(_verticalScrollBar && _verticalScrollBar.visible==true){
+ contentW-=_verticalScrollBar.width
+ }
+ if(_horizontalScrollBar && _horizontalScrollBar.visible==true){
+ contentH-=_horizontalScrollBar.height
+ }
+ if(_verticalScrollBar){
+
+ }
+ var rect:Rectangle = new Rectangle(scrollX,scrollY,contentW,contentH);
+
+ this.contentPane.scrollRect = rect
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/core/UIControl.as b/src/org/openPyro/core/UIControl.as
new file mode 100644
index 0000000..ff8336e
--- /dev/null
+++ b/src/org/openPyro/core/UIControl.as
@@ -0,0 +1,452 @@
+package org.openPyro.core{
+ import org.openPyro.events.PyroEvent;
+ import org.openPyro.managers.SkinManager;
+ import org.openPyro.managers.TooltipManager;
+ import org.openPyro.painters.IPainter;
+ import org.openPyro.skins.ISkin;
+ import org.openPyro.skins.ISkinClient;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.MouseEvent;
+
+ /**
+ * The UIControl is the basic building block for
+ * pyro controls. UIControls extend from Measurable control so
+ * can use all the different sizing properties like explicit or percent widths/heights.
+ * UIControls can also include other UIControls
+ * as children but cannot use layouts to position them. To use layouts,
+ * use UIContainers.
+ *
+ * UIControls also implement the ISkinClient interface so can be skinned and
+ * the ISkin interface so themselves can be used as base classes for skins
+ */
+ public class UIControl extends MeasurableControl implements ISkinClient, ISkin{
+
+ public function UIControl() {
+ super();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function initialize():void
+ {
+ super.initialize()
+ if(_skin || !_styleName ) return;
+ SkinManager.getInstance().registerSkinClient(this, _styleName);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function addChild(child:DisplayObject):DisplayObject
+ {
+ return addChildAt(child, this.numChildren);
+ }
+
+
+ /**
+ * @inheritDoc
+ */
+ override public function addChildAt(child:DisplayObject,index:int):DisplayObject
+ {
+ var ch:DisplayObject = super.$addChildAt(child, index);
+ if(child is MeasurableControl)
+ {
+ var control:MeasurableControl = child as MeasurableControl;
+ control.parentContainer = this;
+ control.addEventListener(PyroEvent.SIZE_INVALIDATED, invalidateSize);
+ control.addEventListener(PyroEvent.SIZE_CHANGED, queueValidateDisplayList);
+ control.doOnAdded()
+ }
+ this.invalidateSize()
+ return ch
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function measure():void{
+ if(isNaN(this._explicitWidth) &&
+ (!isNaN(this._percentWidth) || !isNaN(_percentUnusedWidth)))
+ {
+ calculateMeasuredWidth()
+ }
+ if(isNaN(this._explicitHeight) &&
+ (!isNaN(this._percentHeight) || !isNaN(_percentUnusedHeight)))
+ {
+ calculateMeasuredHeight();
+ }
+ this.needsMeasurement=false;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ override public function checkDisplayListValidation():void
+ {
+ doChildBasedValidation()
+ super.checkDisplayListValidation()
+ }
+
+ /**
+ * While UIControls can be sized based on the dimensions of the parent
+ * container, if the explicit or percent dimension values are not specified,
+ * the UIControl can look at its children's dimensions and base its
+ * sizing off them.
+ *
+ * For example, Label controls can look at the size of the text rendered
+ * by them to define their own width.
+ */
+ protected function doChildBasedValidation():void
+ {
+ var child:DisplayObject;
+ if(isNaN(this._explicitWidth) && isNaN(this._percentWidth) && isNaN(_percentUnusedWidth))
+ {
+ var maxW:Number = 0
+ for(var j:uint=0; j maxW)
+ {
+ maxW = child.width;
+ }
+ }
+
+ super.measuredWidth = maxW + _padding.left + _padding.right;
+ }
+ if(isNaN(this._explicitHeight) && isNaN(this._percentHeight) && isNaN(_percentUnusedHeight))
+ {
+ var maxH:Number = 0
+ for(var k:uint=0; k maxH)
+ {
+ maxH = child.height;
+ }
+ }
+ super.measuredHeight = maxH + _padding.top + _padding.bottom;
+ }
+ }
+
+
+ /**
+ * Overrides the set measuredWidth property from
+ * MeasurableControl to invalidate children
+ * (UIControl acknowledges that it can have children whose
+ * dimensions are based on its own)
+ */
+ override public function set measuredWidth(w:Number):void{
+ if(w == _measuredWidth) return
+ _dimensionsChanged = true;
+ _measuredWidth = w;
+ for(var i:uint=0; iMeasurableControl to invalidate children
+ * (UIControl acknowledges that it can have children whose
+ * dimensions are based on its own)
+ */
+ override public function set measuredHeight(h:Number):void{
+ if(h == _measuredHeight) return
+ this._dimensionsChanged = true;
+ _measuredHeight = h;
+ for(var i:uint=0; i maxW)
+ {
+ maxW = DisplayObject(children[i]).width
+ }
+ }
+ return maxW;
+ }
+
+ public function getMaxHeight(children:Array):Number
+ {
+ var maxH:Number=0;
+ for(var i:uint=0; i maxH)
+ {
+ maxH = DisplayObject(children[i]).height
+ }
+ }
+ return maxH;
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ /**
+ *Find all the children with explicitWidth/ explicit Height set
+ *This part depends on the layout since HLayout will start trimming
+ *the objects available h space, and v layout will do the same
+ *for vertically available space
+ **/
+
+ public function calculateSizes(children:Array,container:UIContainer):void
+ {
+ for(var i:int = 0; i0 && (i%_numRows)==0){
+ nowX+=_columnWidth+_columnGap;
+ nowY = _initY;
+ }
+ child.x = nowX;
+ child.y = nowY;
+ nowY+=child.height + _rowGap;
+ }
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ // TODO: stub ... this needs to cahnge to actually use a calculation
+ return 300;
+ }
+
+ public function getMaxHeight(children:Array):Number
+ {
+ //TODO: stub ... this needs to cahnge to actually use a calculation
+ return 300;
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ public function calculateSizes(children:Array, container:UIContainer):void
+ {
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/layout/HLayout.as b/src/org/openPyro/layout/HLayout.as
new file mode 100644
index 0000000..53ac22a
--- /dev/null
+++ b/src/org/openPyro/layout/HLayout.as
@@ -0,0 +1,106 @@
+package org.openPyro.layout{
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.UIContainer;
+
+ import flash.display.DisplayObject;
+
+ public class HLayout implements ILayout, IContainerMeasurementHelper{
+
+
+ private var _hGap:Number;
+ public function HLayout(hGap:Number=0):void{
+ _hGap = hGap;
+ }
+
+ protected var _container:UIContainer;
+ public function set container(container:UIContainer):void
+ {
+ _container = container;
+ }
+
+ private var _initY:Number = 0;
+ private var _initX:Number = 0;
+
+ public function set initX(n:Number):void{
+ _initX = n;
+ }
+
+ public function get initX():Number{
+ return _initX;
+ }
+
+ public function set initY(n:Number):void{
+ _initY = n;
+ }
+
+ public function get initY():Number{
+ return _initY;
+ }
+
+ /**
+ *Find all the children with explicitWidth/ explicit Height set
+ *This part depends on the layout since HLayout will start trimming
+ *the objects available h space, and v layout will do the same
+ *for vertically available space
+ **/
+
+ public function calculateSizes(children:Array,container:UIContainer):void
+ {
+ for(var i:int = 0; i0){
+ container.explicitlyAllocatedWidth+=_hGap;
+ }
+ if(children[i] is MeasurableControl)
+ {
+ var sizeableChild:MeasurableControl = MeasurableControl(children[i]);
+
+ if(isNaN(sizeableChild.percentUnusedWidth) && isNaN(sizeableChild.percentWidth))
+ {
+ container.explicitlyAllocatedWidth+=sizeableChild.width;
+ }
+
+ }
+ }
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ var nowX:Number=_initX;
+ for(var i:uint=0; i maxH)
+ {
+ maxH = DisplayObject(children[i]).height
+ }
+ }
+ return maxH;
+ }
+
+ private var _prepare:Function;
+ public function set prepare(f:Function):void{
+ _prepare = f;
+ }
+
+ public function layout(children:Array):void{
+ var nowX:Number=_initX;
+ for(var i:uint=0; i0 && (i%_numColumns)==0){
+ nowY+= _rowHeight+_rowGap;
+ nowX= _initX;
+ }
+ child.x = nowX;
+ child.y = nowY;
+ nowX+=child.width + _columnGap;
+ }
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ if(children.length == 0){
+ return 0
+ }
+ var childW:Number = children[0].width;
+ var w:Number = childW * this._numColumns
+ return w;
+ }
+
+ public function getMaxHeight(children:Array):Number
+ {
+ if(children.length == 0){
+ return 0
+ }
+
+ var childH:Number = isNaN(_rowHeight)?children[0].height:_rowHeight;
+ var numRows:int = children.length%_numColumns != 0 ? children.length/_numColumns+1 : children.length/_numColumns
+ return (numRows*childH+(numRows-1)*_rowGap) ;
+ }
+
+ public function calculateSizes(children:Array, container:UIContainer):void
+ {
+ trace("--> calculate new sizes")
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/layout/VLayout.as b/src/org/openPyro/layout/VLayout.as
new file mode 100644
index 0000000..cbf84b4
--- /dev/null
+++ b/src/org/openPyro/layout/VLayout.as
@@ -0,0 +1,119 @@
+package org.openPyro.layout{
+ import org.openPyro.core.MeasurableControl;
+ import org.openPyro.core.UIContainer;
+ import org.openPyro.effects.EffectDescriptor;
+ import org.openPyro.effects.PyroEffect;
+
+ import flash.display.DisplayObject;
+
+ public class VLayout implements ILayout, IContainerMeasurementHelper{
+
+ private var _vGap:Number = 0;
+
+ public function VLayout(vGap:Number=0){
+ _vGap = vGap;
+ }
+
+ protected var _container:UIContainer;
+ public function set container(container:UIContainer):void
+ {
+ _container = container;
+ }
+
+ private var _initY:Number = 0;
+ private var _initX:Number = 0;
+
+ public function set initX(n:Number):void
+ {
+ _initX = n;
+ }
+
+ public function set initY(n:Number):void
+ {
+ _initY = n;
+ }
+
+ public function getMaxWidth(children:Array):Number
+ {
+ var maxW:Number=0;
+ for(var i:uint=0; i maxW)
+ {
+ maxW = DisplayObject(children[i]).width
+ }
+ }
+ return maxW;
+ }
+
+
+ public function getMaxHeight(children:Array):Number
+ {
+ var nowY:Number=_initY;
+ for(var i:uint=0; i0){
+ container.explicitlyAllocatedHeight+=_vGap;
+ }
+
+ if(children[i] is MeasurableControl)
+ {
+ var sizeableChild:MeasurableControl = MeasurableControl(children[i]);
+ if(isNaN(sizeableChild.percentUnusedHeight) && isNaN(sizeableChild.percentHeight))
+ {
+ container.explicitlyAllocatedHeight+=sizeableChild.height;
+ }
+ }
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/managers/DragManager.as b/src/org/openPyro/managers/DragManager.as
new file mode 100644
index 0000000..ff5720f
--- /dev/null
+++ b/src/org/openPyro/managers/DragManager.as
@@ -0,0 +1,88 @@
+package org.openPyro.managers
+{
+ import org.openPyro.core.UIControl;
+ import org.openPyro.managers.events.DragEvent;
+
+ import flash.display.Bitmap;
+ import flash.display.BitmapData;
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.events.EventDispatcher;
+ import flash.events.MouseEvent;
+ import flash.geom.Rectangle;
+
+ public class DragManager extends EventDispatcher{
+
+ private var dragProxy:Sprite;
+ private var dragInitiator:DisplayObject
+
+ private var mouseStartY:Number = 0
+ private var mouseStartX:Number = 0
+
+ public function DragManager() {
+
+ }
+
+ public function makeDraggable(object:DisplayObject, bounds:Rectangle):void{
+ if(!object.stage){
+ throw new Error("DragTarget is not on stage")
+ }
+ dragInitiator = object;
+ dragProxy = createDragProxy(object);
+ if(object.parent is UIControl){
+ UIControl(object.parent).$addChild(dragProxy);
+ }
+ else{
+ object.parent.addChild(dragProxy)
+ }
+ dragProxy.x = object.x;
+ dragProxy.y = object.y;
+
+ dragProxy.startDrag(true, bounds);
+
+ mouseStartY = object.stage.mouseY
+ mouseStartX = object.stage.mouseX;
+ object.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
+ }
+
+ private static var instance:DragManager;
+ public static function getInstance():DragManager{
+ if(!instance){
+ instance = new DragManager()
+ }
+ return instance;
+ }
+
+ private function onMouseUp(event:MouseEvent):void{
+ if(!dragProxy) return;
+
+
+ var dragEvent:DragEvent = new DragEvent(DragEvent.DRAG_COMPLETE);
+
+ dragEvent.stageX = event.stageX;
+ dragEvent.stageY = event.stageY;
+ dragEvent.dragInitiator = dragInitiator;
+
+ dragEvent.mouseXDelta = dragProxy.parent.stage.mouseX-mouseStartX;
+ dragEvent.mouseYDelta = dragProxy.parent.stage.mouseY-mouseStartY;
+
+ dragProxy.parent.removeChild(dragProxy);
+ dragProxy = null;
+
+ dispatchEvent(dragEvent);
+ }
+
+
+ public function createDragProxy(object:DisplayObject):Sprite{
+ var data:BitmapData = new BitmapData(object.width, object.height)
+ data.draw(object);
+ var bmp:Bitmap = new Bitmap(data)
+ var sp:Sprite = new Sprite();
+ sp.addChild(bmp);
+ sp.alpha = .5;
+ return sp;
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/managers/OverlayManager.as b/src/org/openPyro/managers/OverlayManager.as
new file mode 100644
index 0000000..ddc7be1
--- /dev/null
+++ b/src/org/openPyro/managers/OverlayManager.as
@@ -0,0 +1,90 @@
+package org.openPyro.managers
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.geom.Point;
+
+ public class OverlayManager
+ {
+ public function OverlayManager()
+ {
+ super();
+ }
+
+ protected var _overlayDisplayObject:DisplayObjectContainer
+
+ /**
+ * The overlay layer on which the popups are
+ * rendered
+ */
+ public function set overlayContainer(dp:DisplayObjectContainer):void{
+ _overlayDisplayObject = dp;
+ }
+
+ public function get overlayContainer():DisplayObjectContainer{
+ return _overlayDisplayObject;
+ }
+
+ private static var instance:OverlayManager
+ public static function getInstance():OverlayManager{
+ if(!instance){
+ instance = new OverlayManager()
+ }
+ return instance;
+ }
+
+
+ private var bgSprite:Sprite;
+ private var centeredPopup:DisplayObject
+
+ public function showPopUp(popupObject:DisplayObject, modal:Boolean=false, center:Boolean=true):void{
+ if(!_overlayDisplayObject){
+ throw new Error("No overlay displayObject defined on which to draw")
+ }
+ if(modal){
+ bgSprite = new Sprite()
+ bgSprite.graphics.beginFill(0x00000, .5)
+ bgSprite.graphics.drawRect(0,0,_overlayDisplayObject.stage.stageWidth, _overlayDisplayObject.stage.stageHeight);
+ _overlayDisplayObject.addChild(bgSprite);
+ _overlayDisplayObject.stage.addEventListener(Event.RESIZE, onBaseStageResize)
+ // capture mouse interactions here.
+ }
+
+ _overlayDisplayObject.addChild(popupObject);
+ if(center){
+ centeredPopup = popupObject
+ popupObject.x = (_overlayDisplayObject.stage.stageWidth-popupObject.width)/2;
+ popupObject.y = (_overlayDisplayObject.stage.stageHeight-popupObject.height)/2;
+ }
+
+ }
+
+ public function showOnOverlay(object:DisplayObject, target:DisplayObject=null):void{
+ _overlayDisplayObject.addChild(object);
+ if(target){
+ var orig:Point = new Point(0,0)
+ var pt:Point = target.localToGlobal(orig)
+ pt = _overlayDisplayObject.globalToLocal(pt);
+ trace(pt.x, pt.y);
+ object.x = pt.x
+ object.y = pt.y
+ }
+
+ }
+
+
+ private function onBaseStageResize(event:Event):void{
+ if(bgSprite){
+ bgSprite.width = _overlayDisplayObject.stage.stageWidth
+ bgSprite.height = _overlayDisplayObject.stage.stageHeight
+ }
+ if(centeredPopup){
+ centeredPopup.x = (_overlayDisplayObject.stage.stageWidth-centeredPopup.width)/2;
+ centeredPopup.y = (_overlayDisplayObject.stage.stageHeight-centeredPopup.height)/2;
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/managers/SkinManager.as b/src/org/openPyro/managers/SkinManager.as
new file mode 100644
index 0000000..1b58807
--- /dev/null
+++ b/src/org/openPyro/managers/SkinManager.as
@@ -0,0 +1,167 @@
+package org.openPyro.managers{
+ import org.openPyro.core.ClassFactory;
+ import org.openPyro.skins.FlaSymbolSkin;
+ import org.openPyro.skins.ISkin;
+ import org.openPyro.skins.ISkinClient;
+ import org.openPyro.utils.ArrayUtil;
+
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+ import flash.events.IOErrorEvent;
+ import flash.events.TimerEvent;
+ import flash.net.URLRequest;
+ import flash.system.ApplicationDomain;
+ import flash.system.LoaderContext;
+ import flash.utils.Dictionary;
+ import flash.utils.Timer;
+
+ public class SkinManager extends EventDispatcher{
+
+ public static const SKIN_SWF_LOADED:String = "skinSWFLoaded"
+
+ private var skinClients:Dictionary
+ private var skinDefinitions:Dictionary;
+
+ public function SkinManager(){
+ skinClients = new Dictionary()
+ skinDefinitions = new Dictionary();
+ }
+
+ private static var instance:SkinManager
+ public static function getInstance():SkinManager
+ {
+ if(!instance)
+ {
+ instance = new SkinManager()
+ }
+ return instance;
+ }
+
+ public function registerSkinClient(client:ISkinClient, selector:String):void
+ {
+ if(skinClients.hasOwnProperty(selector))
+ {
+ var skinnable:Array = skinClients[selector]
+ skinnable.push(client);
+ }
+ else
+ {
+ skinClients[selector] = [client]
+ }
+
+ }
+
+ public function unregisterSkinClient(client:ISkinClient, selector:String):void
+ {
+ if(!skinClients.hasOwnProperty(selector)) return;
+ var skinnable:Array = skinClients[selector]
+ ArrayUtil.remove(skinnable, client);
+ }
+
+
+
+ public function getSkinForStyleName(styleName:String):ISkin
+ {
+ var skinFactory:ClassFactory = ClassFactory(this.skinDefinitions[styleName])
+ if(!skinFactory) return null;
+ var skin:ISkin =skinFactory.newInstance() as ISkin;
+ return skin;
+ }
+
+
+
+ private var timer:Timer;
+ private var invalidSelectors:Array = [];
+
+ public function registerSkin(skinFactory:ClassFactory, selector:String):void
+ {
+ if(skinDefinitions[selector] == skinFactory) return;
+ this.skinDefinitions[selector] = skinFactory;
+ invalidSelectors.push(selector);
+ /*
+ [TODO:] This needs to happen on the next EnterFrame, not Timer
+ */
+ invalidateSkins()
+ }
+
+ public function registerFlaSkin(skin:Class, selector:String):void
+ {
+ var flaSkinFactory:ClassFactory = new ClassFactory(FlaSymbolSkin);
+ flaSkinFactory.properties = {movieClipClass:skin};
+ registerSkin(flaSkinFactory, selector);
+ }
+
+ public function invalidateSkins():void
+ {
+ if(! timer){
+ timer = new Timer(500, 1)
+ timer.addEventListener(TimerEvent.TIMER_COMPLETE, validateSkins);
+ }
+ if(!timer.running){
+ timer.start()
+ }
+ }
+
+ public function validateSkins(event:TimerEvent):void
+ {
+ for each(var a:String in this.invalidSelectors)
+ {
+ var skinnable:Array = skinClients[a] as Array;
+ var skinFactory:ClassFactory = this.skinDefinitions[a];
+
+ if(!skinnable || !skinFactory) continue;
+ for(var i:uint=0; i 0){
+ this.graphics.lineStyle(_strokeWidth, _strokeColor, _strokeAlpha);
+ }
+ this.graphics.beginFill(_fillColor, _fillAlpha);
+
+ switch (_direction){
+ case Direction.UP:
+ drawUpArrow()
+ break;
+ case Direction.DOWN:
+ drawDownArrow()
+ break;
+ case Direction.LEFT:
+ drawLeftArrow()
+ break;
+ case Direction.RIGHT:
+ drawRightArrow()
+ break;
+
+ }
+
+ this.graphics.endFill();
+ }
+
+ private function drawDownArrow():void
+ {
+ this.graphics.moveTo(0, 0);
+ this.graphics.lineTo(_w/2, _h);
+ this.graphics.lineTo(_w, 0);
+ this.graphics.lineTo(0, 0);
+ }
+
+
+ private function drawLeftArrow():void
+ {
+ this.graphics.moveTo(_w,0);
+ this.graphics.lineTo(_w, _h);
+ this.graphics.lineTo(0, _h/2);
+ this.graphics.lineTo(_w, 0);
+ }
+
+ private function drawRightArrow():void
+ {
+ this.graphics.moveTo(0,0);
+ this.graphics.lineTo(_w, _h/2);
+ this.graphics.lineTo(0, _h);
+ this.graphics.lineTo(0, 0);
+ }
+
+ private function drawUpArrow():void
+ {
+ this.graphics.moveTo(0,_h);
+ this.graphics.lineTo(_w/2, 0);
+ this.graphics.lineTo(_w, _h);
+ this.graphics.lineTo( 0, _h);
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/skins/FlaSymbolSkin.as b/src/org/openPyro/skins/FlaSymbolSkin.as
new file mode 100644
index 0000000..77794de
--- /dev/null
+++ b/src/org/openPyro/skins/FlaSymbolSkin.as
@@ -0,0 +1,55 @@
+package org.openPyro.skins
+{
+ import org.openPyro.core.UIControl;
+
+ import flash.display.MovieClip;
+ import flash.events.Event;
+
+ public class FlaSymbolSkin implements ISkin{
+
+ private var _skin:MovieClip
+ private var _control:UIControl;
+
+ public function FlaSymbolSkin()
+ {
+
+ }
+
+ public function set movieClipClass(mcClass:Class):void
+ {
+ _skin = new mcClass();
+ }
+
+ public function get selector():String
+ {
+ return null;
+ }
+
+ public function set skinnedControl(uic:UIControl):void
+ {
+ _control = uic;
+ _control.addChildAt(_skin, 0);
+ if(!_skin) return;
+
+ _skin.width = uic.width
+ _skin.height = uic.height;
+ _control.addEventListener(Event.RESIZE, onControlResize)
+ }
+
+ private function onControlResize(event:Event):void{
+ _skin.width = event.target.width
+ _skin.height = event.target.height;
+ }
+
+ public function onState(fromState:String, toState:String):void
+ {
+ this._skin.gotoAndPlay(toState)
+ }
+
+ public function dispose():void
+ {
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/skins/GraphicSkin.as b/src/org/openPyro/skins/GraphicSkin.as
new file mode 100644
index 0000000..7c10b36
--- /dev/null
+++ b/src/org/openPyro/skins/GraphicSkin.as
@@ -0,0 +1,70 @@
+package org.openPyro.skins
+{
+ import org.openPyro.core.UIControl;
+
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+
+ /**
+ * This class defines the skins that are composed of raw graphic elements.
+ * For example this class defines button skins that use a graphic element
+ * embedded in the swf.
+ */
+ public class GraphicSkin extends Sprite implements ISkin
+ {
+ private var _graphic:DisplayObject
+ public function GraphicSkin(graphicObject:DisplayObject=null, useButtonMode:Boolean=true)
+ {
+ graphic = graphicObject;
+ if(useButtonMode)
+ {
+ this.buttonMode = true;
+ this.useHandCursor = true;
+ this.mouseChildren = false;
+ }
+ }
+
+ /**
+ * Sets the graphic element that needs to be used as
+ * the skin
+ */
+ public function set graphic(gr:DisplayObject):void
+ {
+ if(_graphic)
+ {
+ removeChild(_graphic)
+ _graphic = null;
+ }
+ _graphic = gr;
+ addChild(_graphic);
+ }
+
+ /**
+ * @private
+ */
+ public function get graphic():DisplayObject
+ {
+ return _graphic
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function set skinnedControl(uic:UIControl):void
+ {
+ uic.addChildAt(this,0);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function dispose():void
+ {
+ if (this.parent)
+ {
+ this.parent.removeChild(this)
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/skins/ISkin.as b/src/org/openPyro/skins/ISkin.as
new file mode 100644
index 0000000..1f046a3
--- /dev/null
+++ b/src/org/openPyro/skins/ISkin.as
@@ -0,0 +1,18 @@
+package org.openPyro.skins{
+ import org.openPyro.core.UIControl;
+
+ import flash.display.IBitmapDrawable;
+
+ /**
+ * Defines an interface that all DisplayObjects
+ * that can be applied as Skins to OpenPyro controls
+ */
+ public interface ISkin extends IBitmapDrawable{
+
+ //function get selector():String;
+
+ function set skinnedControl(uic:UIControl):void;
+ function dispose():void;
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/skins/ISkinClient.as b/src/org/openPyro/skins/ISkinClient.as
new file mode 100644
index 0000000..7eb8e98
--- /dev/null
+++ b/src/org/openPyro/skins/ISkinClient.as
@@ -0,0 +1,12 @@
+package org.openPyro.skins{
+
+ /**
+ * Defines the interface that all OpenPyro controls
+ * that can have skins applied to them must implement
+ */
+ public interface ISkinClient
+ {
+ function set skin(skinImpl:ISkin):void;
+ function get styleName():String;
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/storage/SharedObjectStorage.as b/src/org/openPyro/storage/SharedObjectStorage.as
new file mode 100644
index 0000000..c71acc0
--- /dev/null
+++ b/src/org/openPyro/storage/SharedObjectStorage.as
@@ -0,0 +1,146 @@
+package org.openPyro.storage{
+
+ import org.openPyro.core.ISerializable;
+ import org.openPyro.core.events.StorageEvent;
+ import org.openPyro.core.storage.IStorage;
+ import org.openPyro.core.storage.StoreActionState;
+
+ import flash.events.EventDispatcher;
+ import flash.events.NetStatusEvent;
+ import flash.net.SharedObject;
+ import flash.net.SharedObjectFlushStatus;
+
+ /**
+ * Dispatched when the store succeeds in persisting any object to the store
+ */
+ [Event(name="storeSucceeded", type="net.comcast.pyro.storage.events.StorageEvent")]
+
+ /**
+ * Dispatched when the store fails in persisting any object to the store
+ */
+ [Event(name="storageFailed", type="net.comcast.pyro.storage.events.StorageEvent")]
+
+ /**
+ * The SharedObjectStorage saves the serializable object as a
+ * value to the SO in the so.data.value field.
+ *
+ *
+ * var ob:StorageDictionary = new StorageDictionary()
+ * ob.setKeyValuePair(key, value);
+ * var storage:SharedObjectStore = new SharedObjectStore('dev')
+ * storage.save(ob)
+ *
+ */
+ public class SharedObjectStorage extends EventDispatcher implements IStorage{
+
+ private var _storeCreated:Boolean = false;
+ private var so:SharedObject;
+
+ /**
+ * The number of bytes to reserve for the storage
+ */
+ public var minDiskSpace:Number = 1000;
+
+ /**
+ * Constructor
+ */
+ public function SharedObjectStorage(soName:String,localPath:String = null, secure:Boolean = false){
+ try{
+ so = SharedObject.getLocal(soName, localPath, secure);
+ _storeCreated = true;
+
+ }catch(e:Error){
+ _storeCreated = false;
+ }
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function get storeCreated():Boolean{
+ return _storeCreated;
+ }
+
+ protected var _storeActionState:String;
+
+ /**
+ * Returns the status of the last "save" action.
+ * The values are one of the constant values from
+ * org.openPyro.core.storage.StoreActionState
+ *
+ * @see org.openPyro.core.storage.StoreActionState;
+ */
+ public function get storeActionState():String{
+ return _storeActionState;
+ }
+
+
+ /**
+ * @inheritDoc
+ */
+ public function save(ob:ISerializable, overwrite:Boolean=true):void{
+ if(!_storeCreated){
+ _storeActionState = StoreActionState.SAVE_FAILED;
+ dispatchEvent(new StorageEvent(StoreActionState.SAVE_FAILED));
+ return ;
+ }
+ if(overwrite){
+ so.data.value = ob.serialize();
+ }
+ else{
+ if(so.data && so.data != ""){
+ throw new Error("Cannot overwrite on Shared Object. Key already exists");
+ }
+ }
+ var flushStatus:String = null;
+ try{
+ flushStatus = so.flush(minDiskSpace);
+ }
+ // flush may immediately fail if user has disallowed storage
+ catch(e:Error){
+ _storeActionState = StoreActionState.SAVE_FAILED;
+ dispatchEvent(new StorageEvent(StoreActionState.SAVE_FAILED));
+ return ;
+ }
+ if (flushStatus != null) {
+ switch (flushStatus) {
+ case SharedObjectFlushStatus.PENDING:
+ _storeActionState = StoreActionState.SAVE_PENDING;
+ //Logger.info(this, "Waiting for user to allow save to disk");
+ so.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
+ break;
+ case SharedObjectFlushStatus.FLUSHED:
+ _storeActionState = StoreActionState.SAVE_SUCCEEDED;
+ dispatchEvent(new StorageEvent(StoreActionState.SAVE_SUCCEEDED));
+ break;
+ }
+ }
+ }
+
+ /**
+ * @private
+ * Event handler if the flush caused a user prompt making the response
+ * asynchronous
+ */
+ private function onFlushStatus(event:NetStatusEvent):void {
+ switch (event.info.code) {
+ case "SharedObject.Flush.Success":
+ _storeActionState = StoreActionState.SAVE_SUCCEEDED;
+ dispatchEvent(new StorageEvent(StoreActionState.SAVE_SUCCEEDED));
+ break;
+ case "SharedObject.Flush.Failed":
+ _storeActionState = StoreActionState.SAVE_FAILED;
+ dispatchEvent(new StorageEvent(StoreActionState.SAVE_FAILED));
+ break;
+ }
+ so.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getStoredData():String{
+ return so.data.value as String;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/storage/StorageDictionary.as b/src/org/openPyro/storage/StorageDictionary.as
new file mode 100644
index 0000000..17dd976
--- /dev/null
+++ b/src/org/openPyro/storage/StorageDictionary.as
@@ -0,0 +1,80 @@
+package org.openPyro.storage
+{
+ import org.openPyro.core.ISerializable;
+
+ import flash.utils.Dictionary;
+
+ /**
+ * @example The following code shows how to use StorageDictionary
+ *
+ *
+ * var kv:StorageDictionary = new StorageDictionary()
+ * kv.setKeyValuePair("one", "1");
+ * kv.setKeyValuePair("two", "2");
+ * kv.separator = "&"
+ * var serializedString:String = kv.serialize();
+ *
+ */
+ public class StorageDictionary implements ISerializable
+ {
+
+ private var keyValueString:String = "";
+
+ private var data:Dictionary = new Dictionary()
+
+ protected var _separator:String = "|"
+
+ public function StorageDictionary() {
+
+ }
+
+ public function set separator(separatorCharacter:String):void{
+ _separator = separatorCharacter
+ }
+
+ public function get separator():String{
+ return _separator;
+ }
+
+
+ public function setKeyValuePair(key:String, value:String):void
+ {
+ data[key] = value;
+ }
+
+ public function getValueForKey(key:String):String
+ {
+ return data[key];
+ }
+
+ public function serialize():String
+ {
+ for(var key:String in data){
+
+ keyValueString+=key+":"+data[key]+_separator;
+
+ }
+ return keyValueString;
+ }
+
+ /**
+ * Reconsitutes a key value pair based dictionary
+ * from a serialized string.
+ */
+ public function deserialize(str:String):void
+ {
+ var keyValArray:Array = str.split(this._separator);
+ for(var i:int=0; i
+ * var a:Array = [0,1,2,3,4,5]
+ * ArrayUtil.insertAt(a, 2, "inserted");
+ * trace(a) //[0,1,inserted,2,3,4,5]
+ *
+ */
+ public static function insertAt(src:Array, idx:Number, data:*):void{
+ if(idx=0; i--){
+ insertAt(sourceArray, idx, arrayToInsert[i])
+ }
+ return sourceArray;
+ }
+
+
+
+ public static function removeItemAt(src:Array, idx:uint):void{
+ src.splice(idx,1);
+ }
+
+ public static function removeDuplicates(arr:Array):Array{
+ var uniques:Array = new Array()
+ var i:uint = 0;
+ while(i < arr.length){
+ var searchElement:* = arr[i];
+ if(uniques.indexOf(searchElement) != -1){
+ removeItemAt(arr, i);
+
+ }
+ else{
+ uniques.push(searchElement);
+ i++;
+ }
+ }
+ return arr;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/utils/GlobalTimer.as b/src/org/openPyro/utils/GlobalTimer.as
new file mode 100644
index 0000000..e1e73b2
--- /dev/null
+++ b/src/org/openPyro/utils/GlobalTimer.as
@@ -0,0 +1,36 @@
+package org.openPyro.utils
+{
+ import flash.display.Stage;
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+
+ public class GlobalTimer extends EventDispatcher
+ {
+
+ private var _stage:Stage
+
+ private static var frameNumber:Number=0;
+
+ public function GlobalTimer(stage:Stage)
+ {
+ _stage = stage
+ }
+
+
+ public function start():void
+ {
+ _stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
+ }
+
+ private function onEnterFrame(event:Event):void
+ {
+ frameNumber++;
+ }
+
+ public static function getFrameNumber():Number
+ {
+ return frameNumber;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/utils/MathUtil.as b/src/org/openPyro/utils/MathUtil.as
new file mode 100644
index 0000000..122bf0e
--- /dev/null
+++ b/src/org/openPyro/utils/MathUtil.as
@@ -0,0 +1,42 @@
+package org.openPyro.utils{
+
+ /**
+ * A collection of Utility methods for Mathematical operations
+ */
+ public class MathUtil
+ {
+ /**
+ * Inserts a comma after every 3rd character when counted from reverse
+ *
+ * useage: getCommaSeparatedString(12345) returns 12,345
+ */
+ public static function getCommaSeparatedString(n:Number):String{
+ var numString:String = String(n);
+ var returnString:Array = new Array();
+ for(var i:Number=numString.length-1, count:Number=1; i>=0; i--, count++){
+ returnString.push(numString.charAt(i));
+ if(count%3==0 && i != 0){
+ returnString.push(",");
+ }
+ }
+ returnString.reverse();
+ return returnString.join('');
+ }
+
+ /**
+ * @param deg The degree value whose radian equivalent is required
+ * @return The radian equivalent of the input parameter
+ */
+ public static function degreeToRadians(deg:Number):Number{
+ return Math.PI*deg/180;
+ }
+
+ public static function radiansToDegrees(rad:Number):Number{
+ return 180*rad/Math.PI;
+ }
+
+ public static function randRange(start:Number, end:Number) : Number{
+ return Math.floor(start +(Math.random() * (end - start)));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/utils/StringUtil.as b/src/org/openPyro/utils/StringUtil.as
new file mode 100644
index 0000000..c5935ce
--- /dev/null
+++ b/src/org/openPyro/utils/StringUtil.as
@@ -0,0 +1,98 @@
+package org.openPyro.utils{
+ import flash.text.TextField;
+
+ /**
+ * A collection of Utility methods for working with Strings
+ */
+ public class StringUtil{
+ /**
+ * Check to see if the String is an empty string with one or more
+ * whitespace characters or null.
+ * Checks even for \n and \t values
+ */
+ public static function isEmptyOrNull(str:String):Boolean{
+ var pattern:RegExp = /^\s+$/;
+ return pattern.test(str) == true ? true : str == "" || str == null;
+ }
+
+ public static function padLeading(s:String, n:Number, char:String = " "):String{
+ var returnStr:String="";
+ var diff:Number = n-s.length;
+
+ for(var i:Number=0;i 1 && tf.textWidth > w)
+ {
+ s = s.slice(0, s.lastIndexOf(" "));
+ tf.text = s + indicator;
+ }
+ }
+
+ // check against textWidth and textHeight, include styles
+ if(tf.textHeight > h)
+ {
+ // get close
+ s = originalText.slice(0, Math.floor((h / tf.textHeight ) * originalText.length));
+
+ while (s && s.length > 1 && tf.textHeight > h)
+ {
+ s = s.slice(0, s.lastIndexOf(" "));
+ tf.text = s + indicator;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/org/openPyro/utils/XMLUtil.as b/src/org/openPyro/utils/XMLUtil.as
new file mode 100644
index 0000000..598d459
--- /dev/null
+++ b/src/org/openPyro/utils/XMLUtil.as
@@ -0,0 +1,88 @@
+package org.openPyro.utils{
+
+ /**
+ * A collection of Utility methods for working with XML
+ */
+ public class XMLUtil
+ {
+ /**
+ * Returns a boolean whether the newNode exists
+ * anywhere deeper in the item node. For example
+ * to find node
+ *
+ *
+ * one
+ *
+ *
+ * in something like
+ *
+ *
+ *
+ *
+ *
+ * `
+ * one
+ *
+ *
+ *
+ *
+ *
+ */
+ public static function isItemParentOf(item:XML, newNode:XML):Boolean{
+ if(item.contains(newNode)) return true;
+ var foundAsChild:Boolean = false
+ for(var i:int=0; i