bannerads.swf not rotating Banners
Below is my Bannerads Flash CS5 Actionscript set as Document Class. I would like to know if it is correct.
It was approved months ago at this Forum. It was published to swf file (without any errors). However
when I linked it to my website ( through the object tag) No Banners appeared much less any Rotation.
The SWF is get ( IMAGEURL, ADVERTISER URL) from BANNERADS.MDB Access Database By
calling BANNERADS.ASP Web program.
This ASP BANNERADS program has worked successfully without Flash but had to be put in a frame
as it was refreshing the browser on rotation. I modified it to work with Flash by sending name=value
pair of Imageurl and Advertiserurl to the SWF.The BANNERADS.MDB DATABASE is not in same
directory as the SWF. The swf is in the IIS Web Server Directory where website resides.
CAN YOU HELP ME PLEASE.
package {
import flash.display.Sprite;
import flash.events.*;
import flash.net.navigateToURL;
import flash.display.Loader;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
public class BANNERADS extends Sprite {
public var ADVERTISERURL:String;
public var IMAGEURL:String;
public var NAVIGATEURL:String;
public var PICTURE:Loader;
public var LOADER:URLLoader;
public function BANNERADS():void {
PICTURE = new Loader();
PICTURE.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
LOADER = new URLLoader();
LOADER.addEventListener(Event.COMPLETE, getdata);
LOADER.dataFormat = URLLoaderDataFormat.VARIABLES;
LoadASP();
}
public function LoadASP():void {
var requester:URLRequest = new URLRequest("BANNERADS.ASP");
requester.method = URLRequestMethod.POST;
LOADER.load(requester);
}
public function getdata(Evt:Event){
var loader2 : URLLoader = new URLLoader(new URLRequest(LOADER.data));
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
var IMAGE :URLRequest = new URLRequest(loader2.data.IMAGEURL);
ADVERTISERURL = loader2.data.NAVIGATEURL;
PICTURE.load(IMAGE);
addChild(PICTURE);
LoadASP();
}
public function onLoaded(evt:Event){
PICTURE.addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(evt:MouseEvent):void {
navigateToURL(new URLRequest(ADVERTISERURL));
}
}
}