A couple of Prototype Ports for ActionScript
10
A small example demonstrating inheritance in Javascript, complete with calling base class constructors and methods. For the more detailed description, visit http://www.adampresley.com.
16
A simple AJAX class. The code for the class is provided as well as example HTML and PHP code for usage.
9
Unobtrusive Show/Hide
9
Unobtrusive Kilometer/Mile Converte
6
I think that the problem comes when you populate a DataGrid's dataProvider with data from a a remoting call, such as a RecordSet returned from AMFPHP. The remoting protocol doesn't remember the datatype of each database column, so once you get the RecordSet back to ActionScript everything has become a String. You could go to the trouble of casting every numeric column's contents in the RecordSet to a Number so that the DataGrid will sort those columns numerically (1, 2, 3, ...) rather than lexicographically (1, 10, 11, ..., 2, 20, ...)... or you could throw this quick little function in and tell it which columns you consider numeric. It will replace the default sorting behavior with one that casts to numbers before comparing, when dealing in the columns you specify. Pass it an array of the columns' indices and the DataGrid in question. Non-numeric strings in the columns you specify will get treated as 0 and left unsorted at the top.
8
Return a random number within a gived range
5
MovingParts
so you executed a query that took .5 second to execute and you want to bind that to a windows control. next you decide that you will need to have two controls bound to the same datasource. not a problem, except when you do this:
control1.datasource = datatable
control2.datasource = datatable
you notice that each control mirrors the other and you cannot pick two seperate and distinct values.
one way to solve this is to create two datatables and execute the query twice. unfortunately this now doubles your query time. bad idea.
here is the elegant solution...
control1.datasource = datatable
control2.datasource = datatable
you notice that each control mirrors the other and you cannot pick two seperate and distinct values.
one way to solve this is to create two datatables and execute the query twice. unfortunately this now doubles your query time. bad idea.
here is the elegant solution...
10
Highlight table row on rollover.
8
An easy way to hide and show div's using Javascript and CSS.
Basically just a slight variation on this script by Real Gagnon.
Basically just a slight variation on this script by Real Gagnon.









