This was proving really hard until i found that class now it is a piece of cake!
Thanks whoever you are maruthi2000
AVM1Movie Controller in Flex
Unable to Catch IOErrorEvent’s when Loading a ByteArray into an Image
So i went digging and i found in the base class of image, SWFLoader line 1497 the following (more...)
Flex Cookbook Recipe 5.8 Allow Certain items in a list to be selectable, Doesn’t quite work correctly
1. Key directions were not being assigned.
2. When a disabled item was at either the top or the bottom of the list it would stop you being able to continue down / up the list.
To fix this i added the following code. (more...)
Augmented Reality
Salesforce ActionScript Fun
So as i have seen a lot of posts about this i have decided to explain how i go about logging in here.
1. To login you need 3 things
1. Username in the form user@user.com
2. Password.
3. Security Token
To get the security token for a user go to setup>Reset your security token. This will then be emailed to you.
Logging into an Administrators account seems to be different than logging into a normal users account.
For Administrators you have to set the protocol to 'http' for normal users set it to 'https' in addition we have to add the token to the password as follows.
private var _conn : Connection = new Connection( ); private function login( username : String, password : String, token : String, isAdmin : Boolean = false ) : void { _connection.protocol = isAdmin ? 'http' : 'https'; var login : LoginRequest = new LoginRequest( ); login.username = value..username; login.password = value..password.toString( ) + value..token.toString( ); login.callback = new Responder( loginResult, loginFault ); _connection.login( login ); }
Number Romanizer
/** * Function that turns any number into it's roman numeral * equivelant. * We have to use an array to hold the values as if we use * a Dictionary / Object actionScript sorts it alphabetically. * and we don't get the correct results. * * @param value : Number 0 - 9999; */ public static function romanize( value : Number ) : String { var numerals : Array = [ { label : 'M', value : 1000 }, { label : 'CM', value : 900 }, { label : 'D', value : 500 }, { label : 'CD', value : 400 }, { label : 'C', value : 100 }, { label : 'XC', value : 90 }, { label : 'L', value : 50 }, { label : 'XL', value : 40 }, { label : 'X', value : 10 }, { label : 'IX', value : 9 }, { label : 'V', value : 5 }, { label : 'IV', value : 4 }, { label : 'I', value : 1 } ] var roman : String = ''; for( var i : String in numerals ) { while( value >= numerals[ i ].value ) { roman += numerals[ i ].label; value -= numerals[ i ].value; } } return roman; }
Time Calculator
Features
- Calculates time bi-directionally ie: if the date is in the past it will tell you the time since it elapsed or if it is in the future it will tell you the time left until it elapses.
- Optionally set a expiration string to be returned when the date has been reached.
- Fires a TimeCalculator.TIME_EXPIRED event when the time expires.
- Set the precision level of the return values. ( YEARS, MONTHS, DAYS, WEEKS, HOURS, MINUTES, SECONDS, MILLISECONDS ). This allows you to return values for example where the date is 1 year 2 months in the future but you don't care about the years you just want the number of months, days, hours, minutes, seconds, milliseconds till that date. ie 13 months, 30days, 23hours, 59minutes, etc...
- Individual time accessors ie get Years( ); Months( ); Days( ); etc... until the due date.
- Set labels and separators to be returned with the time strings labels( 'years', 'months' ). 01years : 01months.
- Optionally set removeEmptyTImes = false; This will display values that have no time associated with them. For example for a date 2 months in the future with a precision set to YEARS, the default return value from _timeCalculator.calculateTime( ); would be 01 : 30 : 23 : 59 : 59 : 999 with the years not being returned and the date starting at the months. However if you set removeEmptyTimes = false the return date would be 00 : 01 : 30 : 23 : 59 : 59 : 999 showing the years as 00 values.
- Turn off individual time ammounts so if you wanted just the years, months and days for a given date you can set showHours = false; This will cut the date at the Days and only return YEARS : MONTHS : DAYS.
As usual you can right click to view the source.. Any comments suggestions or errors please leave a comment.
System.vmVersion
Hidden API’s in Flex
The one i have been using most often is
However I have also found a few imports that are documented but that don't provide the ability to use auto complete or allow you to import them automatically
for example
mx.utils.DescribeTypeCacheRecord and mx.utils.DescribeTypeCache
If anyone knows how to actively stop code hinting for class's and would like to share that would be great!
Dashed VRule and HRule Components
Thanks