Documentation DCO Enabler -> ENABLER ADOBE ANIMATE CC -> DYNAMIZE AND ADAPT THE SIZE OF AN IMAGE
DYNAMIZING AND ADAPTING THE SIZE OF AN IMAGE
It is possible to dynamize an image in your banner without the image being distorted and while keeping its full visibility.
To create a dynamic and re-sizable image area, add a unique name attribute, and set the value of the image (addAndAdaptImage
) by default.
Once created by our AdServer
, the images will change according to the established parameters (geolocation, weather, date / time, cookies, retargeting …).
To do this, you must select the chosen movieClip and write the following code:
//declare your dynamic images ADventori.initData({ img1: "http://img.over-blog-kiwi.com/0/40/01/35/201301/ob_1264f6_location-voiture-guadeloupe-dacia.jpg", img2: "http://www.alldigi.com/wp-content/uploads/2010/06/DSC_1332-1333-Panorama.jpg" });
//dynamization of the first image ADventori.Display.addAndAdaptImage(this.movieClip_1,ADventori.data.img1,ADventori.data.img1,movieClip.width,movieClip.height);
//dynamization of the second image ADventori.Display.addAndAdaptImage(this.movieClip_2,ADventori.data.img2,ADventori.data.img2,movieClip.width,movieClip.height);
Result :
Other customization method available:
- addImage(element,url,urldefault): This method allows you to add an image into a specified container without resizing it.