dopaminadarktheme
Full Dopamina Dark Theme
In the hit area, we place a button with this actionscript:
on(rollOver) {
getURL("javascript:expand();");
gotoAndPlay("Start");
}
on(rollOut) {
gotoAndPlay("Finish");
getURL("javascript:retract();");
}
on(release) {
getURL("http://www.jpedroribeiro.com/", "_top");
}
As you can see we are going to call a javascript on these two mouse events that will expand and retract the flash area, the third event is the click which will take us to our desired link.
In the mask layer, create a shape object and animate it to hide the extra content. Don’t worry about the canvas size, we will take care of it next.
<div style="position: relative; width: 600px; height: 150px">
<div id="exp-banner" style=" position:absolute;clip: rect(0px 600px 150px 0px)">
<object>...</object>
</div>
</div>
Now we just need some script to dynamically change those attributes.
function expand() {
document.getElementById("exp-banner").style.clip="rect(0px 600px 300px 0px)";
}
function retract() {
document.getElementById("exp-banner").style.clip="rect(0px 600px 150px 0px)";
}
To get a smoother result, you should only call the retract function when your animation reverted back to its standard height.
Assine a newsletter para receber em seu email as publicações atualizadas neste blog