Buttons in movie clip under a mask
#1
Posted 04 July 2006 - 02:01 AM
Im having a lot of trouble trying to get my flash animation to work, and i need to finish it by monday... So any help will be greatly appreciated
The problem is that i have some buttons inside a movie clip, and the movie clip is under a mask. When i run it, the hand appears when i hover over buttons, but when i click nothing happens. I have tried taking the button outside the MC and it works fine, but i need it to be inside it as i have a script that makes the MC move with the mouse.
Thanks a lot in advance...
#2
Posted 05 July 2006 - 11:11 AM
this_x.onClipEvent = function () {
x_mc.gotoAndStop(y);
}
x = your instance name
y = your frame number with the buttons on.
Hope it works =)
#3
Posted 06 July 2006 - 06:25 PM
Thanks a lot for the reply
I tried the code, but i got the following error message:
**Error** Scene=Menu, layer=Menu Template, frame=1:Line 1: Expected a field name after '.' operator.
this_menu.onClipEvent = function () {
Total ActionScript Errors: 1 Reported Errors: 1
#4
Posted 06 July 2006 - 06:46 PM
I think what madeinUK meant was:
this.onClipEvent = function(){
Maybe you should put the code on the movieclip and not in the root timeline
#5
Posted 07 July 2006 - 02:21 AM
Attach this code to your movieclip:
onClipEvent (enterFrame) { }
And attach this to your button inside your movieclip:
on (release) { _root.gotoAndStop(x); }
x means what keyframe you want to stop on your main timeline.
=)
#6
Posted 08 July 2006 - 08:05 PM
I tried all of the above, but still the buttons refuse to behave. I've uploaded the .fla if anyone wants to have a look at it. You'll know which buttons im talking abot if you look. For now I've changed the code back to how I had it originally.
Heres the link: TV.fla
Thanks a lot again
#7
Posted 09 July 2006 - 06:35 AM
#8
Posted 09 July 2006 - 07:35 AM
What do you mean?make sure the mask for the effect is above the effect...
#9
Posted 09 July 2006 - 10:44 AM
#11
Posted 10 July 2006 - 01:18 AM
On the Fla you sent there was only one button with actions applied to it, I think it was workstation.
Anyway, everything works as it should..
#12
Posted 10 July 2006 - 03:24 AM
And, yea, i knew that only one button had script. I didnt bother putting it on the others because it didnt work...
#13
Posted 10 July 2006 - 06:28 AM
on (release) { mvi = "workstation"; _root.gotoAndPlay("playclip"); trace("button pressed"); }
how can the button move over to a label called "playclip" when that is not around?
#14
Posted 10 July 2006 - 07:34 AM
Oh, sorry... I took the "playclip"scene out of the one i uploaded
It seems that when under a mask, the "gotoAndPlay" function is ignored... I did a search in Google and a few people have had the same problem, (but none that i have found) have resolved it...
#15
Posted 10 July 2006 - 08:27 AM
#16
Posted 11 July 2006 - 01:52 AM
Can you post the code that you used? I just tried this and it still did the same
on (release) { mvi = "workstation"; _root.gotoAndStop("playclip", (1)); trace("button pressed"); }...and this is what happens when i test it: Screenshot
Now we know it's not the button that doesn't work under a mask, but it looks like none of the "goto" functions do...
#17
Posted 17 July 2006 - 06:58 AM
I would really appreciate it if someone could help me work out this problem... I really need this to work... buttons under masks...
#18
Posted 17 July 2006 - 07:35 AM
works for me like charm, instead of using gotoAndPlay(FrameLabel) use gotoAndStop..
As I already mentioned herein, you put a label somewhere on a frame and let the playhead jump to it with a gotoAndStop or gotoAndPlay it will work just fine.
_root.gotoAndStop("framelabel");
#19
Posted 04 August 2006 - 07:44 PM
I know this is an old topic so sorry for any inconvenience. I didnt solve the problem as i had to change what i was doing anyway. I've has the same problem before when trying to add a scrolling playlist to Funky's MP3 player (the buttons didnt work unless i removed the mask). I think ill try moving to Flash 8 rather than MX and hopefully it will work then.
I did try what you said to do Funky but it didnt work... oh well. Im very greatful for your help Thank you a lot
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users