Category 'D'


Adobe Flash Player 10 released in beta and Google Maps API

Update: see How to use Google Maps in Adobe Flash CS4

Update: it seems that Google is both wrong and instead of writing Flex wrote Flash! Moral of the situation in the Google Maps API was released only for Flex and Flash do not work in the environment: a demonstration of the confusion that these two "branches" (Flex / Flash) are causing! Read in this connection, it damn google get it right! the google map API for Flex is not Flash!

More ...

Google Maps: How to get Latitude and Longitude from an address

Also this time I reply to a comment with a post, given the general interest. Armando asked me if it was possible, using Google Maps, Latitude and Longitude obtained from a city name or street. The answer is yes! Through this service, Google Maps API geocoding service you can directly ask Google trasfromare our textual information (state, city, etc.) into geographic coordinates. You can try an online example directly on the site of documementazione Google.

More ...

Google AJAX Language API and prototype.js

After seeing the operation of the Google AJAX API has occurred to me an alternative way to translate our web pages Using realtime prototype.js , you can mark the HTML tags we want to translate, instead of subjecting the entire document to translation. : To mark the HTML tags I used to translate the attribute rel , setting it to translate :

1
"translate" > Questo testo deve essere tradotto < / p > < p rel = "translate"> This text should be translated </ p >

With a simple function, then we can use prototype.js to process all HTML tags with rel='translate' :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/ **
* @ Name: translate ()
* @ Description: translate
* /
function translate () {
) . each ( $ $ ('[Rel = "translate"]'). Each (
e ) { function (s) {
( e. innerHTML , 'it' , 'en' , google. language. translate (e. innerHTML, 'en', 'en',
result ) { function (result) {
result. translation ) { if (result. translation) {
result. translation ; and. innerHTML = result. translation;
{ Else {}
'Translate Error! \n \n ' + result. error . message ) ; alert ('Translate Error \ n \ n' + result. error. message);
}
}
);
}
);
}

You can see this in action on e-lementi.com

Obviously, the script can (and / or should) be refined as appropriate. . It is interesting to note, however, that it is possible specializzarlo so as to replace the images (in the case of buttons in graphics that contain text) or made ​​to develop special TAG as INPUT or TEXTAREA .

One of the limitations that I encountered, I would like to deepen, the number of characters that can be translated. In case of important texts, in fact, it is difficult to get an error: that in fact I run the script with an alert() .

More ...

Google AJAX Language API tutorial on the operation

I respond with this post, at the request of Andrea on how to insert the translator of Google in its web. There are several ways to take advantage of machine translation services available from Google and elsewhere. We can use plugins written by others, a simple JavaScript script from Google itself or mixed learning to use the API, ie a set of callable functions - as we shall see - in various ways.

Plugin

I will not dwell on this solution, as I think is not really relevant to the request of Andrew , if I understood well. It is also a solution sostanzialemente valid only for the blog and not for individual use and generic. I can only point out to users WordPress , Global Translator , perhaps the most simple, practical and popular plugins of this type.

Script Ready by Google

The easiest way to translate your website or your blog is to add a simple JavaScript script provided by Google. Just go to the site translate.google.com tab and click on 'Tools'. From this page you can preset the translation functions or leave the default. The script is very simple:

1

and as a result is obtained:

Google Translate

More ...

AS3Corelib: library for MD5, SHA1 and JPG / PNG Encoder

AS3corelib project is a library written in ActionScript 3, which contains a series of classes and utilities to expand the development with ActionScript 3. It includes support for MD5 and SHA 1, encoders for JPG and PNG, and JSON serialization for strings, numbers and dates APIs. Libreia This is very useful in the development of Flash applications and able to give it its best coupled with Adobe AIR!

Of the various packages present the most interesting are com.adobe.crypto and com.adobe.images. The first allows you to manage encodings MD5, SHA1, SHA224 and SHA256, so very simple: using the method hash() is passed the string and returns the source-coding! The package even allows images to get the JPG or PNG encoder from a simple bitmap Flash!

1
encode ( image : BitmapData ) : ByteArray public function encode (image: BitmapData ): ByteArray

The result ByteArray representing the JPG encoding that allows Flash, can be saved to disk by directly! To learn more you can follow this tutorial video on how to save a PNG image - from a video object - on disc by as3corelib .

More ...

Dynamic HTML with Prototype: styles and scripts

Over a year ago I wrote a post ( Dynamic HTML with JavaScript ) which illustrated some techniques to dynamically add stylesheets and scripts in an HTML page loaded. Who uses prototype.js can greatly simplify life by using, for example:

1
2
3
4
5
6
"dom:loaded" , document. observe ("dom: loaded",
function () {
new Element ( "script" , { type : "text/javascript" , src : "/js/altro.js" } ) ; var script = new Element ("script", {type: "text / javascript" src: "/ js / altro.js"});
) [ 0 ] . insert ( script ) ; $ $ ('Head') [0]. Insert (script);
}
);

After the page is loaded ( document.observe ) adds a new script JavaScript! For styles that is exactly the same thing!

More ...

Google Translate is updated

Just a few days ago I wrote a post on machine translation , addressing the issue of sites and / or multi-language blog from my point of view of the developer. I have received, in fact, some interesting comments that underscore the limits of current technologies. In fact, systems that allow you to translate "on the fly" our Web pages, like Google Translate , produce absolutely no results comparable to that of humans, who - well - the profession to practice their profession of translator. Additionally, there is a specialization of these public systems: translating a scientific text in English and different from translating a novel in English or a manual computer and so on. This, with a translation of "human" we know that it happens and translators are just professionisto specialize in very specific areas.

However, as I said (in private mail being dense) to Leonardo , there are cases in which an automatic translator, especially with the advent of blogs, can reduce time and costs by allowing, within the limits of current machine translation systems, at least in their own language to understand what is written on the Web

image Just this week Google Translate has updated its online translation system, aggiugendo support for many, if not all, of the languages ​​of the world: from China to the Japanese and many other greek. The interface has renewed proponedo pull-down menus to make it easier to choose the source language and the term "translation".

More ...

Variable arguments and defaults in Javascript, Actionscript and PHP

Who develops knows that one of the characteristics of functions ( function () ) is to have or not the input arguments. It can happen, sometimes you have to write a function that, based on input parameters, behaves differently (in OO programming this behavior are referred to as polymorphism). Variable parameters (varargs), already introduced at the time of the present by default in C and classical statement of the main :

1
int main (int argc, char * argv []);

More ...

Papervision3D: Bitmap handle like FIVe3D

Starting from the example shown in FIVe3D: treat the Bitmap , we see how to achieve the same effect using Papervision3D 2.0 (Great White), so as to continue to analyze the functioning of this beta Great White.

Flash Player Loading ...

More ...

FIVe3D: treat Bitmap

With release 2.1 of FIVe3D you can also manipulate objects Bitmap , so as to overcome the initial limitation of this library only vector. e ruotarlo a nostro piacimento: If we include a Bitmap in the library and esprotiamo so you can create an instance dynamically using ActionScript, you can easily create an object Bitmap3D and rotate at will:

Flash Player Loading ...

More ...



Stop SOPA