Packagecom.adobe.ane.stageAd
Classpublic class StageBannerAd
InheritanceStageBannerAd Inheritance flash.events.EventDispatcher

The main class responsible for creating, displaying and managing banner advertisements from the iAd network



Public Properties
 PropertyDefined By
  align : String
A value from the StageAdAlign class that specifies the alignment of the StageBannerAd with respect to the stage.
StageBannerAd
  isSupported : Boolean
[static] [read-only] Indicates whether the feature is supported on the underlying platform.
StageBannerAd
  loaded : Boolean
[read-only] Indicates whether or not the StageBannerAd is currently loaded with iAd content.
StageBannerAd
  offset : uint
The offset from the top or bottom of the stage at which the StageBannerAd is displayed.
StageBannerAd
  showOnlyIfLoaded : Boolean
Indicates whether an empty banner should be shown before the iAd content has finished loading.
StageBannerAd
  stage : Stage
The Stage instance on which this StageBannerAd is to be displayed Set stage to null to hide this StageBannerAd object.
StageBannerAd
  viewport : Rectangle
[read-only] The area on the stage in which the StageBannerAd object is displayed.
StageBannerAd
Public Methods
 MethodDefined By
  
Creates a new StageBannerAd instance
StageBannerAd
  
Cancel the Action that has been initiated on the StageBannerAd by a user interaction
StageBannerAd
Events
 Event Summary Defined By
  The adActionComplete event is dispatched when an ad action finishes and the user is returned to the application's UI.StageBannerAd
  The adActionStart event is dispatched when the end user interacts with iAd content in the StageBannerAd by tapping on it.StageBannerAd
  The adLoadComplete event is dispatched when iAd content is loaded into the StageBannerAd.StageBannerAd
  The adLoadFail event is dispatched when iAd content fails to load in the StageBannerAd.StageBannerAd
Property Detail
alignproperty
align:String

A value from the StageAdAlign class that specifies the alignment of the StageBannerAd with respect to the stage.

This property is set to StageAdAlign.BOTTOM by default.


Implementation
    public function get align():String
    public function set align(value:String):void

See also

isSupportedproperty 
isSupported:Boolean  [read-only]

Indicates whether the feature is supported on the underlying platform.

This method should always be called before attempting to use any functionality related to the feature (currently, the feature is supported only in AIR on iOS.)


Implementation
    public static function get isSupported():Boolean
loadedproperty 
loaded:Boolean  [read-only]

Indicates whether or not the StageBannerAd is currently loaded with iAd content. If it is not loaded, the StageBannerAd will not be visible on the stage


Implementation
    public function get loaded():Boolean
offsetproperty 
offset:uint

The offset from the top or bottom of the stage at which the StageBannerAd is displayed. This property is set to 0 by default.

If the align property is set to StageAdAlign.TOP, the offset is equal to the distance in points between the top of the StageBannerAd and the top of the stage. If the align property is set to StageAdAlign.BOTTOM, the offset is equal to the distance in points between the bottom of the StageBannerAd and the bottom of the stage.


Implementation
    public function get offset():uint
    public function set offset(value:uint):void
showOnlyIfLoadedproperty 
showOnlyIfLoaded:Boolean

Indicates whether an empty banner should be shown before the iAd content has finished loading. This property is set to true by default.

By default, the banner ad becomes visible only when the iAd content has been successfully loaded in it. This is in order to conform to iOS guidelines, which specify that an empty banner ad should never be visible in the application. If this happens, it is detected as a failure and an AD_LOAD_FAIL event is fired.

As a convenience for UI designers during the development of an Application, this property can be set to false, which lets the application UI designer to ascertain the location and size of the banner ad as if it had loaded successfully, by displaying the banner immediately after the stage is set, irrespective of whether it is loaded with iAd content.

Note that it is highly recommended that this property should be set to true in the production environment and only set to false during development.


