Spark Color Picker
Spark based Color Picker Component : Check the code base
https://gist.github.com/1527354 – Usage
https://gist.github.com/1527366
https://gist.github.com/1527361
https://gist.github.com/1527358
Spark based Color Picker Component : Check the code base
https://gist.github.com/1527354 – Usage
https://gist.github.com/1527366
https://gist.github.com/1527361
https://gist.github.com/1527358
To use maintainAspectRatio true in your Spark Image, use the fillMode=”scale” and scaleMode=”letterbox”
<s:Image id=”img” smooth=”true” fillMode=”scale” scaleMode=”letterbox” />
due to : spark.primitives.BitmapImage
private function get maintainAspectRatio():Boolean{
return (_scaleMode == BitmapScaleMode.LETTERBOX && _fillMode == BitmapFillMode.SCALE);}
Code Snippet for SVG Editor tool using AS3 https://gist.github.com/1506440
Code Snippet to Color Transform the Image https://gist.github.com/1505064
To Solve the problem : Error #2044: Unhandled ErrorEvent:. text=Error #3702: Context3D not available.
Keep the AIR xml rendermode property into gpu
gpu
Inspired by iTailor.com, the site which helps to design shirts online.
Made a mask with shirt shape to overlay on the shirt, for dynamically changing color of the shirt.
Code:
https://github.com/nsdevaraj/Tailor
Lately working in FaceDetection, did shared code of my first steps on Face Detection
https://github.com/nsdevaraj/FaceDetect
Hope it helps for beginners
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.
ByteArray to Encode and Decode Objects as String
https://gist.github.com/1051042 based on http://goo.gl/8WdQu
Code for picking up random XML entries from XMLList : code
Source for Android/ iOS/ Blackberry Mobile App Universal-Currency.
Developed with Flex 4.5.1 SDK and AIR 2.7 SDK
The project does currency conversion, using HTTPService via SwizDAO Framework
Check the code base:
https://github.com/nsdevaraj/Universal-Currency
Did used Cairngorm after long time with Flex 4.5 SDK, it’s fun working with Cairngorm after more than 2 years.
Did a sample code base for RSS viewer.
Check the code:
https://github.com/nsdevaraj/RSSViewer
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”
A Small Util Function to create random Password Generation https://gist.github.com/988479
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
launch firefox -> about:config
Modify the value of dom.ipc.plugins.timeoutSecs to -1
This helps hanging of firefox after default 45 seconds while debugging with break points in Flex
Did prepared Presentation of AS3 Design Patterns : http://goo.gl/gk4eP
First of All, we need JSP / ASP for getting the IP Address, Example code: Link
After getting the IP, using the below IP Web Service we can find the End- User’s Country.
http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP
Was unable to download the “DAO4J” best Open Source DAO generator of Java (Plugin for Squirrel Client).
At last found it from my Backups, will be useful tool for those looking for Pojo or DAO generation from any DB.
Get the Plugin from the link : dao4j.zip
The Project i have created converts the XML into required object in simple steps. Have a look on it : XSLT
XML to Object function can be found here :Gist
This will be useful for converting XML to ArrayCollection
Was searching for emulator_runtime.apk all over the web for download, at last found it on my sdk runtime path.
C:\… \sdks\4.5.0\runtimes\air\android\emulator
Try Yours
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
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
Flex4 Framework
spark.effects.AddAction
spark.effects.Animate
spark.effects.AnimateColor
spark.effects.AnimateFilter
spark.effects.AnimateTransitionShader
spark.effects.AnimateTransform
spark.effects.AnimateTransform3D
spark.effects.animation.Animation
mx.collections.ArrayList
spark.filters.BevelFilter
spark.primitives.BitmapImage
spark.layouts.supportclasses.Block
spark.filters.BlurFilter
spark.components.BorderContainer
spark.effects.easing.Bounce
spark.components.supportclasses.ButtonBarHorizontalLayout
spark.components.supportclasses.ButtonBase
spark.effects.CallAction
spark.components.CheckBox
spark.filters.ColorMatrixFilter
flash.geom.ColorTransform
spark.layouts.ColumnAlign
spark.components.ComboBox
spark.filters.ConvolutionFilter
spark.effects.CrossFade
spark.components.DataRenderer
spark.filters.DisplacementMapFilter
spark.layouts.supportclasses.DropLocation
spark.filters.DropShadowFilter
spark.components.mediaclasses.DynamicStreamingVideoSource
spark.components.mediaclasses.DynamicStreamingVideoItem
spark.effects.easing.Elastic
spark.primitives.Ellipse
spark.effects.Fade
spark.primitives.supportclasses.FilledElement
spark.filters.GlowFilter
spark.filters.GradientBevelFilter
spark.filters.GradientFilter
spark.filters.GradientGlowFilter
spark.primitives.Graphic
spark.primitives.supportclasses.GraphicElement
spark.components.supportclasses.GroupBase
spark.effects.interpolation.HSBInterpolator
spark.components.HScrollBar
spark.components.supportclasses.ItemRenderer
spark.effects.animation.Keyframe
spark.layouts.supportclasses.LayoutBase
spark.primitives.Line
spark.effects.easing.Linear
spark.components.supportclasses.ListBase
spark.core.MaskType
flash.geom.Matrix
flash.geom.Matrix3D
spark.effects.animation.MotionPath
spark.effects.Move
spark.effects.Move3D
spark.effects.interpolation.MultiValueInterpolator
spark.components.mediaclasses.MuteButton
spark.components.NavigatorContent
spark.effects.interpolation.NumberInterpolator
spark.primitives.Path
spark.components.PopUpAnchor
spark.components.PopUpPosition
spark.effects.easing.Power
spark.components.supportclasses.Range
spark.primitives.Rect
spark.primitives.RectangularDropShadow
mx.collections.AsyncListView
spark.effects.RemoveAction
spark.effects.Resize
spark.effects.interpolation.RGBInterpolator
spark.components.RichEditableText
spark.components.RichText
spark.effects.Rotate
spark.effects.Rotate3D
spark.layouts.RowAlign
spark.effects.Scale
spark.effects.Scale3D
spark.components.supportclasses.ScrollBarBase
spark.components.Scroller
spark.components.supportclasses.ScrollerLayout
spark.components.mediaclasses.ScrubBar
spark.effects.SetAction
spark.filters.ShaderFilter
spark.effects.animation.SimpleMotionPath
spark.effects.easing.Sine
spark.components.supportclasses.Skin
spark.components.supportclasses.SkinnableComponent
spark.components.SkinnableContainer
spark.components.supportclasses.SkinnableContainerBase
spark.components.SkinnableDataContainer
spark.components.supportclasses.SkinnableTextBase
spark.components.supportclasses.SliderBase
spark.skins.SparkSkin
spark.components.Spinner
spark.core.SpriteVisualElement
spark.primitives.supportclasses.StrokedElement
spark.components.TabBar
spark.components.supportclasses.TextBase
spark.components.TextSelectionHighlighting
spark.utils.TextUtil
spark.components.TileGroup
spark.layouts.TileLayout
spark.layouts.TileOrientation
spark.effects.animation.Timeline
spark.components.TitleWindow
spark.components.ToggleButton
spark.components.supportclasses.ToggleButtonBase
spark.components.supportclasses.TrackBase
mx.geom.Transform
mx.geom.TransformOffsets
spark.components.VideoDisplay
spark.components.VideoPlayer
spark.components.mediaclasses.VolumeBar
spark.effects.Wipe
mx.collections.XMLListCollection
Special Components
mx.states.AddItems
airframework
spark.components.windowclasses.TitleBar
FTE text for MX components
mx.controls.dataGridclasses.FTEDataGridItemRenderer
mx.controls.MXFTETextInput
mx.controls.advancedDataGridclasses.FTEAdvancedDataGridItemRenderer
Text Layout Framework (TLF)
flashx.textLayout.elements.LinkElement
flashx.textLayout.elements.BreakElement
flashx.textLayout.elements.DivElement
flashx.textLayout.elements.InlineGraphicElement
flashx.textLayout.elements.ParagraphElement
flashx.textLayout.elements.SpanElement
flashx.textLayout.elements.TabElement
flashx.textLayout.elements.TCYElement
flashx.textLayout.elements.TextFlow
flashx.textLayout.formats.TextLayoutFormat
mx.rpc.CallResponder
mx.messaging.channels.HTTPChannel
mx.rpc.remoting.mxml.Operation
mx.messaging.channels.SecureHTTPChannel
mx.messaging.channels.SecureStreamingHTTPChannel
mx.messaging.channels.SecureRTMPChannel
mx.messaging.channels.StreamingHTTPChannel
Flex 3 Graphics
mx.geom.CompoundTransform
mx.graphics.GradientEntry
mx.graphics.LinearGradient
mx.graphics.LinearGradientStroke
mx.graphics.RadialGradient
mx.graphics.RadialGradientStroke
mx.graphics.SolidColor
mx.graphics.SolidColorStroke
mx.graphics.Stroke
mx.geom.Transform
Flex 3 Miscellaneous
mx.logging.targets.MiniDebugTarget
mx.logging.targets.TraceTarget
MXItemRenderer
mx.controls.listclasses.MXItemRenderer
mx.controls.treeclasses.MXTreeItemRenderer
mx.controls.dataGridclasses.MXDataGridItemRenderer
mx.controls.advancedDataGridclasses.MXAdvancedDataGridItemRenderer
ACE exam was a good learning experience for me, I came to learn about these new things yesterday.
Passed ACE Certification with Flex4.
The differences of Flex3 and Flex 4 certifications
1/ more questions – 59 questions (previously 50)
2/ more time – 90 minutes (previously 60 min) Don’t bother about time factor you will have at least 30 minutes spare time for review.
3/ UI have more share among questions 35 %
4/ In Flex_Exam_Guide – They didn’t mentioned about LCDS, but we got Questions from LCDS too.
Tips:
1/ Do use attest, as it is the only resource we have for mockup
2/ Unlike Attest the questions will be in shuffled order
3/ While you attend ACE, don’t forget to use “Flag for review”, whenever you have doubt on your answer.
4/ The Questionnaire will be different for everyone
The below are some important topics, these areas required to be refreshed before attempting ACE.
LCDS
RemoteObject vs. Webservice vs. HTTPService
Flex3
[RemoteClass],[Bindable] Metadatas,E4X xml query, Labelfunction and Labelfield usage,Custom Event, Producer, consumer, validator,TabNavigator ,viewstack, setStyle, BlendMode, Modules vs. Sub Applications and formatter
OOPS
Interface, Encapsulation, Design patterns, access modifiers, Constructor and getter setters
AIR:
native platform in AIR Application,File management in AIR, Preloader, Drag and Drop in AIR, Security Sandbox in AIR, SQL Lite in AIR, create a Native AIR Application, Badge Installer in AIR
Spark :
working with state, ArrayList vs. Arraycollection, Animate, constraint layout in Spark Components, orientation of Child components,effects, create a custom component, Two-Way Binding, IVisualElement, ItemRenderer, LayoutBase, SkinnableComponent, TextInput, CSS namespace declaration, Descendant ID Type Class CSS types and Group
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.
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..
Tried out module loading in Flex 4 with Swiz, posted the code in Github link.
Hope, this is useful while using modules with Flex4.
Usage:
On change of moduleIndex the new module will be loaded on stage, the example is an alternative for viewStack elements loading.
“unable to detect webcam / video source”
The above is the message i got continuously after trying a lot, so fixed it with Flex by creating a AIR to show the Webcam Video.
Source:
<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" maxHeight="150" maxWidth="200" showStatusBar="false" skinClass="assets.DTApplicationSkin" alwaysInFront="true"> <fx:Script> <![CDATA[ private function videoDisplay_creationComplete():void { var camera:Camera = Camera.getCamera(); if (camera) { videoDisplay.attachCamera(camera); } } ]]> </fx:Script> <mx:VideoDisplay id="videoDisplay" creationComplete="videoDisplay_creationComplete();" width="100%" height="100%" horizontalCenter="0" verticalCenter="0"/> </s:WindowedApplication>
The link have the AIR file required. Download

