yo_sarrian (yo_sarrian) wrote in flashdev,
yo_sarrian
yo_sarrian
flashdev

  • Mood:
  • Music:

Moock's MVC Clock - Calling Controller From A Movie Clip

Hi, all... I'm trying to implement a version of Colin Moock's MVC Clock from his Essential Actionscript 2.0 book, and I'm running into a problem.

Here's Moock's source code. (yeah... I'm still using AS2!)

I'm trying to substitute his buttons with Movie Clips, but I'm not sure how to add the Listener "click" event to the Movie Clip (he currently does it with default button controls).

His code does this to create the button and add the listener:
stopBtn = tools_mc.createClassObject(Button, "stop", 1);
stopBtn.label = "Stop";
stopBtn.enabled = false;
stopBtn.move(startBtn.width + 5, startBtn.y);
stopBtn.addEventListener("click", getController());


I'm trying to attach a movie from the library and have it achieve the same effect:
swatch_mc = target.attachMovie("mySwatch", "swatch_mc", depth);
swatch_mc.id = id;
swatch_mc._x = x;
swatch_mc._y = y;
swatch_mc.onRollOver = function() {
getController();
}


But nothing happens when I roll over it.

Any help?!?
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 0 comments