Expandable Flash Banner/Skyscraper

Hi there,

I’ve created an expandable skyscraper using 2 swf-files and some javascript in the html file to trigger the expandable part when doing a mouse-over.

However, I now need to convert this into 1 swf-file only and send this (without html-part) to the publisher.

Does anyone have a tipp on how to best/easiest do this? e.g. can the stage-size be changed from 120x600 to 300x600 in one movie when the mouse-over initiates the expandable part?

Any hints or links to possible tutorials would be much appreciated.

cheers,
kiwiAMS
(:

You can use a transparent swf that on expand calls a javascript that rewrites the containing div properties e.g in actionscript

expandBanner=function(){
  getURL("javascript:expandbanner()");");
  gotoAndPlay("expandAnimation");
}
contractBanner=function(){
  getURL("javascript:contractbanner()");");
  gotoAndPlay("contractAnimation");
}

then in the head of your html

<script type='text/javascript'>	
function expandbanner(){document.getElementById('mybannerdiv').style.width = "400px";}
function contractbanner(){document.getElementById('mybannerdiv').style.width = "200px";}
</script>

The contracted swf area has a background mc, which only takes up part of the stage, then when you expand you use the full swf stage area.

Eastcoast, thanks for answering so quickly.

I’ve tried to do your approach but somehow I’m not really succeeding…

I’ve created one Flash file in the full expandable size of the banner, added the actionscript to the background_mc movieclip where I’ve used the contracted size of the banner, then made one frame with the image of the expanded size, and exported all to one swf-file. The html I’ve used with the javascript code as you’ve suggested.

hmm… where I’m going wrong?

Also, as this solution uses javascript in the html and the publisher only wants one single .swf file without any html added, would you know how to create 1 swf-file enabling the expandable part with a mouse-over by changing the stage.width within this one flash file?

any ideas?

kiwiAMS are you actually creating this flash ad to be served by an ad serving agency like [URL=“http://www.dartmotif.com/”][B]dartMotif[/B] or [URL=“http://www.pointroll.com/”][B]PointRoll[/B] ? or are you just sending it to the owner of a website for them to insert the ad onto their site?

yep, that’s correct - they are using DartMotif but have asked me to deliver one single swf file instead of two…