Hello
I am having problems with event propagation. I am creating two object and then adding these into a holder sprite and then adding a click event listener to the holder click. So when user clicks any of the two object inside that holder clip onClick handler is called and in that I am calling a function of the traget object
Here is the sample code:
var array:Array = new Array();
var holder:Sprite = new Sprite;
array.push("Coldplay The Scientist");
array.push("Black and Gold");
array.push("Rihanna Take a bow")
for(var i:int; i < array.length; i++)
{
var test:Test = new Test();
test.startTest(array*);
test.x = i * 200;
holder.addChild(test);
holder.addEventListener(MouseEvent.CLICK, onClick);
addChild(holder);
}
function onClick(event:MouseEvent):void
{
//trace("Current target" + event.currentTarget);
trace("target" + event.target.callFunction());
This is giving me the following error
Error #1069: Property video not found on flash.display.sprite and there is no default value.
Can anyone help me with this?
Thanks