Flash is one of the most popular applications for developing of dynamic and interactive web sites. A detailed presentation of its functions can be found in our Flash tutorial.
In our Flash menu tutorial we will provide detailed instructions on how to create an interactive menu using Flash and Actionscript.
The actionscript code is as follows:
import flash.filters.BlurFilter;
//Imports the BlurFilter class. It allows to apply a blur visual effect to a variety of objects in Flash. A blur effect softens the details of an image.
var blurred:BlurFilter = new BlurFilter(5, 5, 3);
//Declares a BlurFilter object, the parameters are the level of the horizontal and the vertical blur (from 0 to 255) and the quality (1-Low; 2-Medium;3-High).
var myFilters:Array = [blurred];
//Declares an array of blur filters.
button1.filters = button2.filters = button3.filters = button3.filters = myFilters;
//Applies the blur filter effect to the buttons.
button1.onRollOver = button2.onRollOver = button3.onRollOver = button4.onRollOver = function() {
this.filters = null;
}
//The onRollOver event of the buttons disables the blur filter.
button1.onRollOut = button2.onRollOut = button3.onRollOut = button4.onRollOut = function() {
this.filters = myFilters;
}
//The onRollOut event of the buttons turns back on the blur filter.
button1.onRelease = function ()
{
getURL(“http://example.com”,”_blank”);
}
//The onRelease event opens the defined URL.
button2.onRelease = function ()
{
getURL(“http://example.com/tutorials/”,”_blank”);
}
button3.onRelease = function ()
{
getURL(“http://example.com/about_us.htm”,”_blank”);
}
button4.onRelease = function ()
{
getURL(“http://example.com/contact_us.htm”,”_blank”);
}
You can play with the actionscript code altering the blur level and the URLs.
Once you are ready, save the Flash document from File->Save As. You can publish it as per the instructions in corresponding part of Flash tutorial.