yo_sarrian (yo_sarrian) wrote in 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() {

But nothing happens when I roll over it.

Any help?!?
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.