BTA Flexing

My passion RIAs…………..Shardul Singh Bartwal

Archive for the ‘ActionScript 3.0’ Category

Adding a device simulator(emulator) to Flash Builder 4.6

Posted by shardulbartwal on March 4, 2012

If you are having one such device for which you are planing to make the mobile application and you are not having it by default in the list of emulators in Flash builder 4.6.At that point you can just add your desired mobile to the list of emulators.It can be just achieve by the couples of mouse clicks.Simply go to the Window>Preferences>Flash Builder>Device Configurations
And click on the “Add” button. Then fill the detail of the your preferred mobile set.Attaching the screen shot.

add device emulator to Flash builder 4.6

After applying the settings you will be see this on the list of the emulators and you can use this.

Hope this will help someone……………………….

Posted in ActionScript 3.0, Adobe AIR 3.0, AIR, Flash Builder 4.6, Mobile Applications with Adobe AIR | Tagged: , , , , , | 1 Comment »

Flash,Flex Vs HTML 5

Posted by shardulbartwal on February 25, 2012

I was checking the HTML 5 with Java script,CSS 3 and Jquery around since last 4 months.Also was keeping my eyes on this since 2008,but never get inspired to do anything.Now also I found that HTML 5 is still in the state where Flash was 7 to 8 years back.HTML 5 can replace maximum of simple banners and animated advertisements which were created using the flash.For that also the development cost is going to increase and quality will be not up to that extent as the Flash has provided long earlier.

But for the Audio/Video Streaming,Image manipulation,Gaming and Enterprise applications HTML5 needs to take still around 10 years.Also currently I don’t found any thing as impressive as AMF for the Client Server communication over the internet.The reason for this is simply that HTML 5 is also a markup language.You can check the link below,you will realize where the HTML 5 is in reality:-

http://www.w3.org/TR/html5-diff/

So the only thing which I will like to say is that Flash and HTML 5 will be needed in the same way
as earlier they were used together on the web.If you will try to replace Flash by HTML 5 for the small
purpose then you have to pay lot more then flash.And if you will be trying to create the Enterprise Application with HTML 5 then I think you will come back to Flex one day.Flash player is ruling since last 15 plus years,its not so simple to replace that.

Keep Rocking………..

Posted in ActionScript 3.0, Flex, Flex 3.0, Uncategorized | 3 Comments »

Using charts inside Mobile Applications with Adobe AIR

Posted by shardulbartwal on January 30, 2012

I was in a big doubt since very long time,I was waiting for the new version of the Charts under the Spark Components,so that I can use them inside the mobile applications.But I was surprised also that why there is nothing for this in the Spark components.But Yesterday I just checked with the MX Charts components in my mobile application for a demo on my Samsung mobile,and things were working excellent and smooth.Was happy and surprised also that how is it is it possible?. Later on started to search on the net for this.And found it on my first click.It was clearly mention there at http://www.adobe.com/devnet/flex/articles/mobile-development-flex-flashbuilder.html#articlecontentAdobe_numberedheader_1 by Narciso Jaramillo long long ago that:-.

Charts are supported in mobile projects, but other MX components are not. We don’t recommend using MX components in mobile projects; use the Spark components instead. The one exception is the charting components, which are usable in mobile projects if care is taken to avoid displaying or animating too much data at once.

So finally I have to made myself satisfy with ‘Better late than never.’
Hence sharing it,hope this can help someone.

Keep Rocking………..

Posted in ActionScript 3.0, AIR, Flash Builder 4.6, Flex, Mobile Applications with Adobe AIR | 4 Comments »

Captive Runtime a Excellent Feature for Mobile Applications via Adobe AIR

Posted by shardulbartwal on January 30, 2012

I hope you all will be aware of the Captive Run-time.This is nothing else but a installer of the application which will be already containing the AIR Run-time inside this.Just used the on my Samsung handset with creating a demo application.Its nice to see how cool it is,no need of the installation of the AIR separately.Its surely an excellent feature.
No doubts the size of the your output format is going to be increase by around 8 MB.
But As per my concern the size of big installer is not going to come in between anyway.
Now you can make your clients more happy by providing them the merged AIR Run-time.No need to install AIR separately.

Enjoy Flexing………….

Posted in ActionScript 3.0, Flash Builder 4.6, Mobile Applications with Adobe AIR | Leave a Comment »

Long list of Simulators in Flash Builder 4.6 For Mobile Application Development

Posted by shardulbartwal on January 30, 2012

I remember the installation of my first android base simulator which I have used to check my first AIR application to run on Android platform,creating the output format form the command prompt then installing the AIR on that etc. etc.But how simple now the things are.There is already a inbuilt long list of the simulators is inside the Flash Builder itself.Which is giving extreme experience for playing and check the application’s appearance on different devices.Only for the Android platform there are around 30 model’s simulators of HTC are available.It is having the 10 simulators for the different models of the Motorola and 9 for the Samsung.Google Nexus one,Google
Nexus S,Dell Streak 7,Barnes and Nobel Nook Color all are making the list complete.
Simulator for the Apple iPhone 4,Apple iPad and BlackBerry PlayBook are also there.

Target what ever platform you want to choose and enjoy the mobile application with the Adobe AIR.

Enjoy Flexing…………

Posted in ActionScript 3.0, Flash Builder 4.6, Mobile Applications with Adobe AIR | Leave a Comment »

Official Flex User Group Tour date announcement started by Adobe

Posted by shardulbartwal on January 29, 2012

Its nice to see that adobe has started their International Flex User Group Tour
to discuss their last year ends announcements about Flex and Flash Platform.They
have announced the dates for the North America.

Schedule can be checked at:-

