Saturday, September 10, 2011

Make a Very Basic Flash ActionScript Website Tutorial

This Flash tutorial series show how to make a simple and basic Flash web site with ActionScript 3. The first Flash tutorial shows how to make a very basic Flash web site with ActionScript 3. Although it is a very basic Flash web site, it has almost all the basic features.


Flash Tutorial Content:

Making a Flash ActionScript web site is very easy and fun. In order that users can maintain the website without any knowledge of Flash, this is better to use external text files for the web contents.
The first Flash Movie of this tutorial is shown as above. You may play around to see how it works.

Flash ActionScript Codes:


//Create a new loader to load the text file

var myURLLoader = new URLLoader();


//Specify the data format

myURLLoader.dataFormat = URLLoaderDataFormat.TEXT;


// Call function homePage when Flash Movie loads

homePage(null);


//Listen to when the loading COMPLETE

myURLLoader.addEventListener(Event.COMPLETE, loadTextFile);






function loadTextFile(evt:Event) {

//Already set in the Parameters window
//content_txt.wordWrap = true;

//Load the text file to TextArea
//replace double empty line with a single empty line
content_txt.text = evt.target.data.replace(/\r/g,"");




}






///////////////////////////////////////////

////////// Buttons and Functions //////////

//////////////////////////////////////////


//Add event listener to the Home button

home_btn.addEventListener(MouseEvent.CLICK, homePage);


//Add event listener to the About Us button

aboutUs_btn.addEventListener(MouseEvent.CLICK, aboutUs);


//Add event listener to the Contact Us button

contactUs_btn.addEventListener(MouseEvent.CLICK, contactUs);






function homePage(evt:MouseEvent):void {

//Load the text file (home.txt)
myURLLoader.load(new URLRequest("home.txt"));





}






function aboutUs(evt:MouseEvent):void {

//Load the text file (about-us.txt)
myURLLoader.load(new URLRequest("about-us.txt"));




}






function contactUs(evt:MouseEvent):void {

//Load the text file (contact-us.txt)
myURLLoader.load(new URLRequest("contact-us.txt"));




}




External Text Files (Webpages)
home.txt
about-us.txt
contact-us.txt










Source: http://www.flashwonderland.com/simple-website/Simple-Website-1.html

Networking

IP Addressing So what’s a TCP/IP Address? TCP/IP address works on the Network and Transport layer of the OSI-ISO reference model and Intern...