I have a rollover function which works fine, but now I want to make it play a movieclip as well. Sounds simple, bu I just can’t make it work :*(
I think it’s something silly, but what??? I’ve tried it every which way, but haven’t stumbeled upon the answer yet - so wondered if anyone could help??
The following code works fine on a test button - just so you can see where things are…
on (rollOver) {
_level0.all.pulseMC.pulseMC1.play(“play”);
}
Here is the global function, the bits in red are my new additions:
Here is the call to action:
_level0.all.content.subMenu.btn2.onEnterframe =
function() {
subControl(this[COLOR=Red],pulseMC1[/COLOR])
};
mc2 represents the movieclip name - there are 3, unsurprisingly numbered 1-3. I am only testing with pulseMC1 at the moment.
I’ve written it in various ways (_root, _parent._parent, etc) but can’t get it to work. What am I doing wrong??? Can anyone help?? I’d be very grateful
…so I discovered :h: Why is that then??? It didn’t work with or without the dot Grrrr…what is it I’m missing?? The test rollover button works using that path, why not in the function??
I tried to upload them, but the fla’s are too big. It’s probably just as well because they’re probably a bit complicated to disect and all these function happen in a small area, so it’s not always easy to see what’s going on. Just can’t understand why this isn’t working, it should be relatively simple…?
I added ‘trace(_level0.all.pulseMC.mc2);’ to the function, but it came back as ‘undefined’, even though it’s in there…
I think I’ve got the path to it correct because my test rollover button works using:
on (rollOver) {
_level0.all.pulseMC.pulseMC1.play(“play”);
}
Even when I put “_level0.all.pulseMC.pulseMC1.play(“play”);” into the function it works. But I need to have pulseMC1 change to …2 and …3 - hence trying to add it as a variable. But it’s the variable that’s coming up as undefined, so I guess I must have done something wrong there??
Yours is exactly the same as mine, except for the “” and _root/_level0, which is what I had before and doesn’t make any difference anyway… That is SO annoying, I tried the code with quote marks ages ago, because one of my other functions works with them. But it didn’t work - I think that was before I’d got [] right… But as nobody suggested the variable should be in quotes, I figured I’d got it wrong and stopped trying it with them…that was a mistake…
I can’t believe I didn’t get that! I was so close Anyway, it works now…thank you so much for your help. I’d have been going around in circles (as I was before). I don’t know if you recall or ever had a ‘trial & error’ period?? I’m still at that stage, but trying all the same…