Skip to main content
sarahc7407654
Participant
February 5, 2015
Question

How to get a movie inside a button to trigger on rollover so it doesn't stop when mouse moves off the button?

  • February 5, 2015
  • 2 replies
  • 422 views

Hey all,

How can I get a movie inside a button to trigger on rollover so it doesn't stop when mouse moves off the button? The final output will be a touchscreen so it should function when tapped once. I will have several buttons existing at the same time so I can't use the timeline to solve it. I'm using action script 3.0. Any help welcome please. I am a designer not a coder so scripting knowledge is limited,

Thanks,

Sarah

This topic has been closed for replies.

2 replies

sarahc7407654
Participant
February 5, 2015

‌thanks Joseph and kglad. I'll get time tomorrow to try these options.

kglad
Community Expert
Community Expert
February 5, 2015

it will actually be easier to use a movieclip instead of a button and control your off,over and down frame display using actionscript.

sarahc7407654
Participant
February 5, 2015

Sounds good in theory. Any chance of a sample? One graphic for example is an ambulance. On rollover the ambulance drives off, siren flashing and sound blaring. I've figured it out in action script 2.0 but 3.0 is a no go.

Thanks!

Joseph Labrecque
Community Expert
Community Expert
February 5, 2015

Try something like this:

ball.addEventListener(MouseEvent.CLICK, triggerMC);

function triggerMC(e:MouseEvent):void {

  ball.play();

}

Assuming "ball" is your MovieClip instance.

Here's an FLA => https://dl.dropboxusercontent.com/u/78088/shares/mc_click.fla