getSkinElement

 

Each object in the skin has a unique ID. ID's are managed via the ID display within Skin Machine.

Custom objects added to a skin are assigned unique ID's as soon as they are created. You can change the ID using the ID display within Skin Machine. ID's must be unique. If two objects share the same ID, Skin Machine will automatically make them unique when saving the skin.

NOTE: When Skin Machine finds duplicate ID's one of the objects gets a number appended to it. For example, if there are two objects named "myControlA", one of the objects will be named "myControlA1" and the other will remain in-tact as "myControlA".

Built-in Wimpy Controls have specific ID's... and they can not be altered. All Wimpy Controls have ID's that begin with "cmp_" followed by an applicable name for that particular control. (e.g. "cmp_play" is the ID for the play button. )

Problems? Double-check your custom object ID's by closing and re-opening a skin to see if Skin Machine detected and fix non-unique ID's.

 

getSkinElement( id )

 

Parameters

id string

The ID of the object as defined in the skin.

 

Return Value

jbeeb object

A JBEEB Object of a an element within a player.

 

See Also

 

Examples

Example 1

<!-- Player Instance exists with the 
ID attribute (so we can get a handle to it) -->
<div id="myPlayer" wimpyplayer></div>

<script>
// Get a handle to the player var p = wimpy.getPlayer("myPlayer");

// Get a handle to a control var control = p.getSkinElement("cmp_info");
// do something with the control
control.setAlpha(0.5);
control.setText("hello there");
control.setTextColor("#FF0000");
control.setFill("#FFFFFF"); </script>

 

Example 2

<!-- Set up a target to put the player into -->
<div id="myTargetID"></div>

<script> var myPlayer; function getControls(){ // Get a handle to a control var control = myPlayer.getSkinElement("cmp_info"); // do something with the control
control.setAlpha(0.5);
control.setText("hello there");
control.setTextColor("#FF0000");
control.setFill("#FFFFFF"); } // Create a player. (Creating a player returns a handle.) myPlayer = new wimpyPlayer({target:"myTargetID", media:"foo.mp3"});
// Add a listener to wait until the skin has been
// rendered and ready to interact with. myPlayer.addEventListener("skinReady", this.getControls, this);

</script>