Jump to content


Photo

Buttons in movie clip under a mask


  • Please log in to reply
18 replies to this topic

#1 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 04 July 2006 - 02:01 AM

Hey there,

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 :D

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 MAdEinUK1

MAdEinUK1

    Young Padawan

  • Members
  • Pip
  • 74 posts

Posted 05 July 2006 - 11:11 AM

Erm try this:

this_x.onClipEvent = function () {
x_mc.gotoAndStop(y);
}

x = your instance name

y = your frame number with the buttons on.

Hope it works =)

#3 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 06 July 2006 - 06:25 PM

Hey there,

Thanks a lot for the reply :ph34r:

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 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 06 July 2006 - 06:46 PM

this_menu will not work...

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 MAdEinUK1

MAdEinUK1

    Young Padawan

  • Members
  • Pip
  • 74 posts

Posted 07 July 2006 - 02:21 AM

Ok, done it. This code works.

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 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 08 July 2006 - 08:05 PM

Thanks a lot for this guys :)

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 Wowzers

Wowzers

    Young Padawan

  • Members
  • Pip
  • 40 posts

Posted 09 July 2006 - 06:35 AM

make sure the mask for the effect is above the effect...

#8 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 09 July 2006 - 07:35 AM

make sure the mask for the effect is above the effect...

What do you mean?

#9 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 09 July 2006 - 10:44 AM

your webserver is soo slow, that I need 30mins to download your fla, could you please just upload the fla with the corresponding assets (no mp3 or big stuff)

#10 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 09 July 2006 - 11:32 PM

Sorry about that...
I've now uploaded an extremely compact version. It only has the buttons and mask. You can find that here. :ph34r:

#11 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 10 July 2006 - 01:18 AM

that fla is working.. I've placed a trace action on every button inside the menu movieclip and as soon as I press the buttons the trace shows up.

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 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 10 July 2006 - 03:24 AM

If when you say trace action, you mean drawing in the down frame of a button... I tried that and it works too... but for some reson the actionscript doesn't... :wacko:

And, yea, i knew that only one button had script. I didnt bother putting it on the others because it didnt work...

#13 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 10 July 2006 - 06:28 AM

nope, I mean with trace action this:
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 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 10 July 2006 - 07:34 AM

ahhh, hey thats a useful tool :)

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 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 10 July 2006 - 08:27 AM

works for me like charm, instead of using gotoAndPlay(FrameLabel) use gotoAndStop..

#16 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 11 July 2006 - 01:52 AM

Im realy sorry for taking up you time Funky....

Can you post the code that you used? I just tried this and it still did the same :P
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... :D

#17 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 17 July 2006 - 06:58 AM

Hey,
I would really appreciate it if someone could help me work out this problem... I really need this to work... buttons under masks... :tiphat:

#18 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

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 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 04 August 2006 - 07:44 PM

Hey there again,

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 :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users