Usage : java -jar SWFCompress.jar c 'YourSWF.swf'


Usage : java -jar SWFCompress.jar d 'YourSWF.swf'
Now the re compressed SWF is ready to go. Have Fun Cracking, Hacking SWF’s
Built an AS3 Project to Work with GenericDAO using Swiz and AS3Signals
The project was inspired by Java Spring Framework:
IBM Generic Dao
The project uses the benefits of DI provided by Swiz 1.0.
The Deferred Instantiation of Swiz builds DAO Object only when [Inject] keyword is used.
Also, uses the latest Spark SkinnableComponent Framework for the View Part with Passive View.
The Source can be downloaded from SwizDAO Git
The below is the code from Swiz Context for a DAO Object:
<swiz:Prototype name=”taskDAO” constructorArguments=”{['task',taskProcessor]}” type=”{AbstractDAO}” singleton=”true”/>
Update Info : http://nsdevaraj.wordpress.com/2010/05/12/project-swiz-dao/
The Flex Frameworks Explained in “YouTube”
Parsley
http://bit.ly/ParsleyVideo
Mate
http://bit.ly/MateVideo10
http://bit.ly/MateVideo09
RobotLegs
http://bit.ly/RobotLegsVideo
Cairngorm with UM
http://bit.ly/CairngormUMVideo
The PDF Presentations and Links available from :
http://adamstudio.in/
http://groups.google.com/group/flexatbeach/web/resources-2009
“VerifyError: Error #1014: Class flash.text.engine::TextLine could not be found.” – The Error I got when trying to compile MXML with below configurations:
AIR Beta 2 Runtime, Flex 4 SDK, AIR Beta 2 SDK
Solution :
Open the project folder and edit the “.actionScriptProperties” file
Change the compiled flash swf target runtime from htmlPlayerVersion=”9.0.28″ to htmlPlayerVersion=”10.0.0″.
Also make sure your app.xml namespace to be “http://ns.adobe.com/air/application/2.0beta2″
Flex@Beach is being hosted again at Chennai on Feb 28th.
Check the below links:
Agenda ’10 Venue ’10http://www.esthell.com/@flexatbeach
The Group link to share files and discussions.
The Videos of Flex@Beach’09 link live on YouTube.
Viewers, the files were lost due to migration and abortion of sites geocities and pages.google.. the files were re uploaded in the below link : http://sites.google.com/site/nsdevaraj/
Looking forward to speak at Adobe DevSummit @Chennai 24/Nov & @Hyd 1/Dec on Topic “Integration of Spring with BlazeDS and CairngormUM (Deep Dive)”
The Presentation Document : link &
Presentation

