Creating an EyeWonder Expandable from two swfs
If you have created Expandables with some of our competitors, you may be used to creating ads with a closed state and an opened state because that is the way their system is setup. While we definitely recommend setting up the files with one parent swf and child swfs so that you have animation control between expands and contracts, as well as more communication between the closed and panel units, it is understandable that you may have assets which were already set up with open and closed swfs.
EyeWonder has a good trick on how to get around this, so please see below for more info on how to quickly turn your two swfs into a parent/child combo. Let’s say that you have a 728×90 and a 728×270 swf which you need to combine:
- Take the 728×90 swf and select the entire timeline.
- Copy the frames.
- Create a new movieclip in the library.
- Paste all the frames into the movieclip.
- Create a new “parent” swf which is set up for the entire stage (like 728×270)
- Add the assembled movieclip into the library and put into the content layer.
- Create a timeline that looks like this:

- Note that you will want to edit the rollover area to go wherever the rollover is going to be. If the rollover doesn’t become visible until partially through the main animation, add the visible/not visible to the closed timeline.
- Your expand code will look like this:
var startExpandFrame = 2;
rollover_mc.onRollOver = function(){
this._visible = false;
gotoAndPlay(’expand’);
}
clickthru_mc.addEventListener(”release”,_release);
function _release(){
EW.onRollOff();
}
EW.onRollOff = function() {
if (_root._currentframe==startExpandFrame) {
contract();
}
};
function enableRollover() {
clearInterval(intervalID);
rollover_mc._visible = true;
}
function contract() {
intervalID = setInterval(enableRollover, 250);
gotoAndPlay(”contract”);
}
Things to watch out for in this method:
- Change all previously written actionscript from “_root” to “_parent”. If that doesn’t work, you can always fix the scoping by setting a variable to the scope). For instance, add this line of code: “var closed_scope = this;” to the main timeline of the movieclip you created and then find and replace all the “_root” instances to “closed_scope”
- You may want to disable/enable the rollover in different points along the timeline. For that call _root.rollover_mc._visible = true or false;