http://blogs.adobe.com/flex/2012/01/announcing-flex-user-group-2012-tour-north-america-dates.html

Waiting for the turn of Asia including India.

Enjoy Flexing…….
Shardul

Posted in ActionScript 3.0, AIR, Flex, Flex 3.0, Flex 4 | Leave a Comment »

Unit Testing in Flex 4 application Using Flash-Builder 4

Posted by shardulbartwal on June 30, 2011

Inside the Flash builder 4 simply create a new Flex project,I am naming it as UnitTestingDemo.
1)I have created a class with name MyMath.as under the folder the utils,I am putting it inside the utils just for practice.
Which is as below:-

package utils
{
public class MyMath
{
public function MyMath()
{
}

public function add(num1 : Number,num2 : Number) : Number
{
return num1 + num2;
}

public function multiply(num1 : Number,num2 : Number) : Number
{
return num1 * num2;
}
}
}

2)Now go to File>New>Test Case Class

1

3)Now I am createing a class with name MyTestCase1. See below:-
2

Click on the Browser button.

4)It will look as :-
3
Select the MyMath and click OK as below:-

Now it should look like:-
4

click on Next button.You will see like below:-
5

Click Finish.

5)Now on the Package Explorer on the left you will MyTestCase1.as under the folder flexUnitTests.You will see there a method with name testAdd() inside this class.

Now I am going to check for my expected positive result from this method.As we know that 5+6=11.So I have written like this inside this method:-

var myMath : MyMath = new MyMath();
Assert.assertEquals(myMath.add(5,6),11);

6)Now Click on the MyTestCase1.as and select it on the left side Package Explorer.Right Mouse click on this.You will see there a menu with title ‘Execute Flex UnitTests’ click on this.If every thing goes well you will see like below in your browser:-

6

Except this inside flash builder you will see a tab with title ‘FlexUnit Results’ Explore this for detail investigation.

Enjoy Flexing………….. :)

Posted in ActionScript 3.0, Flex, Flex 4 | Leave a Comment »

Using old Flex 3 Component’s Properties in Flex 4

Posted by shardulbartwal on December 26, 2010

Some time we wants to create the flex 4 application which requires the
same set of properties etc which were there in flex 3 based component e.g.
backgroundAlpha with TextInput .In other words we can say that one wants
to update flex 3 application to flex 4 without using the spark or new flex 4
based components.The things are clear that in that case you are simply looking
for the all mxml library of the flex 3.Because the mxml based components of flex 4
are lacking many old properties of flex 3.If you are looking for those all properties
of flex 3 then to achieve it is very simple.Simply go to the properties of your project.
Then go to the ‘Flex Build Path’,there you will see tab with heading ‘Library Path’,select
the Radio button ‘Mx only’ and click OK.You have done it,you will get all the properties
of all flex 3 based components in flex 4,e.g. ‘backgroundAlpha’ of ””.
Hope you will like this………

Enjoy Flexing……..

Posted in ActionScript 3.0, Flex 4 | 2 Comments »

Protected: Bitmap Text in ActionScript 3.0

Posted by shardulbartwal on November 12, 2010

This post is password protected. To view it please enter your password below:

Posted in ActionScript 3.0, Flex 3.0 | Enter your password to view comments.

Byte Array to BitmapData and BitmapData to Byte array in Flex 3.

Posted by shardulbartwal on October 14, 2010

In the code below I am initially getting the byte array of my canvas with the increased size. Converting it into Bitmap data.And again converting that Bitmap data into ByteArray. So that you can use the particular step which one you require.

</pre>
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>
<![CDATA[
import mx.controls.Alert;

import mx.graphics.ImageSnapshot;
import mx.graphics.codec.JPEGEncoder;

private var imageSnapshot:ImageSnapshot
private function inLargeImage():void
{
var jPEGEncoder:JPEGEncoder = new JPEGEncoder(90);
imageSnapshot = ImageSnapshot.captureImage(imgCanvas,500, jPEGEncoder,true);

//imageSnapshot.data is ByteArray.
byteArrayToBitmapData(imageSnapshot.data);
}

private var loader : Loader = new Loader();
private function byteArrayToBitmapData(byteArray : ByteArray):void
{
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, getBitmapData);
loader.loadBytes(byteArray);
}
private var bitmapData:BitmapData
private function getBitmapData(e:Event):void {
var content:* = loader.content;
bitmapData = new BitmapData(content.width,content.height,true,0x00000000);

var matrix:Matrix = new Matrix();
bitmapData.draw(content, matrix,null,null,null,true);
targetImage.source = new Bitmap( bitmapData );

}

private function saveInLargeImage() : void
{
if(bitmapData == null)
{
Alert.show("InLarge Image first,and then try again.")
return;
}

var encoder:JPEGEncoder = new JPEGEncoder(90);
var byteArray:ByteArray = encoder.encode(bitmapData);
var fr : FileReference= new FileReference();
fr.save(byteArray,'abcd.jpg');
}

]]>
</mx:Script>

<mx:VBox horizontalAlign="center" verticalAlign="middle" width="100%" height="100%">
<mx:VBox id="imgCanvas" width="600" height="450" horizontalAlign="center"
verticalAlign="middle" backgroundColor="0x0000FF">
<mx:Image source="image1.jpg"/>
</mx:VBox>

<mx:Image id="targetImage"/>

<mx:Button click="inLargeImage()" label="Inlarge Image"/>
<mx:Button label="Save To Your Computer" click="saveInLargeImage()"/>
</mx:VBox>

</mx:Application>
<pre>

Hope you will enjoy this……..

Posted in ActionScript 3.0, Flex 3.0, Uncategorized | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.