Flex User Group Phlippines now Online!

I’m inviting everyone who uses Flex or even those who are interested to know and learn Adobe Flex to join Flex User Group Philippines! Joining the group is easy! Just go to Flex User Group Philippines page and click that big red button saying “Join this Group” and you’ll automatically be a member! Remember to login first with your Adobe ID or if you currently don’t have one yet, you can register for free at Adobe


Spark List Progressive Multiple Selection

By request, I’ve made this simple tutorial to show how to make a Checklist component that extends from a Spark List. On the other hand this is to also show how easy it is to customize the Spark List component. This tutorial is available in cookbooks together with an example file.

Check it out there too: http://cookbooks.adobe.com/post_Multiple_checklist_like_selection_with_Spark_List-18957.html

The Spark List control can already do a progressive multiple selection but only when you’re in a touch interaction mode or holding the CTRL key. The Touch mode interaction is set only when you’re in a Touch device, since most of these devices don’t have a keyboard. But if you’re in a desktop environment the default handling is that the Spark List depends on the CTRL key. So in order to do a progressive or checklist-like selection, we will create a component that extends from the Spark List control and override calculateSelectedIndices method.

First, let’s create a class that extends from a Spark List and define that allowMultipleSelection is set to true:

package com.staticfunction.components
{

   import spark.components.List;

   public class CheckList extends List
   {
       public function CheckList()
       {
           super();
           allowMultipleSelection = true;
       }
   }
}

Then override calculateSelectedIndices so that it won’t depend on the CTRL key.

override protected function calculateSelectedIndices(index:int, shiftKey:Boolean, ctrlKey:Boolean):Vector.<int>
{
     return super.calculateSelectedIndices(index, shiftKey, true);
}

As you can see above, we force the last parameter to true. Since we’re doing a checklist like selection, we don’t want the user to always hold the CTRL key.

You can optionally have this feature turn on only when you want it. You can do this by defining a flag like selectionRequiresModKey and reference from it whether to force the progressive selection or not.

let’s define a variable for selectionRequiresModKey and set it’s value to true by default. Then, use it in our overriden calculateSelectedIndices method for reference if we will force the progressive selection or not.

public var selectionRequiresModKey:Boolean = true;

override protected function calculateSelectedIndices(index:int, shiftKey:Boolean, ctrlKey:Boolean):Vector.<int>
{
      if (!selectionRequiresModKey)
          return super.calculateSelectedIndices(index, shiftKey, true);
      else
          return super.calculateSelectedIndices(index, shiftKey, ctrlKey);
}

Our final code:

package com.staticfunction.components
{

   import spark.components.List;

   public class CheckList extends List
   {
       public function CheckList()
       {
           super();
           allowMultipleSelection = true;
       }
   }

   public var selectionRequiresModKey:Boolean = true;

   override protected function calculateSelectedIndices(index:int, shiftKey:Boolean, ctrlKey:Boolean):Vector.<int>
   {
        if (!selectionRequiresModKey)
            return super.calculateSelectedIndices(index, shiftKey, true);
        else
            return super.calculateSelectedIndices(index, shiftKey, ctrlKey);
   }
}

That’s all there is to it. If you want to see it in action, I’ve included an example with the .fxp or .zip file I’ve uploaded for you to download.

To download the file, go tohttp://cookbooks.adobe.com/post_Multiple_checklist_like_selection_with_Spark_List-18957.html


Adobe Flash Builder 4.5 Release!

Time sure flies, it was just like yesterday when Adobe release Flash Builder 4 and now they sure are fired up with the release of the new Flash Builder 4.5!

New in Flash Builder 4.5:

  • Mobile Application Development with Android, BlackBerry and Apple iOS devices
  • Better workflow with Flash Catalyst! Design-led or Developer-led workflows!
  • Flash Builder 4.5 for PHP! yeah!
  • Improve coding productivity
        and many more!
Flash Builder 4.5 comes in 4 flavors:
  • Flash Builder 4.5 Premium
  • Flash Builder 4.5 Standard
  • Flash Builder 4.5 for PHP Premium
  • Flash Builder 4.5 for PHP Standard

Adobe CS5.5 Roadshow Philippines

Yeah its coming you guys!

Event Details:
Date: 11 May, 2011 (Wed)
Time: 9.00am to 1.00pm (Registration begins at 8.30am)
Venue: Makati Shangri-la Hotel, Ballroom B and C
Ayala Avenue corner Makati Avenue, Makati City 1200

Register here if you want to attend the event
http://www.adobe.com/sea/special/cs55roadshow/index_philippines.html


Creating a 3 State Spark CheckBox control

So a this week I created a new cookbook recipe, creating a 3 state CheckBox control in Spark. This kind of component is commonly use in Tree checklist. Now the default Flex 4 check box only have 2 states, selected and not selected. So this kinda not appropriate for a Tree checklist view. To go to that tutorial simply click your way to cookbooks.adobe.com


Parsing common date expressions in DateField

I’ve just published a recipe on Adobe Cookbooks on creating a DateField parseFunction. To see the whole post click here.


Finally, Flash Player 10.2!

Yes it’s here! Flash Player 10.2! Packed with new features such as:

Stage Video – Complete hardware acceleration, viewing High Definition videos is greatly improved! With this feature, rendering HD video will not greatly impact CPU.

Internet Explorer 9 hardware accelerated rendering support – Who cares? seriously… Most of us developers would say, but for some folks, in fact 60% of internet surfers out there still uses IE. So this is good news for them.

Native custom mouse cursors – worth mentioning. A great article by Thibault Imbert explains the importance of this feature.

Support for full screen mode with multiple monitors

- How cool is that?! If you have multiple monitors you’ll see.

Fast switch – If web traffic is slow and you’re watching or streaming online sometimes you’ll need to switch bit rate to cope up with your network capacity. But it is such a pain to switch bit rate as it is painfully slow. But now with the enhanced fast switching feature, you can switch to any bit rate without wasting time.

Global error handling Finally, I’m starting to get tired of adding try catch statements to code that would sometimes fail and trying to find them too.

Optimized SWF management for mobile and Sleep mode – Hear that apple? Steve you gotta have Flash on that alphabetically challenge iPhone now.

Wow! great new features! but that’s only a subset of the features, so if you want to see other features as well, you can go here.

Don’t have Flash Player? get it here.


Welcome to static function!

Hi, I’m James Roland Cabresos, a Flex Developer, Designer and a proud father. Welcome to the static function! if you’re a developer, I think you have an idea why I picked it as the title for my blog. Static function is a common tag or term in the programming world as this is widely use for creating helpers, utilities or for unique objects. a static function can be called from anywhere without the need for instantiating an object. Most of the time static methods do common tasks that would make a developer’s job easy.

Before I became a developer, I was a musician and studied in the country’s top conservatory of music. I never dreamed of becoming a developer someday. As I remembered, I was just surfing the net for steps in installing an Operating System 3 years ago and now here I am, working as a Flex Developer and telling the world how geek I am!

I am passionate about developing applications with Flex or Flash and designing. Well most of these works are not yet posted but someday it will be. Because of my passion about programming and designing, I’ve decided to put up this blog to allow me to note everything I’ve gone through and will be going to as a developer. Most of the time you’ll hear me whine about stuff but that just to add some few paragraphs to a post. Anyways, I hope you learn something from my blog and that you’ll enjoy coming back here.


Follow

Get every new post delivered to your Inbox.