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 [...]
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 [...]
Although Flex Builder and Eclipse do have nice debug utilities built in, today I needed a function/method in Actionscript to display into the current application some variables’ content. So I started to implement a var_dump alike function (var_dump from PHP language).
So I started and I made the Debug class that will implement the static dump [...]
In a previous article I explained how to use FIVe3D with Flex and because fl.motion is not included into the Flex Framework we had to find out a workaround. I commented out the lines that referenced fl.motion but Kelvin Luck found another way: “copy the classes from Flash CS3 Actionscript framework into the project”. So [...]
This will be a simple solution to be able to scroll to the last added row in a data grid. First of all I’ll explain what I mean and what I encountered when I needed to implement it.
The expected behavior is after adding a new row into a data grid, it should scroll to [...]
For some time I’ve been planning to use FIVe3D of Mathieu Badimon, in Flex, not in Flash. I’ve been trying to make it work but no success ’till now.
After more than 4, 5 tries, I’ve managed to take the example from the FIVe3D framework and implemented it in Flex. It was not an easy task [...]
In the last article I explained how to create an image surrounded by border. That article is a start for fixing the issue: “image doesn’t have border style”.
Now I extended even more the new ImageBorder component to be able to center it horizontally and vertically and still be well displayed.
Modifications were made in updateDisplayList method [...]
How to put border around an image? How to do that when you set only maxWidth and maxHeight? This is not an easy task. Googleing about my issue I found this, on Adobe’s LiveDocs (you must go at the end where comments are): a couple of helpful comments where Justin.Buser is, literally, drawing a rectangle [...]