Saturday 31st July 2021

Archive for the ‘Sample Code’ Category

Compatibility tables for support of HTML5, CSS3, SVG and more in desktop and mobile browsers.

*

*

*

Handy information for your development in HTML5 and CSS3. Follow this link >> Can I Use?

*

*

*

 

 

 

 

Sample code: resusable MouseEvent class with mix of buttons and movieclips

(Flash ActionScript 3)  By Tony Pan

There were times that we’ll have to assign mouse event to number of buttons or movieclips on the stage, ie.  navigation elements.  It is perfectly fine to implement the addEventListener individually to each of these buttons and movieclips.   But what if there are a large number of these buttons, and needed to use on few different individual swf files.   Here is the example code for importing  the same class file and create an storage array for the buttons and movieclips.   Then called the class function passing the storage array.

Sample Screen: (Roll mouse cursor over and click on them)

Code on the FLA file (buttons.fla):

import com.buttonEvent;
var addButtonEvent:buttonEvent = new buttonEvent(this);
var buttonArray:Array = new Array();
buttonArray = [button1, button2, button3, button4, button5, button6];
addButtonEvent.iniButtons(buttonArray);

Code on the package file (buttonEvnet.as):

Continue Reading »