Reputation: 1625
I have a movieclip with labels "normal" and "mouseover" . I am using the following code :
var thisButton:MovieClip = this.getChildByName(e.currentTarget.name) as MovieClip;
thisButton.gotoAndPlay("mouseOver");
On debugging "thisButton" does goto mouseover and the frame changes. But visually there is no change and the animation is not played. Any ideas?
Upvotes: 1
Views: 759
Reputation: 17895
Try:
var thisButton:MovieClip = e.currentTarget as MovieClip;
if(thisButton == null) return log.error("Error: thisButton does not appear to be"
+ "a MovieClip: " + thisButton);
thisButton.gotoAndPlay("mouseOver");
There's a couple of things I'm trying to say here:
Beyond these minor adjustments, the only other thing I can think of that might be causing you trouble is other actionscript. Is all your code in one place? Do you have code inside the movieclip? Are there calls to stop()? Are the parent clips stopped?
Check these things and report back and we can help you from there...
Hope that helps,
~gMale
Upvotes: 1