Flash

 
 
Flash movies are interactive vector graphics and animation for web sites. Web designers use Flash to create navigation controls, animated logos, long-form animations with synchronized sound, and even complete, sensory-rich web sites. Flash movies are compact, vector graphics, so they download rapidly and scale to the viewer´s screen size.

More information about Flash:
Adobe Flash
Adobe Flash Developer Center







Actionscript 3.0 examples



Information
ActionScript 3.0 Language and Components Reference


Procedure

Communication with server

Code Description
demo_url_1.as Goto an url
demo_url_2.as Goto an url, include window parameters:
_blank = new window
_self = current frame in the current window
_parent = parent of the current frame
_top = top-level frame in the current window
demo_url_3.as Goto an url silently without interfering with the users browsing experience.
demo_url_4.as Goto an url silently without interfering with the users browsing experience.
Pass GET variables.
demo_url_5.as Goto an url silently without interfering with the users browsing experience.
Pass POST variables.
demo_url_6.as Goto an url and pass GET variables. Show response string.
demo_url_7.as Goto an url and pass POST variables. Show response string.
demo_url_8.as Goto an url and pass GET variables. Show two response variables.
demo_url_9.as Goto an url and pass POST variables. Show two response variables.
demo_url_10.as Goto an url and return a list of variables. Loop thru this list and show the variables.
Resources:
actionscript_response_get.php
actionscript_response_post.php
actionscript_response_get2.php
actionscript_response_post2.php
actionscript_response_post3.php

Loading file

Code Description
demo_file_1.as Read and show content of a text file.
demo_file_2.as Read and show content of a text file. Assign multiple event listeners.
demo_file_3.as Read an xml file and show specific information.
demo_file_4.as
demo_file_4.fla
Read a text file and show content in a TextField. The text is formatted.
demo_file_5.as
demo_file_5.fla
Read a text file and show content in a TextField. The text is formatted. Create arrow buttons to scroll the text.
Resources:
sample_file1.txt
sample_file2.xml

Forms

Code Description
demo_forms_1.as demo_forms_1.fla Send contact form information.
demo_forms_2.as demo_forms_2.fla Enter a word and store (push) this word in an array. The content of the array is displayed.
Resources:
actionscript_contact.php


Buttons

Code Description
demo_buttons_1.as demo_buttons_1.fla Import a single image to library and convert it to a movie clip symbol. The image will be made clickable.
demo_buttons_1.as demo_buttons_2.fla Create a button using the rectangle tool and text tool and convert it to a movie clip symbol. The button will be made clickable.
demo_buttons_3.as demo_buttons_3.fla Create a button using the rectangle tool and text tool and convert it to a movie clip symbol. The button will be made clickable. When you hover over the button, the button transparency is changed.
demo_buttons_4.as demo_buttons_4.fla Create a button using the rectangle tool and text tool and convert it to a button symbol. When you hover over the button, the button transparency is changed.


Timer

Code Description
demo_timer_1.as demo_timer_1.fla The animation starts 4 seconds after the page is loaded.


Math

Code Description
demo_math_1.as demo_math_1.fla Click the button to randomly throw the dice.
demo_math_2.as demo_math_2.fla Click the star to move and rotate it randomly (event.target is used).


Security

Code Description
demo_security_1.as demo_security_1.fla The flash animation only works in the www.mobilefish.com domain.


Keyboard

Code Description
demo_keyboard_1.as demo_keyboard_1.fla Press the cursor key each time to move the rocket. All key codes are displayed.
demo_keyboard_2.as demo_keyboard_2.fla If a cursor key is held down, the rocket keeps moving. All key codes are displayed.
demo_keyboard_3.as demo_keyboard_3.fla If a cursor key is held down, the rocket keeps moving and wobbles. All key codes are displayed.


Graphics

Code Description
demo_graphics_1.as demo_graphics_1.fla Draw rectangle.


Sounds

Code Description
demo_sound_1.as demo_sound_1.fla Read mp3 file (filename hardcoded in file demo_sound_1.as.txt) and show play, stop and pause audio controls.
demo_sound_1.as demo_sound_1.fla Read mp3 file (filename passed in as FlashVars in demo_modified_sound_2.html file) and show play, stop and pause audio controls.

After the flash is published, edit the demo_modified_sound_2.html:
  • Modify AC_FL_RunContent, add line:
    'FlashVars', 'soundfile=war_air_raid_sirens.mp3',
  • Modify <embed src="demo_sound_2.swf" ...>, add line:
    FlashVars="soundfile=war_air_raid_sirens.mp3"
Resources:
war_air_raid_sirens.mp3


Instances and properties

Code Description
demo_instances_1.as demo_instances_1.fla Randomly create several star instances and change its alpha, x, y, rotation, scaleX and scaleY properties.

In the library, make sure the Linkage Properties is set.
Class: mcStar
Base class: flash.display.MovieClip