| Package | com.gestureworks.cml.element | 
| Class | public class YouTube | 
| Inheritance | YouTube    ElementFactory   flash.display.Sprite | 
The Video ID is the 10-digit ID associated with the video link. For example, a direct URL to the video used in this example is: http://www.youtube.com/watch?v=h0MZX-D8xzA. Notice the "h0MZX-D8xzA" is the video's id. A video must be set to allow embedding from its owner to be used by the YouTube API. If you receive "Error 100" or "Error 101", or "150", the video either no longer exists, or its embedding has been disabled.
     
       var ytElement:YouTubeElement = new YouTubeElement();
        ytElement.src = "h0MZX-D8xzA";
        ytElement.autoplay = true;
        ytElement.chrome = true;
        addChild(ytElement);
        ytElement.init();
     
     | Property | Defined By | ||
|---|---|---|---|
![]()  | alpha : Number [override] [write-only] 
		 sets the alpha for display objects
		   | ElementFactory | |
| autoplay : Boolean 
		 Sets whether or not the video plays immediately.  | YouTube | ||
![]()  | blur : Boolean 
		 Sets the drop shadow effect
		   | ElementFactory | |
![]()  | bottom : Number 
		 sets the bottom value
		   | ElementFactory | |
| chrome : Boolean 
		 Sets whether or not to use the chromed (player with buttons) or not.  | YouTube | ||
![]()  | class_ : String 
		 Object's css class; 
		   | ElementFactory | |
![]()  | className : String 
		 sets the class name of displayobject
		   | ElementFactory | |
![]()  | cmlIndex : int 
		 sets the cml index
		   | ElementFactory | |
![]()  | debugStyle : * 
		 sets the debug style
		   | ElementFactory | |
![]()  | displayEvents : String 
		 Use for dispatch completes.  | ElementFactory | |
![]()  | dropShadow : Boolean 
		 Sets the drop shadow effect
		   | ElementFactory | |
| height : Number [override] 
		 Sets the video height.  | YouTube | ||
![]()  | heightPercent : String 
		 sets the height percent of display object
		   | ElementFactory | |
![]()  | horizontalCenter : Number 
		 sets the horizontal center of display object
		   | ElementFactory | |
![]()  | id : String 
		 sets the id of child
		   | ElementFactory | |
![]()  | index : int 
		 sets the index of display object
		   | ElementFactory | |
| isPlaying : Boolean [read-only]   | YouTube | ||
![]()  | left : Number 
		 sets left value
		   | ElementFactory | |
| loaded : Boolean [read-only]   | YouTube | ||
![]()  | propertyStates : Array Deprecated: Please Use state  | ElementFactory | |
![]()  | right : Number 
		 sets the right value
		   | ElementFactory | |
![]()  | scale : Number 
		 Sets both the x and y scale values
		   | ElementFactory | |
![]()  | scaleX : Number [override] 
		 Sets width of the display object in pixels
		   | ElementFactory | |
![]()  | scaleY : Number [override] 
		 Sets width of the display object in pixels
		   | ElementFactory | |
| src : String 
		 Sets the video ID to be loaded.  | YouTube | ||
![]()  | state : Array 
		 property states array
		   | ElementFactory | |
![]()  | top : Number 
		 sets top value
		   | ElementFactory | |
![]()  | verticalCenter : Number 
		 sets the vertical center of display object
		   | ElementFactory | |
| width : Number [override] 
		 Sets the video width.  | YouTube | ||
![]()  | widthPercent : String 
		 sets the percent of width of display object
		   | ElementFactory | |
| Method | Defined By | ||
|---|---|---|---|
YouTube() 
		 Constructor
		   | YouTube | ||
![]()  | clone():* 
		 Returns clone of self
		   | ElementFactory | |
close():void 
		 closes the video
		   | YouTube | ||
displayComplete():void [override] 
		 CML callback Initialisation
		   | YouTube | ||
dispose():void [override] 
		 Dispose
		   | YouTube | ||
init():void [override] 
		 Initialisation method
		   | YouTube | ||
![]()  | parseCML(cml:XMLList):XMLList 
		 parses cml file
		   | ElementFactory | |
pause():void 
		 pauses the video
		   | YouTube | ||
play():void 
		 Start playing from the beginning.  | YouTube | ||
![]()  | postparseCML(cml:XMLList):void 
		 post parses the cml file
		   | ElementFactory | |
resume():void 
		 Resume from last spot.  | YouTube | ||
seek(value:Number, seekAhead:Boolean):void 
		 seek 
		   | YouTube | ||
stop():void 
		 stops the video
		   | YouTube | ||
![]()  | updateProperties(state:Number = 0):void 
		 this method updates the properties
		   | ElementFactory | |
| autoplay | property | 
autoplay:BooleanSets whether or not the video plays immediately. Note: the player does not start loading the FLV it requests until a call to play the video, or seek to the video is called.
 The default value is false;.
    public function get autoplay():Boolean    public function set autoplay(value:Boolean):void| chrome | property | 
chrome:BooleanSets whether or not to use the chromed (player with buttons) or not.
 The default value is false.
    public function get chrome():Boolean    public function set chrome(value:Boolean):void| height | property | 
height:Number[override] Sets the video height.
 The default value is 360.
    public function get height():Number    public function set height(value:Number):void| isPlaying | property | 
isPlaying:Boolean  [read-only]     public function get isPlaying():Boolean| loaded | property | 
loaded:Boolean  [read-only]     public function get loaded():Boolean| src | property | 
src:StringSets the video ID to be loaded. Must be present or the element will crash.
    public function get src():String    public function set src(value:String):void| width | property | 
width:Number[override] Sets the video width.
 The default value is 480.
    public function get width():Number    public function set width(value:Number):void| YouTube | () | Constructor | 
public function YouTube()Constructor
| close | () | method | 
 public function close():voidcloses the video
| displayComplete | () | method | 
override public function displayComplete():voidCML callback Initialisation
| dispose | () | method | 
override public function dispose():voidDispose
| init | () | method | 
override public function init():voidInitialisation method
| pause | () | method | 
 public function pause():voidpauses the video
| play | () | method | 
 public function play():voidStart playing from the beginning.
| resume | () | method | 
 public function resume():voidResume from last spot.
| seek | () | method | 
 public function seek(value:Number, seekAhead:Boolean):voidseek
Parameters
value:Number | |
seekAhead:Boolean | 
| stop | () | method | 
 public function stop():voidstops the video