File: ../../Developer.FoundationDotJS.org/wwwroot/Foundation.js

Foundation
Interface Resourceful

Object
  
 
 
Foundation.Resourceful

All Implemented Interfaces:

Interface

Direct Known Subclasses:

ClientLoader, Control, Game, Resourceful

All Known Implementing Classes:

ClientLoader, Control, FloatControl, Game, Resourceful


Foundation.Resourceful

implements Foundation.Interface

Methods to retrieve resources. See the Foundation.Resourceful home page for more information.

Note: This interface should be implemented, not extended.
Do not pass as first argument to Foundation.createClass function.


Method Summary
 dispose()
Variantresource(/*String*/ index, /*Character*/ key, /*String*/ value, ...)
Returns the value in the highest resourcePack containing the index. The resourcePack can be a property of the instance, a virtual property, a static property, or a static property of any ancestor class. The value in the highest resource pack defining the index is returned.
static Variantresource(/*String*/ index, /*Character*/ key, /*String*/ value, ...)
Returns the value in the highest resourcePack containing the index. The resourcePack can be a static property of the class or of any ancestor class. The value in the highest resource pack defining the index is returned.
 resourceUrl(index)
static VariantresourceUrl(/*String*/ index, /*Character*/ key, /*String*/ value, ...)
Returns the value in the highest resourcePack containing the index. The resourcePack can be a static property of the class or of any ancestor class. The value in the highest resource pack defining the index is returned.

Methods inherited from Foundation.Interface
getTypePath

Method Detail

dispose

dispose()
Overrides:
dispose in class Interface

resource

Variant resource(/*String*/ index,
                 /*Character*/ key,
                 /*String*/ value,
                 ...)

Returns the value in the highest resourcePack containing the index. The resourcePack can be a property of the instance, a virtual property, a static property, or a static property of any ancestor class. The value in the highest resource pack defining the index is returned.

Parameters:
index - 
The index of the resource.
key   ⌉ 
(Optional)(These 2 parameters in groups) Key/value pairs to replace in the returned resource.
value ⌋ 
(Optional)(Repeatable group) Key/value pairs to replace in the returned resource.
Returns:
The resource.

Example:

// If the value 'greetings' in the resourcePack is "Greetings %n".
var greetingsString=this.resource("greetings",'n',"Professor");
// greetingsString now equals "Greetings Professor"

resource

static Variant resource(/*String*/ index,
                        /*Character*/ key,
                        /*String*/ value,
                        ...)

Returns the value in the highest resourcePack containing the index. The resourcePack can be a static property of the class or of any ancestor class. The value in the highest resource pack defining the index is returned.

Parameters:
index - 
The index of the resource.
key   ⌉ 
(Optional)(These 2 parameters in groups) Key/value pairs to replace in the returned resource.
value ⌋ 
(Optional)(Repeatable group) Key/value pairs to replace in the returned resource.
Returns:
The resource.

Example:

// If the value 'greetings' in the resourcePack is "Greetings %n".
var greetingsString=MyClass.resource("greetings",'n',"Professor");
// greetingsString now equals "Greetings Professor"

resourceUrl

resourceUrl(index)
Parameters:
index - 


resourceUrl

static Variant resourceUrl(/*String*/ index,
                           /*Character*/ key,
                           /*String*/ value,
                           ...)

Returns the value in the highest resourcePack containing the index. The resourcePack can be a static property of the class or of any ancestor class. The value in the highest resource pack defining the index is returned.

Parameters:
index - 
The index of the resource.
key   ⌉ 
(Optional)(These 2 parameters in groups) Key/value pairs to replace in the returned resource.
value ⌋ 
(Optional)(Repeatable group) Key/value pairs to replace in the returned resource.
Returns:
The resource.

Example:

// If the value 'greetings' in the resourcePack is "Greetings %n".
var greetingsString=MyClass.resource("greetings",'n',"Professor");
// greetingsString now equals "Greetings Professor"