a small button is sitting above a large button
large button uses onRollOver and onRollOut event
small button uses onRelease or onPress event
roll over large button starts video play, but when roll to small button i do not want the video to stop, i want to be able to click small button with video playing.
you can see here on
cbs.marketwatch.com
in the left column see the 125x125 box (road to prosperity) if you roll over video will play, and you can click sound button.
when i try it my movie stops as i am over the small button
ActionScript Code:
// this is the big button
bg.onRollOver=function(){
mediaDisplay.play()
}
bg.onRollOut=function(){
mediaDisplay.seek(0);
mediaDisplay.pause();
}
// here is the small button first try
var scale = "hide";
bg.moreBtn._visible=true;
bg.hideBtn._visible=false;
moreBtn.onRelease=function(){
trace("more")
moreBtn._visible=false
hideBtn._visible=true
mediaDisplay._xscale = 50;
mediaDisplay._yscale = 50;
mediaDisplay._x = 141;
mediaDisplay._y = 0;
scale = "more";
}
hideBtn.onRelease=function(){
trace("hide")
moreBtn._visible=true
hideBtn._visible=false
mediaDisplay._xscale = 100;
mediaDisplay._yscale = 100;
mediaDisplay._x = 0;
mediaDisplay._y = 0;
scale = "hide";
}
and this way it works in a way but not really
as i actually clicking on a big button and small button is just there switching
ActionScript Code:
// small button second try
bg.onRelease=function(){
if (scale == "hide") {
trace("more")
bg.moreBtn._visible=false
bg.hideBtn._visible=true
mediaDisplay._xscale = 50;
mediaDisplay._yscale = 50;
mediaDisplay._x = 141;
mediaDisplay._y = 0;
scale = "more";
} else {
trace("hide")
bg.moreBtn._visible=true
bg.hideBtn._visible=false
mediaDisplay._xscale = 100;
mediaDisplay._yscale = 100;
mediaDisplay._x = 0;
mediaDisplay._y = 0;
scale = "hide";
}
}