Last week I had to write a small piece of code to send to a webservice a number from a text input. All was fine for the normal test values (0,1,100). The problem appeared when I tried to send the number -9223372036854775808. Instead of receiving this number I got -9223372036854776000. So I started to do [...]
Some time ago I received a very interesting and challenging algorithmic exercise. It is based on Fibonacci numbers. And here it is…
We have the following sequence:
a
b
ab
bab
abbab
bababbab
abbabbababbab
bababbababbabbababbab
abbabbababbabbababbababbabbababbab
In words it si like this: the Nth line is (N-2)th line concatenated with (N-1)th line where N is starting from 2. So the second line is line 0 + [...]
This is a small working example about how to use an image as a background for a canvas, and how to crop and resize images. I’m sure that there are different approaches to this issue, so you are welcome to add your own solutions.
In order to crop the initial image, that was already [...]
This was a tricky issue… but solvable. I needed to found a way to collapse the left panel of a HDividedBox. This can be easily done by using moveDividerTo() method or setting getDividerAt().x (for vertical getDividerAt().y) property to the desired value. The problem is this: if you want to collapse the left at double click [...]
Yesterday I’ve been working with images: loading, resizing, removing, etc. I got into a challenging issue: I had to vertically position a label after an image resize – but a resize that is triggered by setting maxWidth and maxHeight keeping also the aspect ratio.
I tried to get the new width and height after the resize [...]
These day I’ve been fighting with this issue: trying to get the Flexer XML feed from FeedBurner into a Flex application. As many of you may know FeedBurner serves the XML with an XSL and browsers that know XSL will parse it and display it in a nicer way that a simple xml.
The problem is [...]
New Rich Internet Application is out on the market – Pixlr, a web based image editor, was launched on 17th of August 2008! The most interesting thing is that is created by one person and is by far the closest image editor to Photoshop. Pixlr has layers, filters, adjusments, brushes, etc.
What can we say: WOW! [...]
Today I needed to found a way to create bitmap data object from a display object. I found a solution in Flex Cookbook (http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=1682) and having this I improved it and made it simpler.
The code follows…
public function makeBitmap(myDO:DisplayObject):BitmapData
{
var myBD:BitmapData = new BitmapData(myDO.width, myDO.height);
myBD.draw(myDO);
[...]
In the previous article I explained how to use Yahoo! Maps. Now I’ll explain how to create a custom marker and how to place it on the map. This is not an easy task because on Yahoo! Developer Network (YDN) there is not enough documentation regarding Yahoo! Maps API for AS3. Take a look at [...]
This article will explain how to create a wildcard search. What I mean is the following:
dir *.*
or
dir myfile??.txt
The old DOS searching way. The first command (if you’ll run them in Command Prompt) returns all files with extension from the current folder. The second command will return any file having its name as this: [...]
This is a very helpful piece of code. Function to escape all regular expression special chars. I came to this string having this order of characters by trial and error. So now you can use it easily by copy and paste.
What is important to know that MXML and Actionscript compiler do automatically escapes backslashes (“\”) [...]
This article will explain how to integrate the Yahoo! Maps into your Flex application. Is important to know that in this we are using Flex Builder 3 and that the example and the code won’t work in Flex Builder 2 (it seems that in Flex Builder 2 there are some compiling problems with the SWC [...]
If you need to find the length of an object, and I mean the number of children of the specified object, use the following function/method:
public static function getLength(o:Object):uint
{
var len:uint = 0;
for (var item:* in o)
if (item != "mx_internal_uid")
[...]
MatrixGrid is a complex component I made that displays a bi-dimensional array and gives the possibility to change its values using combo boxes. These are the changes you can do:
change one single item
change one row at once
change one column at once
The MatrixGrid component receives for objects:
array with the possible values in each combo box
the [...]
Today I found a new 3D engine: AS3 ROXIK Sharikura 3D Library. It is great from what I could see from their demos. Interesting is this demo where you can add more and more object to the animation but the animation is not jerky.
The library at this moment is not released but Masayuki Kido [...]