This.onRelease = function()} play(); not working!

I am attempting to create this intro so that when the user rolls over the vegtable (mc) and clicks on it, it plays the rest of the timeline within the parent mc. This is the code I put on each mc:

stop();
this.onEnterFrame = function() {
if (rewind == true) {
prevFrame();
}
};
this.onRollOver = function() {
rewind = false;
play();
};
this.onRollOut = function() {
rewind = true;
};
this.onRelease = function(){
play();
};

But when I click, nothing happens! Can someone help? My .fla is here

http://www.innelladesign.com/manginos.fla

you’ll see that what I want to do is make it so that the 2 tomatoes, basil, onion and garlic all serve as buttons to play the rest of the parent mc. Any help would be much appreciated! THANK YOU!!

have you tried simple tracing?

Sorry, not sure what that is. I dont really write my own code…still learning.

?? can you explain?

Insert ‘trace(“you just clicked!”)’ into your onRelease handler, like this:

stop();
this.onEnterFrame = function() {
   if (rewind == true) {
      prevFrame();
   }
};
this.onRollOver = function() {
   rewind = false;
   play();
};
this.onRollOut = function() {
   rewind = true;
};
this.onRelease = function(){
   trace ("You just clicked!");
   play();
};

defective beat me to it :slight_smile:

:nat:
Edit: wow. I didn’t even think of the signifigace between that indian and “you beat me to it” :lol:

What happens is You got clicked! shows up in the output box. Still not sure what i should do or what that means?? sorry…

That means that “play();” is your issue.

so i need to get rid of it? how do i get it to play the rest of the timeline then?

Your code doesn’t make much sense, can you explain what you are trying to acheive.

I want the (tomato or other veggie) mc to play so that the graphic moves up a bit, and then when the user releases, I want the rest of the parent mc to play.

Or I was thinking to put an invisible button over the mc, but then the problem is, the mc won’t play. aka the tomato won’t bounce up.

this.onRelease = function(){
   trace ("You just clicked!");
   this._parent.play();
};

THANKS FOR SAVING THE DAY!!! works perfect. 'preciate it…

no problem, just remeber targeting. You were referring to “this” with the on handler, anything within that handler will happen to “this” item(a.k.a: the button).

Also you could also use “_root.play();”, but this may create issues if you load this movie in another movie. So try to stick with relative targetting, like “this._parent.” then your always cool.

ah. ok I see what you’re saying. I didnt realize that. Thanks for the lesson. :pleased:

http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics_of_actionscript_for_flash&p=2&l=Flash_MX_04 :thumb: