Category 'Tutorials'


CountDown with 3D FIVe3D

I wrote a class CountDown for Actionscript 3.0. To test it I created an example using the text-rendering capabilities of FIVe3D .

Click to open the Flash movie

More ...

Papervision3D: effects with perlinNoise ()

Exploiting the effect generated by perlinNoise() you can create ripple effects and waves with Papervision3D .

Download the source

More ...

Experiments with DisplacementMapFilter perlinNoise and ()

I introduce today a vast and interesting topic that has its "core" of the use of class DisplacementMapFilter . , etc…). This class lets you apply a displacement map filter to a visual object Flash ( Bitmap , Sprite , etc ...). Filters, Flash CS3, it has all different and belong to the same family. However, the DisplacementMapFilter has very special characteristics, such as vedreno, making it unique in the generation of spectacular effects.

DisplacementMapFilter - click to open the Flash movie

DisplacementMapFilter - click to open the Flash movie

Download the source

More ...

Flash CS3: Create a reflex effect on any MovieClip

Taking advantage of a remarkable feature of Actionscript 3.0 (see Actionscript 3.0, all with the new operator ) I created a class ReflexMe able to generate an effect "reflection" of any MovieClip in this library.

Flash Player Loading ...

The source is part of the package undolibrary - GoogleCode of this - but if you want you can download the single file ReflexMe.as .

More ...

Effects on the bitmap with perlinNoise ()

The class BitmapData allows to apply in a simple effects useful for various purposes. We saw how to create an effect "fog TV" with a few lines of code ( Flash CS3: create fog effect TV in 1 second ). Now we will deal with another effect "spectacular" which, as we shall see later, allows the creation of interesting visual effects, as shown in the example below: the parameters varied to observe the different effects, clicking with the mouse on the image generated this can be moved.

Flash Player Loading ...

On this occasion I also added a new simple component (Check) in Undolibrary ! Then update your SVN repository. The source is available here: MapEffect.zip

More ...

Papervision3D: BasicView

Papervision3D 2.0 (GreatWhite) is constantly developing and there are many function that are added almost weekly. In April, was inaugurated on the developer blog ( http://dev.papervision3d.org/ ), however, the 2.0 release, has not yet been released OFFICIALLY is often difficult to understand their true potential. One of the recent innovations introduced, however, is the new object BasicView an environment that creates 3D with very few lines of code. Suffice it to create this object to have the scene, viewport and camera in one shot.

More ...

Creating custom events in Actionscript 3.0

Creating custom events in ActionScript 3.0 is simple. Use them, then, allows you to use the method addEventListener() and make our object of all standards. ) BottoneEvent . If we created a class, eg Bottone , this is correct to associate with one or more events through a special class (derived from the class Event ) BottoneEvent . We could make all the events that affect the functioning of our subject: the click, mouse over, or any other event! Also defining our personal constant. The skeleton - generic - a class of custom event is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package {
/ *
** @ Name: BottoneEvent.as
** @ Description: Class derived from Event to manage their own custom event
** @ Author: = undo =
@ ** Web: http://www.undolog.com
** @ Email: @ g.fazioli undolog.com
* /
.*; import flash.events. *;

BottoneEvent extends Event { BottoneEvent extends public class Event {

String = 'pluto' ; // codice qualsiasi, anche 'mioevento' in minuscolo public static const MIOEVENTO: String = 'bar', / / any code, even 'mioevento' in lower case

Valore : Number = NaN ; public var value: Number = NaN;
/ *
** @ Name: BottoneEvent
** @ Description: constructor
* /

type , bubbles , cancelable ) ; super (type, bubbles, cancelable);
Value = v ; this. Value = v;
}

/ *
@ ** Override
* /
clone ( ) : Event { public override function clone (): Event {
this . type , this . Value , this . bubbles , this . cancelable ) ; return new KnobEvent (this. type, this. Value, this. bubbles, this. cancelable);
}
}
}

More ...

FIVe3D: effects of a cube! Waiting for Flash 10

Most likely, when it comes out the new version of Adobe Flash, 3D libraries to "low level" as FIVe3D make a bad end! However, before "cestinarle", here is an example of what can be achieved (with the latest release 2.1):

Flash Player Loading ...

The code for the demo above is quite articulate, so I do not propose entirely online. I insert, however, some parts of code interesting.

Update: the source click here

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 ...



Stop SOPA