Saturday, October 29, 2011

The GesturePopUp class

Just found this awesome example on Gesture. A gesture starts with a mouse down on a box and ends after the user has moused over several boxes and releases the button.






source

Saturday, October 22, 2011

How to drop a SQLite database

To "drop" a SQLite database, all you have to do is delete the SQLite database file you were accessing.


Just awesome ;)

How to know does a table exist in Adobe AIR SQLite


public function doesTableExist(connection:SQLConnection, tableName:String):Boolean{
    connection.loadSchema();
    var schema:SQLSchemaResult = connection.getSchemaResult();

    for each (var table:SQLTableSchema in schema.tables)
    {
        if (table.name.toLowerCase() == tableName.toLowerCase())
        {
            return true;
        }
    }
    return false;
}

source

Saturday, September 10, 2011

AS3 Encryption

As3 Crypto is a cryptography library written in Actionscript 3 that provides several common algorithms. This version also introduces a TLS engine (TLS is commonly known as SSL.)

http://crypto.hurlant.com/demo/

scaleContent property is true, but the UILoader is not resized ?

Resizes the component to the requested size. If the scaleContent property is set to true, the UILoader is not resized.



import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
addChild(myUILoader);

function completeHandler(event:Event):void {
var uiLdr:UILoader = event.currentTarget as UILoader;
var image:DisplayObject = uiLdr.content as DisplayObject;
trace("UILoader:", uiLdr.width, uiLdr.height); // 100 100
trace("UILoader.content:", image.width, image.height); // 400 267
uiLdr.setSize(image.width, image.height);
uiLdr.move((stage.stageWidth - image.width) / 2, (stage.stageHeight - image.height) / 2);
}

68 Small but Useful Open Source ActionScript Libraries(misc) help Flex/Flash Developers Improve Work Efficiency

1. appcorelib Open Source Flex Application Core Library, AppCoreLib is a collection of useful classes that facilitate easy RIA development with regards to XML based data being pulled in. The general approach is that an application needs to load various content/setting files prior to loading the UI. Through a series of simple checks, an application can then load the UI once those dependencies have been loaded or alert the user if they have not. AppCoreLib provides simple XMLDataBroker classes with convenience methods that allows easy traversal of the XML data using simple IDs.
2. as3awss3lib
as3awss3lib is an AS3 library for accessing Amazon’s S3 service. It only works in Apollo because of restrictions in the browser player. It supports managing buckets and objects.

3. as3barcodelib
as3barcodelib is a library for reading and decoding barcodes in Actionscript 3. Initially it will be able to read and decode the one-dimensional EAN 13 symbology from bitmaps.

4. as3bloggerlib
AS3BloggerLib is an Actionscript 3.0 library that allows installed (AIR) applications to access the Blogger Data API. This library also contains functionality to authenticate a Google account using Google’s ClientLogin protocol.

5. as3cannonball
Cannonball is an implementation of the DOM Level 3, HTML and CSS3 core specifications written in ActionScript 3.0.

6. as3csslib
as3csslib is an CSS engine separated from as3cannonball for ActionScript 3.0

7. as3corelib
as3corelib is an ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs.

8. as3crypto
As3 Crypto is a cryptography library written in Actionscript 3 that provides several common algorithms.

9. as3ebaylib
The eBay ActionScript 3.0 library provides an interface between the eBay XML API and ActionScript 3.0. This open-source library will allow developers to create novel and innovative applications leveraging both eBay’s marketplace services and Adobe’s Flash Player 9 runtime!

10. as3facebooklib
The Facebook API provides an ActionScript 3.0 for interacting with the Facebook Platform API.

11. as3fedexlib
This is an ActionScript 3.0 wrapper on top of the FedEx XML APIs. It also provides a solid framework on top of which you can easily add additional functionality.

12. as3flexdb
AS3FlexDB project is a open source lib that allows Adobe Flex applications to connect to a MySQL server.

13. as3flickrlib
The Flickr library is an ActionScript 3.0 API for the online photo sharing application, Flickr. It provides access to the entire Flickr API.

14. as3gamelib
Library of useful gaming classes for game development on the actionscript/flash platform


15. as3isolib
As3isolib (v1.0) is an open-source ActionScript 3.0 Isometric Library developed to assist in creating isometrically projected content (such as games and graphics) targeted for the Flash player platform. As3isolib includes utilities, primitives and views. As3isolib was developed with simplicity, speed and performance in mind so that developers can focus on actual implementations rather than having to learn a complex API.

16. as3mathlib
The Flex/Actionscript Math Library (as3mathlib) is intended to provide a rudimentary numerical analysis toolkit for the Actionscript/Flex programming environment.

17. as3mp3streamplayer
This project requires Flash player 10 and allows you to play shoutcast mp3 streams without memory problems.

