I am asking this in javascript and not actionscript because I think the js portion more crucial. I have a viewable area in a SWFcalled box_mc on frame1 that is 300x100 until a rollOver event when it appears to become 300x274 because it has advanced to frame2
I want my actionscript to instruct a div that is 300x100pixels with overflow hidden to expand to a div that is 300x274 in response to the rollOver event. On rollOut I want my div to snap back to the original height.
I think I may have seen what I need on http://www.adobe.com/products/photoshop/family/
which has a script called expando
This is my AS for the rollover rolloff events
I want my actionscript to instruct a div that is 300x100pixels with overflow hidden to expand to a div that is 300x274 in response to the rollOver event. On rollOut I want my div to snap back to the original height.
I think I may have seen what I need on http://www.adobe.com/products/photoshop/family/
which has a script called expando
Code:
function setSWFDimensions(objID, width, height) {
//alert(objID+' '+width+' '+height);
if (objID && width && height) {
var fObj = document.getElementById(objID);
var fEmb = document.getElementById(objID+'-embed');
if (fObj && fObj.style) {
fObj.setAttribute('width', width);
fObj.setAttribute('height', height);
fObj.style.width = width+'px';
fObj.style.height = height+'px';
}
if (fEmb != null) {
fEmb.width = width;
fEmb.height = height;
if (fEmb.style) {
fEmb.style.width = width+'px';
fEmb.style.height = height+'px';
}
}
}
}
Code:
box_mc.onPress = function():Void
{
getURL("javascript:pageTracker._trackPageview('/flash/click/');");
getURL("http://www.yahoo.com","_blank");
};
box_mc.onRollOver = function():Void
{
getURL("javascript:pageTracker._trackPageview('/flash/rollover/');");
box_mc.gotoAndPlay(2);
};
box_mc.onRollOut = function():Void
{
box_mc.gotoAndStop(1);
};
Comment