class 102-- create a class with 3 different function
For example I have 300 buttons!
I have to define 3 function(ROLL_OVER) for every 100 buttons.
I mean three Different ROLL_OVER in one class.
I am confused!
I know how to do this in main fla but not in external .as file!
for example
//btn type 1
var type1:array=[x1,x2,x3,x4];
for(var i:uint=0;i<type1.length;i++)
{
type1.addEventListener(MouseEvent.ROLL_OVER, over1)
function over1(e:mouseEvent):void
{
trace("type 1 rolled over");
}
}
//btn type2
var type2:array=[y1,y2,y3,y4];
for(var i:uint=0;i<type2.length;i++)
{
type2.addEventListener(MouseEvent.ROLL_OVER, over2)
function over2(e:mouseEvent):void
{
trace("type 2 rolled over");
}
}
To be more exact, I want to know can i create 'rollover' and 'rollout' and 'click' function for all of my buttons in one single class ? or I should create a class for every type ?
