Skip to main content
January 22, 2009
Question

Manipulating with movieClips in array

  • January 22, 2009
  • 2 replies
  • 347 views
Hello,

I want to dynamicly add images from XML to movieClips and then add event listeners to these movieClips. What is the best solution? Could you please help?

XMl loads correctly, it also add 2 movieclips on stage, but it throws errors when I try to add event listeners to movieClips. How could I do that? I want to go to different frames on release of some movieClips. How can I please recognise each movieClip and manipulate with that movieClip ? (resizing,...)

I attached part of my code


This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
January 22, 2009
:

function onComplete (evt:Event):void{
var mc:MovieClip=MovieClip(evt.target.content)
arrayMC.push(mc);
addChild(mc);
mc.addEventListener(MouseEvent.CLICK,whateverfunction);
}
function whateverfunction(e:Event){
}
kglad
Community Expert
Community Expert
January 22, 2009
cast the content property of your loaders as movieclips and then add your listeners.

p.s. your img movieclips aren't being used.
January 22, 2009
Thanks for the reply.

Could you please paste the code?