From inspiration to realization
28Mar/090

Free flex uploader is coming along pretty great…

Hello All,

I'm developing an Uploader component for free use in your website/blog.
I'm using Adobe flex builder 3 for it, so the final result will be an swf you will simply embed in your real life website.

Well, this is not a release note, just an update.

I have completely changed the way you will configure the uploader, it used to be a couple fo JavaScript predefined function you should have used.

I changed it to an XML config file, it has all of the parameters I could think of.

I'm pasting the xml straight from the development environment, its really important to me to hear what you have to say, I want it to be as user friendly as possible.

Please if you think I should add another param or whatever, please drop me an email or send a contact through the contact page.

Here's the xml

   1: <?xml version="1.0" encoding="utf-8" ?>
   2: <uploaderConfig>
   3:     <!--
   4:         Should be: http://www.your_domain.com/your_script.aspx/php/whatever :-)  
   5:     -->
   6:     <uploadScriptUrl></uploadScriptUrl>
   7:     <!--
   8:         Should be javascript funcion that gets a single param like so: progressEvent(progress)
   9:         You can display this to the user, or do other things you want.
  10:     -->
  11:     <progressEventListner></progressEventListner>
  12:     <!--
  13:         Same as before, javascript function that gets a single param > Error Message
  14:         errorListner(errorMessage)
  15:     -->
  16:     <errorListner></errorListner>
  17:     <!--
  18:         What do you want your users to upload?
  19:         jpg;mpg;wmv;flv
  20:         all other file types you want type here will be disregarded and an error will be raised.
  21:     -->
  22:     <fileTypeAllowed></fileTypeAllowed>
  23:     <!--
  24:         This is when i make your life easier.
  25:         You can pass me the file size in KB, the flex handles the translation to bytes :-) 
  26:         How?... like so:
  27:         KB:250
  28:         Please do not use a double.decimal the, thoug you won't get en Error the flex simply will disregard this
  29:     -->
  30:     <fileSizeAllowed></fileSizeAllowed>
  31:     <!--
  32:         Javascript function for displaying the message to the user
  33:     -->
  34:     <completeListner></completeListner>
  35: </uploaderConfig>

You can also download the file from here: Uploader configuration file (103)

This is what the uploader looks like, I tried keeping it A.S.A.P (as simple as possible :-) )

kenso_uploader

Waiting for your comments.

  • Share/Bookmark
Tagged as: , No Comments
27Mar/091

Strange flex bug – caching screens

Hello All,

Thanks again for visiting by website/Blog.

The past week has been very frustrating for me. As you know (or not) I work quite a bit with flex development and AIR.

The environment for developing these applications is Adobe Flex Builder 3, I never had any problems with this peace of software, but this last week has been just horrible.

I will explain my problem.

As you know (again or not...) I'm not a designer and I don't wanna be one, so... I got all of the designs from the designer of the project via PSD, cut all of the "assets" to use in my flex application and started off with building each screen.

As always, I wrote some CSS (yeah.. Flex has css, same as HTML), build an swf file for holding all of the assets (swc), and started dragging in controls.

All pretty basic so far, but...

Sometimes (well, all the time) the flex just refused to build with the recent changes, After the first time I build an swf from the flex IDE, no change I made to the application actually "kicked in".

Action-Script
Because even the labels on the buttons refused an update, I even tried to write it in Action-Script, that didn't help me at all.
The application just would not update.

   1: private function initScreen():void
   2: {
   3:     screenMainText.htmlText="Please Choose which of the Questionnaires below you would like to compile for your Survey";
   4:     backButton.label = "Back to control panel";
   5: }

What did I do to see the updated?

I copied all of the code from the mxml file, deleted this file, created a new file, pasted in the copied code and WALLA, the updates "kicked in"

Strangely though even a project cleaning would not help

flex_issue

I emailed Adobe, but got no response so far, I will update here and tweet on the solution I hope they provide.

** I tried importing another project to the flex builder, but the error did not exist in another project, only in this specific project.

  • Share/Bookmark
Filed under: Flex 1 Comment
24Mar/090

Flex "Verbal Month" date

Hi All,

If you are working with Adobe flex, you probably know that the framework does not have a function such as DateTime.Now().ToString().

Because of that, displaying a friendly date to the user is impossible unless you write a small extension to the getDate() function in flex.

This is The way to go

   1: var todayDate:String = "";
   2:         
   3: private function INIT():void{
   4:     getCurrentDate();        
   5: }
   6:  
   7: private var monthLabels:Array = new Array("Jan",
   8:                                           "Feb",
   9:                                           "Mar",
  10:                                           "Apr",
  11:                                           "May",
  12:                                           "Jun",
  13:                                           "Jul",
  14:                                           "Aug",
  15:                                           "Sep",
  16:                                           "Oct",
  17:                                           "Nov",
  18:                                           "Dec");            
  19:  
  20: private function getCurrentDate():void{
  21:     var date:Date = new Date();
  22:     todayDate = date.getDate().toString() + " " + monthLabels[date.getMonth()].toString() + " " + date.getFullYear().toString();
  23:     datePickerButton.label=todayDate;
  24: }

 

That's it, its that easy to get a date from flex.

You can of curse extend it some more in order to get the day.

  • Share/Bookmark
Filed under: Flex No Comments