Implementation
    public function get showOnlyIfLoaded():Boolean
    public function set showOnlyIfLoaded(value:Boolean):void
stageproperty 
stage:Stage

The Stage instance on which this StageBannerAd is to be displayed Set stage to null to hide this StageBannerAd object.

When the stage property is set, the StageBannerAd does not load immediately. This allows the application to make any required UI changes after the StageBannerAd is loaded. In this case, the application listens for the ad_load_complete event and performs any required UI changes in the event handler.


Implementation
    public function get stage():Stage
    public function set stage(value:Stage):void

See also

flash.display.Stage
com.adobe.ane.stageAd.StageAdEvent.AD_LOAD_COMPLETE
viewportproperty 
viewport:Rectangle  [read-only]

The area on the stage in which the StageBannerAd object is displayed.


Implementation
    public function get viewport():Rectangle
Constructor Detail
StageBannerAd()Constructor
public function StageBannerAd()

Creates a new StageBannerAd instance

Method Detail
cancelAction()method
public function cancelAction():void

Cancel the Action that has been initiated on the StageBannerAd by a user interaction

Event Detail
adActionComplete Event
Event Object Type: com.adobe.ane.stageAd.StageAdEvent
StageAdEvent.type property = com.adobe.ane.stageAd.StageAdEvent.AD_ACTION_COMPLETE

The adActionComplete event is dispatched when an ad action finishes and the user is returned to the application's UI. The application should re-start any services, like background music, which it had stopped when the action started.

Defines the value of the type property of a StageAdEvent event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the event object with an event listener.
targetThe StageBannerAd or StageFullscreenAd object receiving data.
willLeaveApplicationfalse
messageempty String
adActionStart Event  
Event Object Type: com.adobe.ane.stageAd.StageAdEvent
StageAdEvent.type property = com.adobe.ane.stageAd.StageAdEvent.AD_ACTION_START

The adActionStart event is dispatched when the end user interacts with iAd content in the StageBannerAd by tapping on it. It indicates that an action is about to start and the application's UI will be covered by the UI of the ad action. The application should stop or pause any services, like background music, which might interfere with the ad action. An action may or may not cause the application to go into the background. For example, if an action will cause the web browser to be launched, the application will go into background.

Defines the value of the type property of a StageAdEvent event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; the action initiated by the user interaction cannot be cancelled by calling preventDefault().
currentTargetThe object that is actively processing the event object with an event listener.
targetThe StageBannerAd or StageFullscreenAd object receiving data.
willLeaveApplicationWhether the action that is about to start will cause the Application to go into the background
messageempty String
adLoadComplete Event  
Event Object Type: com.adobe.ane.stageAd.StageAdEvent
StageAdEvent.type property = com.adobe.ane.stageAd.StageAdEvent.AD_LOAD_COMPLETE

The adLoadComplete event is dispatched when iAd content is loaded into the StageBannerAd. The iAd content automatically becomes visible when this event occurs. The application can then perform any additional UI adjustments required to accomodate the StageBannerAd.

Defines the value of the type property of a StageAdEvent event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the event object with an event listener.
targetThe StageBannerAd or StageFullscreenAd object receiving data.
willLeaveApplicationfalse
messageempty String
adLoadFail Event  
Event Object Type: com.adobe.ane.stageAd.StageAdEvent
StageAdEvent.type property = com.adobe.ane.stageAd.StageAdEvent.AD_LOAD_FAIL

The adLoadFail event is dispatched when iAd content fails to load in the StageBannerAd. iAd content could fail to load for any of the following reasons:

By default, the StageBannerAd is automatically removed from the stage when this event occurs. If the application requires the StageBannerAd to remain visible despite failure to load iAd content, the application can set the StageBannerAd.showOnlyIfLoaded property to false

Defines the value of the type property of a StageAdEvent event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the event object with an event listener.
targetThe StageBannerAd or StageFullscreenAd object receiving data.
willLeaveApplicationfalse
messageThe details of the reason why the ad failed to load