Constructor
new MediaBag(project)
MediaBag constructor
Name | Type | Description |
---|---|---|
project | module:project/JClicProject. | The JClic project to which this media bag belongs |
- Source
Members
elements :object
The collection of module:bads/MediaBagElement.MediaBagElement
objects
- object
- Source
project :module:project/JClicProject.JClicProject
The JClic project to which this MediaBag belongs
- Source
Methods
buildAll(type, callbackopt, psopt) → {number}
Preloads all resources.
Use with care! Calling this method will start loading all the resources defined in the
MediaBag, whether used or not in the current activity.
Name | Type | Attributes | Description |
---|---|---|---|
type | string | The type of media to be build. When | |
callback | function | <optional> | Function to be called when each element is ready. |
ps | module:JClicPlayer. | <optional> | An optional |
- Source
- The total number of elements that will be built
- Type:
- number
countWaitingElements() → {number}
Checks if there are media waiting to be loaded
- Source
- The amount of media elements already loaded, or -1 if all elements are ready
- Type:
- number
getAttributes() → {object}
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
- Source
- The resulting object, with minimal attrributes
- Type:
- object
getElement(name, createopt) → {module:bags/MediaBagElement.MediaBagElement}
Finds a module:bads/MediaBagElement.MediaBagElement
by its name, creating a new one if not found and requested.
Name | Type | Attributes | Description |
---|---|---|---|
name | string | The name of the element | |
create | boolean | <optional> | When |
- Source
getElementByFileName(file, createopt) → {module:bags/MediaBagElement.MediaBagElement}
Gets a module:bads/MediaBagElement.MediaBagElement
by its file name.
Name | Type | Attributes | Description |
---|---|---|---|
file | string | The requested file name | |
create | boolean | <optional> | When |
- Source
getElementsOfType(type) → {Array.<string>}
Get the names of the media elements that are of the given type.
When the search type is font
, the fontName
property is used instead of name
Name | Type | Description |
---|---|---|
type | string | The type of elements to search |
- Source
- Type:
- Array.<string>
getSkinElement(name, ps) → {module:skins/Skin.Skin}
Loads a Skin
object
Name | Type | Description |
---|---|---|
name | string | The skin name to be loaded |
ps | string | The |
- Source
- Type:
- module:skins/Skin.
Skin
setAttributes(data)
Loads the MediaBag content from a data object
Name | Type | Description |
---|---|---|
data | object | The data object to parse |
- Source
setProperties($xml)
Loads this object settings from a specific JQuery XML element
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The XML element to parse |
- Source