My experience on my daily works... helping others ease each other

Monday, October 25, 2010

Date & Time formatting in Flex

What you need to know?
1. The format
Pattern Example
Year
YY 09 (Year Number Short)
YYY 2009 (Year Number Full)
YYYY 02009 (I have no clue why you would need this)
Month
M 7 (Month Number Short)
MM 07 (Month Number Full)
MMM Jul (Month Name Short)
MMMM July (Month Name Full)
Day
D 4 (Day Number Short)
DD 04 (Day Number Full)
Day Name
E 1 (Day Number Short)
EE 01 (Day Number Full)
EEE Mon (Day Name Short)
EEEE Monday (Day Name Full)
A AM/PM
J Hour in day (0-23)
H Hour in day (1-24)
K Hour in AM/PM (0-11)
L Hour in AM/PM(1-12)
N 3 (Minutes)
NN 03 (Minutes)
SS 30 (Seconds)

 2. How to format
     i. using date formatter => <mx:DateFormatter id="formatDateTime" formatString="MM/DD/YY" />
    ii. calling date formatter => formatDateTime.format(YourDate);
Share:

Saturday, October 23, 2010

State & Transition in Flex - Simple component to make your flash apps look superb

I love to use this two component in flex @ flash (for latest version of Adobe Flash programming language). It makes your simple and dull presentations looks marvelous, superb, fascinating, etc... BUT DEPENDS ON YOUR CREATIVITY TOO... :)
Here are the extracted code from my program.. just part of it if anyone wonder how to use this :)

Share:

Friday, October 22, 2010

org.xml.sax.SAXParseException: Content is not allowed in prolog.

Today while testing my flex applications and try to read xml files using BlazeDS which calls my java class I got this weird errors. When I ran it and test it out on Netbeans or Eclipse, it runs without any issues. But when I port into my webserver (running tomcat), this was pop-up. I run through google looking for solutions. Guest what I got, many of them saying that there is parsing issues when you are using either XML with encoding UTF8 or UTF16. There is a space before your XML starting point

I've try formatting it, validate it and nothing seem correct. and continue to get this errors
Catch Exception XmlConfigReader.readFileColl: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)...

After when through a complete checking on my code, then I realize something... there is issues on my code, it does not find the file as the path is in complete. It point out to folder and not the file thus it is reading a complete folder and just grab the first file and read it. That is why it keep on getting the problem. So guys, if you are getting this problem, check your file and the path it is reading first. :)
Share:

About Me

Somewhere, Selangor, Malaysia
An IT by profession, a beginner in photography

Blog Archive

Blogger templates