I am from a php jquery background and i am currently getting to grips with flash as3 just not sure how to pass values to eventlistner function say i have the following.
for (var i:uint = 0; i < asteroids.length; i++)
{
asteroids[i].x = Math.random() * 450;
asteroids[i].y = Math.random() * 450;
asteroids[i].addEventListener(MouseEvent.MOUSE_UP, changeValue);
}
public function changeValue(event:MouseEvent):void
{
playSound(anote);
trace(event.currentTarget);
}
each asteroid that i addeventlistner in the loop i need to pass a different value to the function the var anote?
jquery i would do.
$(".asteroids").click(function() {
// or something similar
var anote = $(this).attr('href');
playSound(anote);
return false;
});
Can someone point me in the right direction.