DevSummit
This is a dream come true.
To run an EXE from AIR, do the following steps:
Step 1:
Install the exe from this Link
Step 2:
Import Flex Project samples, from install dir ex: C:\Program Files\FluorineFx Aperture\Samples
Step 3:
Copy *.dll files (apimaging.dll,apoutlook.dll,apSystem.dll,fluorinepp.dll and msi.dll) to your Flex src directory
Step 4:
Copy your ‘-app.xml’ to ‘C:\Program Files\FluorineFx Aperture\Debug’ location of install dir for debugging or just pack the AIR
A Quick tip, was stuck today to load an local image / swf inside AIR at MAC OS.
The below is the solution:
var filenotion:String =”;
if(Capabilities.os.search(“Mac”) >= 0) filenotion = “file://”;
Image.source= filenotion +imgFileURI;
How to do :
1 ) To create resource bundles for different languages and then use the ResourceManager class provided by the Flex API to get the resources.
Just changing the locale of the resource manager will reflect changes in the entire application with the values from the new locale’s resource bundle.
How to Create Locale :
For example if I want to support two locales (en_US and fr_FR) in your application and I my parent folder is named as “Locales”, then I might have following folders. As en_US ,fr_FR
It will be like this :
Locales/en_US , Locales/fr_FR
Steps to do before make the Bundle
Part 1 : SDK
Create folder
1 D:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\projects\framework\bundles \fr_FR
2 D:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\projects\framework\bundles\fr_FR \src
Download and paste
3.http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/bundles/fr_FR inside step 2
Create folder :
4 D:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\locale \fr_FR
Execute
5. D:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0
bin\compc -locale=fr_FR -source-path+=frameworks/projects/framework/bundles/fr_FR/src -include-resource-bundles=collections,containers,controls,core,effects,formatters,logging,SharedResources,skins,states,styles,utils,validators -output=frameworks/locale/fr_FR/framework_rb.swc
Part 2 : Project
1. Set System PATH
D:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin
2. create required properties file mainBundle.properties
3. keep that file inside a folder with your locale name ‘fr_FR
4.execute from root path
mxmlc -locale=fr_FR -source-path={locale} -include-resource-bundles=mainBundle,collections,containers,controls,core,effects,skins,styles -output=src/Resources_fr_FR.swf
mxmlc -locale=en_US -source-path={locale} -include-resource-bundles=mainBundle,collections,containers,controls,core,effects,skins,styles -output=src/Resources_en_US.swf
After that place that swf file your Project
Locale/en_US :
Inside we need create the file name like “mainBundle.properties” inside that we need to create like that
welcome_title_text=Welcome,
form_first_name_text=First Name
form_second_name_text=Last Name
form_gender_text=Gender
form_gender_list_male_text=Male
form_gender_list_female_text=Female
Locale/fr_FR :
Inside we need create the file name like “mainBundle.properties” inside that we need to create like that
welcome_title_text=Bienvenue ,
form_first_name_text=Prénom
form_second_name_text=Nom de famille
form_gender_text=Sexe
form_gender_list_male_text=Mâle
form_gender_list_female_text=Femelle
Adding Locales to your Projects
Add the locale to the compiler options.
-locale=en_US,fr_FR
This link, claims to have compiled swc files for most languages : Babel
This Post was my overdue subject, I wanted to help with a sample Application using Cairngorm, Spring BlazeDS Integration & Generic DAO.
This might be a heavy subject as it deals with many subjects:
The Source is available at the link: cairnspring
How to use the source effectively?
it is simple, steps below:
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Dec | ||||||
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
| Ravi on Cairngorm revisited, with Flex… | |
| nsdevaraj on Spark Color Picker | |
| Florian on Spark Color Picker | |
| Vikash SHarma on Flex@Beach’10 | |
| hanzojr on MDI Form using Flex |