« March 2004 | Inicio | May 2004 »

April 30, 2004

Button handler follow-up

A few weeks ago, I posted about the problem we were having, here at the office, with some buttons.

The feedback was great, but we decided to go on implementing the "solution" we found, just because of the few time we had.

But finally, we've had to make some changes in some buttons that are part of a modal dialog we are building

So, now we have a movieclip with three frames, labeled "normal", "over", and "click". The movieclip contains a textfield named "literal". We want to be able to assign the textfield contents, its format, and the onRelease handler, but we need to set that handler from a different point of the program execution ( I mean, we set the label text when the application initializes, but we set the onRelease handler depending on the execution flow )

So the button handler class is:

class net.designnation.UI.buttonHandler { public static function setBTHandlers( buttonInstance: MovieClip, texto: String ) { buttonInstance[ "textoParam" ] = texto; buttonInstance[ "literal" ].text = texto; buttonInstance.onRollOver = function( ) { this.gotoAndStop( "over" ); var theInstance: String = ""; this[ "literal" ].text = this[ "textoParam" ]; }; buttonInstance.onRollOut = function( texto ) { this.gotoAndStop( "normal" ); this[ "literal" ].text = this[ "textoParam" ]; }; buttonInstance.onPress = function( texto ) { this.gotoAndStop( "click" ); this[ "literal" ].text = this[ "textoParam" ]; }; } public static function setNewTextFormat( buttonInstance: MovieClip, format: TextFormat ) { buttonInstance.literal.setNewTextFormat( format ); } public static function setTextFormat( buttonInstance: MovieClip, format: TextFormat ) { buttonInstance.literal.setTextFormat( format ); } public static function setOnRelease( buttonInstance: MovieClip, value: Function ) { buttonInstance._onRelease = value; buttonInstance.onRelease = function () { this._onRelease( ); this.gotoAndStop( "normal" ); } } }

Have a nice weekend!

[OT] we are 25, UE is growing

This is a special weekend for a large number of european citycens. Since tomorrow, the European Union will have 25 countries members. 10 new members.
I still remember when Spain ( and Portugal ) came to the UE ( at this moment, it was the European Economic Communitty, and the Euro was the ECU ). I was 9 years old, but i remember the month before, everyone spoke about that.
After that, the UE has bring to us, good things and bad things. In fact, much of us are really really disappointed with a large number of issues with the UE, but, we feel europeans after all.
So, if you are from any of this new countrys,...WELLCOME!

April 19, 2004

Bloggin’nation 0.1: A Central application

This is the first beta of Blogin’ nation, a Central application to post to your Movable Type installation. It uses the Movable Type xmlrpc API.

The application has been developed in AS2, and the source code will be released as soon as we fix the bugs that may appear, and add a few more things.

We’ve been working on this for some time, and now that we are close to finishing it, we’d like to know your opinion, and receive your feedback about the functionalities you’d like to see, usability issues, …. You can leave your comments here, or send us an e-mail to: blog@design-nation.net

Right now, it can only be used to post, and not to edit your recent post, although that functionality is developed, but not implemented yet.

Known bugs and issues:

- I don’t know if it’s due to a problem in our code, or in the MT xmlrpc API, but the special characters ( á, é, í,…. ) are not properly displayed when the post is published. This is our main concern, in part because we are Spanish, so we can’t even use the app to post to our Spanish blog… 
- There’s no connection checking, so the app assumes that the connection exists.
- There’s no tabulation management, so you can’t pass from one text input to another using the tab key.
- There’s no ping an trackback management yet.
- There’s a general lack of visual feedback ( at least for an average user )

What are we working on?

- Multilanguage support. All the app texts well be saved on external xml files, so the user could choose the interface language.
- Edition. It’s almost finished.

Obviously, there are better choices ( like Zempt ), but this is something we started just to see how far we could go with Central, and well, here are the first results.

We'd like to thank specially Celia Carracedo for the application icon.

The xmlrpc api is located in the movable type default installation folder. It's a file named mt-xmlrpc.cgi

Net Art. I need your help