18. as3nativealertlib
as3nativealertlib is an AIR alert that appears in a native window. In Flex, we have alerts, but they are Flex windows rather than native OS windows. This is fine in the browser, but doesn’t make much sense in AIR (Adobe Integrated Runtime). In AIR, we want our alerts to show up in their own native windows. This project creates Flex-like alerts, but they are native windows.

19. as3notificationlib
as3notificationlib is a notification framework written in AS3 for the Adobe Integrated Runtime (AIR). This project makes it easy to add cross-platform notifications to your AIR application. It handles "native system notifications" like the dock icon bouncing and the taskbar icon flashing, and it allows you to easily create alert "pop-ups".

20. as3plsreader
as3plsreader is a PLS (Playlist) reader for Adobe AIR / Actionscript 3 which allows you to read and write PLS and M3U files. PLS files and M3U Files are Playlist files used by alot of audio programs. Programs like iTunes, Real player, Winamp, VLC media player and Foobar play these formats without any extra codecs required.

21. as3powncelib
The as3powncelib is an interface between the Pownce API and ActionScript 3. It does all the grunt work of parsing the XML from the API and turning it in to AS3 objects.

22. as3scribdlib
The Scribd library is an ActionScript 3.0 API for the online document sharing application, Scribd. It provides access to the entire Scribd API.

23. as3soundeditorlib
as3soundeditorlib is an Actionscript 3.0 library for sound playback, spectrum display, and cue point display.

24. as3syndicationlib
as3syndicationlib is an ActionScript 3.0 library for handling syndication feeds. Use the syndication library to parse Atom and all versions of RSS easily. This library hides the differences between the formats so you can parse any type of feed without having to know what kind of feed it is.

25. as3webservice
as3webservice is an open-source Webservice class implementation in AS3 for Flash CS3 IDE.

26. as3xls
as3xls is an library which allows you to read and write Excel files in Flex.

27. as3youtubelib
as3YoutubeLib is an ActionScript 3.0 library which provides an interface to search videos from YouTube.

28. as3-bits(prior version: adobe-air-util)
Miscalleneous AS3 bits, Adobe AIR AS3 utility classes

29. as3-rpclib
As3 RPC lib is a set of libraries that can be used with Flex 2 or AS 3 to invoke remote procedure calls using: AMF0 (Flash Remoting MX) XML-RPC JSON-RPC (Coming Soon)

30. ascollada
ascollada is an actionscript library for parsing Collada files.

31. assql
asSQL is an Actionscript 3 Mysql Driver aimed towards AIR projects to allow Mysql database connectivity directly from Actionscript.

32. assqliteutils
assqliteutils is an actionscript 3 SQLite utils library.

33. beziercurve
beziercurve is an ActionScript 3 library which lets you create and on the fly edit bezier curves with an easy syntax. You can add as many anchor and control points as you want.

34. bigroom
bigroom is an actionscript 3 library from Big Room. Various Flash/Flex Actionscript 3 source code released to the community by Richard Lord of Big Room

35. birdeye
BirdEye is a community project to advance the design and development of a comprehensive open source information visualization and visual analytics library for Adobe Flex. The actionscript-based library enables users to create multi-dimensional data visualization interfaces for the analysis and presentation of information.

36. bulk-loader
BulkLoader is a minimal library written in Actionscript 3 (AS3) that aims to make loading and managing complex loading requirements easier and faster.

37. csvlib
csvlib is a csv parser for actionscript 3.

38. degrafa
Degrafa is a declarative graphics framework for Flex, which allows you to use MXML markup to draw shapes, make complex graphics, create skins and also includes advanced CSS support.

39. displaylistmonitor
dispalylistmonitor is a panel for use inside of the Flash IDE to monitor objects within the display list.

40. efflex
efflex is an Designer Effects library for Flex.

41. everythingflexairlib
These free components and classes will help with your development of AIR applications. EverythingFlexAIR1.swc includes the ContextWindow, AlertWindow, NativeAlertWindow, SuperWindow, ConnectionManager, and UpdateManager classes.

42. facebook-as3
facebook-as3 provides AS3 API to access Facebook’s Platform API(Implementation of Facebook’s REST API in Actionscript 3.).

43. fastas3
FastAS3 is an ActionScript 3.0 Library inspired by jQuery which is a new type of JavaScript library for fast and fun development.

44. flexfiltering
FlexFiltering is an Controls and Collections for AS3 and Flex that support fast filtering across large datasets.

45. flexircclient
FlexIRCClient is an ActionScript 3 based IRC library which aims to be a Flex / Flash based IRC Client.

46. flexwires
FlexWires is a Wires UI control library for Adobe Flex.

47. flexlib
flexlib is an Open Source Flex Component Library which efforts to create open source user interface components for Adobe Flex 2, 3 and 4.

