Archive for the ‘ AIR ’ Category

Flex 4 ACE Mock Exam

Glad to release the version 1.0 of FlexACE Mock Exam Application:

The Application is based on our experience of getting ACE Certification.
The application free for download on these links:

Source Link, Android App Link, BlackBerry App Link, Amazon App Link, Desktop AIR Link

Looking forward to your feedback to improve the application Experience.
Best wishes on getting ACE Certification.

Move Scroll bar on left side Flex4

I struggled a lot, but fixed it with easy tweak.
s:List Property -> layoutDirection=”rtl”
Note, in case you were using itemRenderer , make the reverse there to avoid arabic right to left effect by :
s:ItemRenderer Property -> layoutDirection=”ltr”

Parallel Computing in AS3 //P

Managed to create a Master – Slave architecture between a group of SWF Files.
This group will have a Master SWF which will command other slave swf’s to do certain processing.

This architecture might be helpful in distributing the processing to many files thus reducing the Memory being occupied in a Single SWF.

With IoC in proper form in future, will be successful editing the Slave SWF’s Dynamically.

Code for Master : https://gist.github.com/9bd094ac172d336004c6

Code for Slaves : https://gist.github.com/a840cea1258e019176d8

This Architecture avails running multiple threads with different SWF files at same time

XML to Object

The Project i have created converts the XML into required object in simple steps. Have a look on it : XSLT

Convert int to String

The AS3 Util Function is posted on the below link
Utility to convert number or integer to String. The util function is useful in many applications.
https://gist.github.com/703108

AIR install problem with MAC PowerPC / Leopard

Windows 2000 and Mac PowerPC are not supported with AIR 2. Users can install and run AIR 1.5 applications, but will not be able to install or update to AIR 2.
Source – http://www.adobe.com/products/air/systemreqs/

The below are the links to be used for MAC – AIR 1.5 installer

http://airdownload.adobe.com/air/mac/download/1.5/AdobeAIR.dmg
http://airdownload.adobe.com/air/mac/download/1.5.3/AdobeAIR.dmg

Flex 4 in a Week

Watch Flex4 videos from Adobe or refer torrent to download them

Flex 4 Best Explained on Pictures :

Flex 4 DOM Tree model – [Link]

Things i learnt new from ACE -Flex4

ACE exam was a good learning experience for me, I came to learn about these new things yesterday.

  • saveCache is used in LCDS for offline mode saving.
  • Native Platform style is default setting for AIR.
  • FileMode.Update is used to make the both file writing and reading.
  • AcceptDragDrop is the method used to accept an DragObject and DoDrag is to initiate the dragging.
  • SQLConnection is the class used for setting SQLLite into write mode.
  • SQLStatement class property “text” is used for the sql querying purpose.
  • mouseDownEffect also can be used to set the Effect on MouseClick.
  • widthInChars is new property for TextInput which can be used to set width.
  • AIR can access the methods of loaded SWF by default.

Dynamic Injection on runtime using BeanFactory

Met with requirement to inject object dynamically at runtime based on Push Message received.

Had a bit hard time finding solution, unusual with Swiz Framework.
Thought of sharing my experience here..
Step 1: In swiz Context assign the bean factory to your Bean Class

messenger.beanFactory = this.beanFactory;

Step 2:
In your bean class, Implement Interface IBeanFactoryAware
public class NativeMessenger implements IBeanFactoryAware

Step 3:
To Satisfy the implementation add the below code:
private var _beanFactory:IBeanFactory;
public function set beanFactory( beanFactory:IBeanFactory ):void{
_beanFactory = beanFactory;
}
Step 4:
Got access to Beanfactory
public var dynamicDAO:AbstractDAO;
protected function consumeHandler(event:MessageEvent =null) : void
{
var daoName:String = event.message.headers["dynamicdao"];
dynamicDAO = _beanFactory.getBeanByName(daoName).source as AbstractDAO;
}

Now the dynamicDAO is assigned with the bean dynamically based on the consumer Message.

Flash Builder Network Monitor Bug

When a sequence of service calls made to server using, Blaze DS.

I got the below error, where as i used to get the result handler and fault handler responses for the same request.
There was nothing wrong in server side,
[FaultEvent fault=[RPC Fault faultString="Error #2006: The supplied index is out of bounds." faultCode="InvokeFailed" faultDetail="null"] messageId=”" type=”fault” bubbles=false cancelable=true eventPhase=2]

At last, i got it by disabling the Network Monitor of Flash builder things were back in shape..

Merge / Combine two ArrayCollections

// ArrayCollection 1
var arrC1:ArrayCollection;
// ArrayCollection 2
var arrC2:ArrayCollection; 
var array1:Array = arrC1.source
var array2:Array = arrC2.source
public function arrayContainsValue(arr:Array, value:Object):Boolean
{
       return (arr.indexOf(value) != -1);
}  
public function createUniqueCopy(a:Array):Array{
       var newArray:Array = new Array();        
       var len:Number = a.length;
       var item:Object;        
       for (var i:uint = 0; i < len; ++i)
       {
               item = a[i];                
               if(arrayContainsValue(newArray, item))
               {
                       continue;
               }
               newArray.push(item);
       }
       return newArray;
}  
var combinedArr:Array = createUniqueCopy(array1.concat(array2) );
var resultArrC:ArrayCollection =new ArrayCollection( combinedArr );
Follow

Get every new post delivered to your Inbox.

Join 436 other followers