Skip to main content
December 11, 2012
Question

bannerads.swf not rotating Banners

  • December 11, 2012
  • 1 reply
  • 2061 views

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));

                  }

                                                                                          

          }

  }

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 11, 2012

does it work correctly when testing in flash pro?

if yes, the problem is your embedding code.

December 12, 2012

I cannot test in Flash Pro because the Flash software is on widows 7 operating

system while the web server to run the ASP ( BANNERADS.ASP) program to access the  BANNERADS.MDB Access DATABASE ( FOR Affiliate Advertisements) is on

windows 2003 server both on the same machine. I was wondering if the name=value

pair containing IMAGEURL, ADVERTISERURL variables which have data retrieved

from the BANNERADS.MDB Database (using BANNERADS.ASP) IS outputted

in correct format back to BANNERADS.SWF on the web page.

kglad
Community Expert
Community Expert
December 12, 2012

display the data and see.