Next saturday morning, i must give a conference ( representing my enterprise ) to a group of artists on Vitoria-Gasteiz. The topic of the conference is "art and internet". These artists are very differents, some of them make art with computers, some of then have never used a computes. The conference is 6 hours long ( yes 6 hours ). So i ask you for links of sites related to art. It may be something like web-side or something simple. In fact, i want to show him that there is no need of an superweb to show his/her work ( i.e. my favourite photographer Sebastiao Salgado, has some of the best photos i ever seen but his web site is really simple . So, if you can tell me web-sites of artist ( no matter what kind of artist ) or theory about art or..... Tahnks,

April 13, 2004

Button weirdness

The last time I had to work with buttons was at least two years ago, but today at work, we have received some graphic assets from a freelance designer, that has provided us with a lot of buttons.

These buttons have a textfield inside, and there are two different textfields, one for the "normal" state, and another for the "over state. So I wrote the following code to assign that dynamic fields text ( where "tf" is the textfield )

class net.designnation.UI.buttonHandler { public static function setHandlers( instanceName: MovieClip, text: String ) { instanceName[ "theText" ] = text; instanceName.onRollOver = function( ) { this.tf.text = this[ "theText" ]; } instanceName.onRollOut = function( ) { this.tf.text = this[ "theText" ]; } } }

It didn't work. So, I tried to trace the buton contents:

class net.designnation.UI.buttonHandler { public static function setHandlers( instanceName: MovieClip, text: String ) { instanceName[ "theText" ] = text; instanceName.onRollOver = function( ) { for ( var k in this ) { trace( k ); } this.tf.text = this[ "theText" ]; } instanceName.onRollOut = function( ) { this.tf.text = this[ "theText" ]; } } }

And here came my surprise. Maybe this is well know to all of you, but the result of the trace command was:


So, there was the textfield: instance2. But, when I rolled out, it traced "instance3". And when I rolled over again, it traced "instance4", and so on. It only happens when there are two different textfields. If there's only one textfield for all the button's states it always traces "instance1"

It was the first time I saw it, so it surprised me. By the way, the final solution was as easy as it seems ( althoguh it relies on something really weird ):

class net.designnation.UI.buttonHandler { public static function setHandlers( instanceName: MovieClip, text: String ) { instanceName[ "theText" ] = text; instanceName.onRollOver = function( ) { for ( var k in this ) { if ( k.substring( 0,8 )== "instance" && k.text != undefined ) { this[ k ].text = this[ "theText" ]; } } } instanceName.onRollOut = function( ) { for ( var k in this ) { if ( k.substring( 0,8 )== "instance" && k.text != undefined ) { this[ k ].text = this[ "theText" ]; } } } } }

But, how much time will it work?. I don't know

At least, I've found another reason to not use buttons, and use movieclips instead

April 11, 2004

My first two months

I started in my current work two months ago ( in fact my first day was on februray the second ). Since then i have no post anything. Why? because, i have no time at work and because i have no internet at home ( new work, new city ).
Well, the city: Vitoria-Gasteiz. I like it. little but wonderfull city. Plenty of all kind of resources, including one of the best europeans basket teams. ( TAU-Vitoria )
Work: Fine. I am in some projects involving PHP, ASP, ActionScript, XML and Flash Communication Server. Some of this projects including make flash games ( some of then multiplayer via the internet ) so it's funny and interesting.
At same time, i have to work closely with this guys who make animations ( in spanish animadores, in english i don`t know ), and it's very funny.
And if we speak about web sites, the current idea of the enterprise is to do all websites with CSS layouts and XHTML, according to standars, and accesible by any kind of people or devices ( mobile devices, braille printers, aural browsers....) so it´s quite interesting. I'm learning a lot.

April 06, 2004

Hash Table V2

About a month ago, I released an implementation of a Hash map ( or hash table ). Yesterday I found a bug when trying to delete an item under certain conditions, so here's the fix.

At the same time, I've made a few improvements.

You can see the original post here

And, of course, you can download the mxp file here

Happy easter! ( if it's a holiday for you, of course )