Mouse Wheel Issue AS3

While implementing Mouse Wheel in as3 I got some issue

1. When I compile from flash cs5 then the swf doesnot fire event of mouse wheel but that worked when I publish.

2. I am using a code less mouse then also it doesnot fire mouse wheel event.

Would be great if any one have some suggestion on this.

UnknownHostException Error – Android

If you are facing this error while making any server call.

Add <uses-permission android:name=”android.permission.INTERNET” /> tag just before Application tag.

 

:) njoy coding.

Gestures On Mobile

Zoom Gesture

Pinch to zoom in and zoom out on image or maps.

Multitouch.inputMode = MultitouchInputMode.GESTURE;

stage.addEventListener(TransformGestureEvent.GESTURE_ZOOM,zoomHandler);

private function zoomHandler(evt:TransformGestureEvent):void{

// previewImage is the container of image/map anything

previewImage.scaleX *= evt.scaleX;

previewImage.scaleY *= evt.scaleY;

}

Will be posting on more Gestures and Touch Events. Feel free for comments / suggestions :)

 

binodonline.com @ keyrow.com

Felling gud to see :)

Scroller Spark Component – Flex 4.5

Scroller component is the component which is bydefault configured with horizontal and vertical scrollers. If the content of this component is in more area than that of scroller then the content will be able to scroller up/ down or side wise to have proper look of the content. Lets have a look on the example.

<s:Scroller id=”scroller” x=”0″ y=”45″ width=”320″ height=”410″>
<s:Group>
<s:Image id=”previewImage” x=”0″ y=”0″ width=”620″ height=”810″ source=”bird.png” cacheAsBitmap=”true” />
</s:Group>
</s:Scroller>

Feel free to post queries. :)

ItemRenderer in Flex 4.5

We can say item renderer as custom component, which we can define by our own. We can set it properties , can add image , text, label and all that can be done dynamic too.

Let say we can have a list and its dataprovider will be array collection , its itemRenderer will be our custom item renderer and will be behaving according to our properties.

Eg. Lets consider we have a array collection (_arrayColl) with five elements  which contains objects having a label and an icon image.

Each object have properties like  : -  obj.name = “My computer”; obj.icon =”myComp.png”;

Lets define ItemRenderer  first : – listRenderer.mxml

<?xml version=”1.0″ encoding=”utf-8″?>
<s:ItemRenderer xmlns:fx=”http://ns.adobe.com/mxml/2009″ xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:views=”views.*” width=”295″ height=”44″ >
<s:Label id=”name” x=”3″ y=”13″ enabled=”false” fontFamily=”Arial” text=”{data.name}” />
<s:Image  x=”237″ y=”13″ source=”{data.icon}” />
</s:ItemRenderer>

 

Now above mxml can be called inside list as : -

<s:List id=”dlist” x=”12″ y=”171″ width=”295″ height=”216″ dataProvider=”{_arrayColl}”
itemRenderer=”listRenderer” />

 

Now we are done : You can see your list showing the data correctly with five items.

Feel free to put comments.

Getting browser name in Flash

To get the browser name in flash , let say in click of a button and display it in a text field

btnMC.addEventListener(MouseEvent.CLICK,btnClicked){

var browser:String = getBrowserName();

txtField.text = browser;

}

function getBrowerName():String{

var browser:String;
var browserAgent:String = ExternalInterface.call(“function getBrowser(){return navigator.userAgent;}”);
if(browserAgent != null && browserAgent.indexOf(“Firefox”) >= 0) {
browser = “Firefox”;
}
else if(browserAgent != null && browserAgent.indexOf(“Safari”) >= 0){
browser = “Safari”;
}
else if(browserAgent != null && browserAgent.indexOf(“MSIE”) >= 0){
browser = “IE”;
}
else if(browserAgent != null && browserAgent.indexOf(“Opera”) >= 0){
browser = “Opera”;
}
else {
browser = “Undefined”;
}
return (browser);

}

 

njoy :) ………..

Flash Based Process Designer

The latest version of Interstage Business Process Manager (version 10.0) from Fujitsu uses flash based editor for creating and editing process definitions, process Instances as well as viewing of the process definitions and process instances. Enhansement to version 10.0 is under progress,  now you can find some more icons on the pallete as compared to 10.0 in version 10.1.

Loading External image files — Flash CS3

One of the improvements made in AS3 is how you load external content into your application. Some of the new changes make it easier for you to initiate and measure the progress of a download – something which was always a bit of a challenge in the AS2 world.

To load suppose an image(png file) to flash content or to a movieclip which is added in runtime. Let the image file be bird.png into a movieclip imageHolderMC. And imageHolderMC is on the stage or you have added that to stage.

var imgPath = “bird.png”;

var loader:Loader = new Loader();

var request:URLRequest = new URLRequest(imgPath);

loader.load(request);

imageHolderMC.addChild(loader);

:- Now you can see that the image is loaded into imageHolderMC. It is same as we doing loadMovie in AS2.

Njoy…………..

Vaishnodevi Shrine – Tour India

I have been planning to visit this holy place since I came to chandigarh i.e from 2006  and people use to say that ” Jab mata ka bulawa aata hai kabhi koi wahan ja pata hai.”. Means when goddess call then only you can visit this holy place. So I hope on 13th Dec of 2008 she called me and my wife… At first I was in thinking what to do there where to go where to live this and that but we reached there you cant believe everying was clear what to do.

How to reach there :- For going to Vaishnodevi Shrine U can reach to Jammu by train or flight from there 1 hour bus journey to Katra. Then from there by walking for around 13 km U can reach to main Shrine. In between the walking journey will find everythig food, shelter and what ever you want.

What I liked There :- Everything Everything….

Any queries about this just put your queries here I will be writing for you….  :) njoy….