Hola!
I’ve got a bunch of mc’s which I’ve put in an array. With these mc’s you can do a lot of different things, like dragdrop and rotation. I also got a button which on mouse down, changes the image of the mc. It only changes the image… not the size. So far so good…
But when I’ve clicked the button and the mc’s all change their image… They are not able to dragdrop / rotation anymore. I do not understand why this is happening… because by clicking that button… it doesn’t change the names of the mc’s…
ActionScript Code:
[LEFT]
library = new mc_library();
library.x = 100;
library.y = 100;
addChild(library);
hamer = new mc_hamer();
hamer.state = “state1”;
hamer.x = 110;
hamer.y = 110;
hamer.buttonMode = true;
hamer.tooltip = “Hamer”;
library.addChild(hamer);
hamer.addEventListener(MouseEvent.MOUSE_DOWN, function(evt:MouseEvent) {drag(event, hamer)});
hamer.addEventListener(MouseEvent.MOUSE_OVER, function(evt:MouseEvent) {onMouseOver(event, hamer)});
gereedschap.push(hamer);
weergave.label = “weergave”;
weergave.x = 200;
weergave.y = 510;
weergave.setStyle(“textFormat”, myFormat);
addChild(weergave);
weergave.addEventListener(MouseEvent.MOUSE_DOWN, wisselWeergave);
private function wisselWeergave(event:MouseEvent):void
{
if (hamer.state == “state1”)
{
library.removeChild(hamer);
hamer = new mc_hamer_2();
library.addChild(hamer);
hamer.state = “state2”;
gereedschap.push(hamer);
trace (hamer.state);
}
else if (hamer.state == “state2”)
{
library.removeChild(hamer);
hamer = new mc_hamer();
library.addChild(hamer);
hamer.state = “state1”;
gereedschap.push(hamer);
trace (hamer.state);
}
}
[/LEFT]
[LEFT]
[/LEFT]
[COLOR=#000000]
[/COLOR]anybody who knows what I’m doing wrong???