Building a Flash Ad

Installing The Components

We provide our components in an Adobe extension package (a .mxp/.zxp file) that you can download. The good news is that if you have Flash, you more than likely already have the Adobe software installed that will run this file and install our components. It should just be a matter of downloading the file, double clicking on it and following the on screen instructions. If it seems that your computer doesn’t know what to do with an MXP / ZXP file then you can download the Adobe extension manager.

The Core Component

We assume you have already installed our component suite. If not, please download our ONE by AOL: Creative Flash Components, install them, and come back afterwards.

If you’re using the Flash IDE (we support Flash CS5.5+) you will need to drag & drop an instance of our Core component onto the first frame of the main movie. You can find the Core component in the component library. If you can’t see the component library, click on Window and then Components (in Flash CC you can find the ‘Component Parameters’ under the Properties tab).

If you’re developing in AS3 and using an Actionscript editor you can include the flash library with the following line of code:

import com.adtech.ADTECH

If you are using a fully fledged IDE, such as Flash Builder or Eclipse you will need to import our RichMediaLib SWC. Once you have imported the library into your project, you will need to initialise our library by calling:

ADTECH.init(this)

Where `this` is a reference to your main stage.

You will now have access to our Flash API in your code, which is enough to build any type of rich media ad. If you’d rather avoid coding, you can choose to use any of our Flash components.

Loading Additional Files

If you need to load in additional files (swfs, images, videos etc.), you can either use our File Loader component or our ADTECH.getFileUrl('fileName') function.

To use our File Loader component, simply drag it to the stage and place it where you want the additional file to load in. Then enter the file name in the component’s File Name parameter.

If you want to write your own code to load a file, just make sure that you wrap the file name in our ADTECH.getFileUrl('fileName') function. For example, if you’re using the Loader Class to load in “myfile.swf”, your code would look like:

var urlRequest:URLRequest = new URLRequest(ADTECH.getFileUrl(‘myfile.swf’));
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);loader.load(urlRequest);

Alternatively, for more flexibility in ONE by AOL: Creative, you can use the ADTECH.getFileUrlById('id') function. This gives you the advantage that you can keep replacing the file in ONE by AOL: Creative without having to keep the file name the same. This is discussed further in the files panel section.

Please remember that the ADTECH.getFileUrl('fileName') and ADTECH.getFileUrlById('id') functions ensure that the path to the file is correct when the ad is running in all environments – they don’t actually load in the file itself. For this you will need to use either the inbuilt flash class (e.g. Loader) or our File Loader component.

Polite file loading

If you want to use our File Loader component, then follow the instructions above but additionally select the Load Politely option. This will delay loading the file until the web page has loaded.

For polite loading in code, our ADTECH Core Component fires a page load event. Your code can listen for this, and then load in a file. For example, to politely load in “myheavyfile.swf”, your code could look like:

if(ADTECH.isPageLoaded()) {
 loadFilePolitely();
}
else {
 ADTECH.addEventListener(RichMediaEvent.PAGE_LOAD, loadFilePolitely);
}

function loadFilePolitely(event:RichMediaEvent = null) : void {
 //load file code
}

Inline Documentation

When using AS3 code with our Core Library, it is also possible to view tooltips informing you of method signatures and parameters. To enable this, simple begin typing the method you want to access on the ADTECH object and as the correct method in the drop down appears, hit tab. You will then see a tooltip of what parameters are needed for that method.

If the content assist dropdown does not automatically appear, press Ctrl+Space on Windows or Cmd+Shift+Space on a Mac.

Feedback and Knowledge Base