48. flexsurverylibrary
flexsurverylibrary is an ActionScript 3 library which allows you create survey for Flex applications.

49. flvplayerlite
FLVPlayerLite is a simple and lightweight FLV Player.

50. flvrecorder
FLVRecorder is an library which record BitmapData to an FLV-encoded file for Adobe AIR. The class offers the user to record via inputting BitmapData, Bitmaps and even your custom components, Flex component, like your VideoDisplay and also Flash components, like the FLVPlayBack or your custom Sprites and MovieClips.

51. foam-as3
FOAM is a two-dimensional rigid body physics engine written in ActionScript 3.0.

52. googleas3api
GoogleAS3API is a simple collection of Google’s API features, there is a class per feature, like Google Web search, Images Search, Google Suggest etc which help you to integrate the power of Google in your Flash/Flex/AIR application (searches, translation, suggest, weather, feeds).

53. icodecoder
icodecoder is an ActionScript 3.0 library(one class) icon file decoder.

54. lastfm-as3
lastfm-as3 is an Actionscript 3.0 API to access all the available Last.fm web services.

55. masapi
The target of the Masapi is to provide a complete framework dedicated to the management of the massive loading into a flash/flex application. It is designed to be as easy as possible to use but also to be as flexible as possible.

56. MinimalComps
MinimalComps are a set of minimal user interface components for use in ActionScript 3.0 based projects.

57. openzoom
open-zoom is an open source Toolkit for Multiscale Images and Zoomable User Interfaces (ZUI).

58. PdfUtil
PdfUtil is a simple AS3 library based on AlivePDF, which helps to create PDF out of a complex component, Parse HTM.

59. popforge
The Popforge library is the sum of several free time and research activities. Each piece in its own a project itself.

60. queueloader-as3
QueueLoader is an actionscript library for sequential asset loading and monitoring which designed to be used with Actionscript 3.0.

61. redherring
RedHerring is a light duty HTTP proxy for AS3.

62. reflexutil
This open source utility allows Adobe Flex developers to debug and alter properties of components while running an application.

63. snackr
Snackr is an RSS feed ticker for Windows/Mac/Linux built with Adobe AIR and Flex.

64. splinklibrary
splinklibrary is an actionscript 3 library to ease the daily work.

65. splinkresource
splinkresource is an actionscript 3 resource loading framework which aims to ease the workflow with resources in actionscript3 multilanguage applications.

66. swfin
swfIN is a javascript toolkit for flash developers.

67. swiz
Swiz is a framework for Adobe Flex that aims to bring complete simplicity to RIA development. Swiz provides Inversion of Control, event handing, and simple life cycle for asynchronous remote methods. In contrast to other major frameworks for Flex, Swiz imposes no JEE patterns on your code, no repetitive folder layouts, and no boilerplate code on your development.

68. urlkit
UrlKit supports Adobe Flex applications that need to expose URLs and window titles in the browser to represent their state. These URLs can be bookmarked, accessed via the Back button, etc.

69. BabelFx
BabelFx is an open source localization framework for Flash & Flex RIAs. You can easily add the BabelFx engine to inject all localized content into your views, UI controls, and models.

70. flex-extensions
Flex-extensions provides a collection of useful Adobe Flex user interface components, charting controls and elements, behaviors, data types and utility classes and methods.



source

Obfuscate, Protect & Secure your ActionScript

SWF Encrypt™ 6.0 encrypts your Adobe Flash® SWF files, protecting them from the most popular Flash Decompiler Tools on the market. Secure your ActionScript today and prevent SWF Reverse Engineering and Decompiling. source

Monday, July 25, 2011

Flex Component: PanScrollingCanvas

I just found an awesome Canvas with Panning Scrolling .....with a nice effect.


The PanScrollingCanvas is a Flex container that scrolls its children on mouse move. Fully skinnable buttons appear when hovering over the container. The behavior of those buttons can be customized on the client side, by listening to events that this container will fire on button rollover, rollout, and click.


source

Wednesday, June 29, 2011

Drawable Canvas

The component itself is a transparent canvas (background alpha = 0), which means that you can put it on top of anything you like in order to be able to draw anywhere.
On the mouse down event I add a mouse move listener which adds points to an array, and I remove the listener on the mouse up event. These arrays are the lines.
In the updateDisplayList method I loop through all the held arrays and draw them onto the canvas.


source

Flex FlowBox Container

Awesome container i've been looking for!!!

A container which would lay its child components out in a horizontal manner like an HBox, but unlike an HBox, it needed to wrap the child components into a new row when they exceeded the available width. If the available height was exceeded, the container should then grow downwards if the height property has not been set to a constrained value. If the height is constrained, then scrollbars should appear


check out

source

Friday, June 24, 2011

Flex Share on twitter

