AnnieJS API Docs for: 1.1.3
show:

annie.URLLoader Class

Defined in: libs/URLLoader.js:16
Module: annie

Available since 1.0.0

资源加载类,后台请求,加载资源和后台交互都可以使用此类

Methods

_changeMouseCount

(
  • type
  • isAdd
)
private

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:135

Available since 1.0.0

增加或删除相应mouse或touch侦听记数

Parameters:

_fqs

(
  • data
  • query
)
String private

Defined in libs/URLLoader.js:79

Available since 1.0.0

格式化post请求参数

Parameters:

Returns:

_fus

(
  • src
  • data
)
Any private

格式化get 请求参数

Parameters:

Returns:

Any:

addEventListener

(
  • type
  • listener
)
public

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:107

Available since 1.0.0

给对象添加一个侦听

Parameters:

  • type String

    侦听类形

  • listener Function

    侦听后的回调方法,如果这个方法是类实例的方法,为了this引用的正确性,请在方法参数后加上.bind(this);

Example:

 this.addEventListener(annie.Event.ADD_TO_STAGE,function(e){trace(this);}.bind(this));

dispatchEvent

(
  • event
  • data
)
Boolean public

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:154

Available since 1.0.0

广播侦听

Parameters:

  • event annie.Event | String

    广播所带的事件对象,如果传的是字符串则直接自动生成一个的事件对象,事件类型就是你传入进来的字符串的值

  • data Object

    广播后跟着事件一起传过去的其他任信息,默认值为null

Returns:

Boolean:

如果有收听者则返回true

Example:

 var mySprite=new annie.Sprite(),
     yourEvent=new annie.Event("yourCustomerEvent");
  yourEvent.data='Flash2x';
  mySprite.addEventListener("yourCustomerEvent",function(e){
     trace(e.data);
   })
  mySprite.dispatchEvent(yourEvent);

hasEventListener

(
  • type
)
Boolean public

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:200

Available since 1.0.0

是否有添加过此类形的侦听

Parameters:

Returns:

Boolean:

如果有则返回true

load

(
  • url
  • contentType
)
public

Defined in libs/URLLoader.js:141

Available since 1.0.0

加载或请求数据

Parameters:

  • url String
  • contentType String

    如果请求类型需要设置主体类型,有form json binary jsonp等,请设置 默认为form

loadCancel

() public

Defined in libs/URLLoader.js:128

Available since 1.0.0

取消加载

removeAllEventListener

() public

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:237

Available since 1.0.0

移除对象中所有的侦听

removeEventListener

(
  • type
  • listener
)
public

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:214

Available since 1.0.0

移除对应类型的侦听

Parameters:

  • type String

    要移除的侦听类型

  • listener Function

    及侦听时绑定的回调方法

Properties

_MECO

Unknown private

Inherited from annie.EventDispatcher: libs/EventDispatcher.js:254

Available since 1.0.0

全局的鼠标事件的监听数对象表

data

Object public

Defined in libs/URLLoader.js:70

Available since 1.0.0

需要像后台传送的数据对象

Default: null

instanceId

Unknown public

Inherited from annie.AObject: libs/EventDispatcher.js:28

Available since 1.0.0

每一个annie引擎对象都会有一个唯一的id码。

Example:

 //获取 annie引擎类对象唯一码
 trace(this.instanceId);

instanceType

Unknown public

Inherited from annie.AObject: libs/EventDispatcher.js:46

Available since 1.0.3

每一个annie类都有一个实例类型字符串,通过这个字符串,你能知道这个实例是从哪个类实例而来

method

String public

Defined in libs/URLLoader.js:61

Available since 1.0.0

请求后台的类型 get post

Default: get

responseType

String public

Defined in libs/URLLoader.js:44

Available since 1.0.0

后台返回来的数据类弄

Default: null

url

String public

Defined in libs/URLLoader.js:53

Available since 1.0.0

请求的url地址