Moscrif API Docs for: 2012q3
Show:

AdBanner Class

Extends BaseClass
include "lib://ads/adBanner.ms";
Library: ads

This class encapsulated banner ads (iAd for iPhone, iPod and iPad, AdMob for Android devices).

Example:

var banner = new AdBanner({provider:#simulate, testing:true});
banner.show(0, 0);

Methods

_setDefaults

() private

Inherited from BaseClass

Method is setting control's defaults variables set from current theme.

_setOptions

() private

Inherited from BaseClass

Method is setting control's option variables. Options is present at the contstuct of the object after defaults are applied.

_setProperty

() private

Inherited from BaseClass

Method is parsing options and set properties to the control. Options is a JSON object.

afterInit

() protected

Inherited from BaseClass

Method is executed after inititialization of this object

beforeInit

() protected

Inherited from BaseClass

Method is executed before inititialiation of this object

hide

()

This method hides ad banner.

init

()

Inherited from BaseClass

Initializes banner ads.

Example:

var banner = new AdBanner({
    provider:#auto,
    adId:"a1504f8e07e325a",     // AdMob ID for AdMob system
    size:#smartPortrait,
    testing:true
});

setDefaults

() protected

Inherited from BaseClass

Method is setting default class values

setOptions

() protected

Inherited from BaseClass

Method is setting options passed as class parameters

show

(
  • x
  • y
  • [testing=false]
)

This method creates and shows ad banner at specified position on screen.

Parameters:

  • x Integer

    x coordinate of screen's position.

  • y Integer

    y coordinate of screen's position.

  • [testing=false] Boolean optional

    You have to set to true when testing.

Example:

var banner = new AdBanner({provider:#auto, adId:"a1504f8e07e325a", size:#smartPortrait, testing:true});
banner.show(0, 0);

Properties

defaults

Object

Inherited from BaseClass:

Sets default controls options

initialized

Boolean

Inherited from BaseClass:

options

Object

Inherited from BaseClass:

provider

Symbol

  • #auto - automatically detects the best provider (iAd for iOS, AdMob for Android, otherwise simlulate banner ads)
    • #AdMob - use AdMob (on both, iOS and Android)
    • #iAd - use iAd (iOS only)
    • #simulate - just simulate banner ads

undefined

Object

Inherited from BaseClass:

Special property (Undefined Property Handler - UPH) executed when property is undefined. It can be that JSON format is in format "key" : "value". Key is an string, so if this is the case methot return "value". As well as k is a regular property of the class it returns getter of this property

Sub-properties: