Hello,
I want to make a class with a function I want to reuse in my
application. This is new for me, so I need some help ...
I've created a file "CommonFunctions.as" in the root of my application
with this code:
package {
public class CommonFunctions {
public function String2Date(doString:String):Date {
var doYear:int = Number(doString.substr(0,4));
var doMonth:int = Number(doString.substr(5,2));
var doDay:int = Number(doString.substr(8,2));
var doHour:int = Number(doString.substr(11,2));
var doMin:int = Number(doString.substr(14,2));
var doSec:int = Number(doString.substr(17,2));
var myDate:Date = new Date(doYear, doMonth, doDay,
doHour, doMin,
doSec);
// showErrorDialog(doString + "+" + doYear + "+" +
doMonth + "+" +
doDay + "+" + doHour + "+" + doMin + "+" + doSec);
return myDate;
}
}
}
Now, how do I use in it on an other mxml-file in that application ?
This does not work:
dfShipping.selectedDate =
String2Date(x.result[0].shipdatum[0].toString());
Thanks a lot,
Frank
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/