//Twitter/Bit.Ly Share Imports
import flash.net.navigateToURL;
import mx.rpc.events.ResultEvent;
import mx.rpc.xml.SimpleXMLDecoder;
import mx.utils.ObjectUtil;


//Twitter/Bit.Ly Share Vars
private var bitLyLoader:URLLoader;


/*
* Call this function to share on twitter, passing your url trough bit.ly!
*/
private function twitterShare(articleUrl:String):void
{
// Insert your bit.ly account name & API Key bellow
var bitLyApiUrl:String = "http://api.bit.ly/v3/shorten?login=ACCOUNT NAME&apiKey=API KEY&longUrl="+articleUrl+"&format=xml";
var bitLyApi:URLRequest = new URLRequest(bitLyApiUrl);
bitLyLoader = new URLLoader(bitLyApi);
bitLyLoader.addEventListener(Event.COMPLETE, bitLyFinished);
}

/*
* Get the short link & post to twitter
*/
private function bitLyFinished(event:Event):void
{
// Lets decode the bit.ly answer!
var getLink:XMLDocument = new XMLDocument(bitLyLoader.data);
var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
var bitLyLink:Object = decoder.decodeXML(getLink);
// Insert your message bellow! Use %23 for trending topics! (Example: %23DigitalWorks)
var URL:String = "http://twitter.com/home?status=Currently reading "+bitLyLink+" %23DigitalWorks";
navigateToURL(new URLRequest(URL), '_blank');
}

Flex Share on facebook

/**
* Flex Share on facebook - quick & easy way
**/
public function ShareOnFacebook(shareUrl:String):void
{
var openUrl:String = "http://www.facebook.com/sharer.php?u="+shareUrl;
navigateToURL(new URLRequest(openUrl), '_blank');
}

Monday, June 6, 2011

scaleContent property is true, but the UILoader is not resized ?

Resizes the component to the requested size. If the scaleContent property is set to true, the UILoader is not resized.



import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
addChild(myUILoader);

function completeHandler(event:Event):void {
var uiLdr:UILoader = event.currentTarget as UILoader;
var image:DisplayObject = uiLdr.content as DisplayObject;
trace("UILoader:", uiLdr.width, uiLdr.height); // 100 100
trace("UILoader.content:", image.width, image.height); // 400 267
uiLdr.setSize(image.width, image.height);
uiLdr.move((stage.stageWidth - image.width) / 2, (stage.stageHeight - image.height) / 2);
}

Wednesday, April 13, 2011

Smoothing resized distorted images in flex

Problem: Images when loaded into flex look blurred, distorted or poor quality.

Solution: Fixing the loaded images using smoothing .


Hi guys , i think we all come across the problem of loading images into flex and disappointed by the way they look blurred or distorted in flex. By default images loaded into flex are not smooth.
I have written a small function that can be called on "complete" event of image loader component and rest you dont need to worry it takes care all . Above picture shows how clean image looks after after applying smoothing code .It even works if the image is zoomed or resized later .


//Mxml starts here




//call this function from where ever you need Image Smoothing .Code by http://askmeflash.com
private function smoothImage(evt:Event):void{
var myBitmap:Bitmap = ((evt.target as Image).content as Bitmap);
if (myBitmap != null) {
myBitmap.smoothing = true;>
}
}
]]>








//mxml ends here


Source:

Saturday, February 12, 2011

Removing the theme color from the Flex TileList

I have been looking for the solution ... Finally found it while searching the net.
Saved alot of time ...

Here it goes:

There have been a number of occasions when the designs for a UI implements some kind of grid layout to display its items. This is fairly simple to implement in flex by utilising the Flex TileList component. However more often than not the List's item renderers are required to look after their own states. In this case the TileLists Indicators are no longer required.

I have found the easiest way to remove the TileLists indicators is to set the ThemeColor to the background color of whatever the List is being displayed on. But what happens if the background contains an image or has a transparency value?

To do this you need to override the TileLists drawSelectionIndicator and drawHighlightIndicator methods.

**************************************************************

override protected function drawSelectionIndicator(
indicator:Sprite, x:Number, y:Number,
width:Number, height:Number, color:uint,
itemRenderer:IListItemRenderer):void
{
/* we don't need to do anything in here*/
}
override protected function drawHighlightIndicator(
indicator:Sprite, x:Number, y:Number,
width:Number, height:Number, color:uint,
itemRenderer:IListItemRenderer):void
{
/* we don't need to do anything in here*/
}


*************************************************************

Notice that the body to the above methods are empty. This is because we don't want the indicators to draw anything behind the renderers when the state changes.

Now just don't forget to cater for this inside your TileList's item renderer else the user will get confused as to which item is selected and which item their mouse is over. We wouldn't want that would we :)





Thanks for the solution
source

Freelance