Monday, September 11, 2006

Flash add to del.icio.us


The usual way to have the "add to del.icio.us" option on a website is using html calling a pop-up window with the "post" page from del.icio.us passing a couple of variables to help filling in the form.

Using flash is the same, is just a matter of calling a pop-up and passing the value of the variables...
As you can see on the example on the right side of my blog, when pressing the del.icio.us flash button, it opens the "post" page with two text boxes already filled.

What I did is:
- Created a button on the stage with instance name "add2delicious" and on another layer put the following actionscript:

add2delicious.onPress = function() {
getURL("javascript:void(window.open
('http://del.icio.us/post?url=http://overloadstudios.blogspot.com
&title=Ernesto Quezada s Blog','popup','toolbar=no,
location=no,status=no,menubar=no, scrollbars=no,resizable=no,
width=700,height=400'))");
};

- Publish your swf for flash player 7 as for flash player 8 the pop-up just doesn't work;
and that's it!
I had to take out the single quote in "Ernesto Quezada's Blog" as the single quote is a restricted character on this script.

Salut!

1 comment:

Ernesto said...

After this post I continued experimenting and ended up with a free
Add to delicious flash button

salut!