HTML and CSS Reference
In-Depth Information
for(var i = 0; i < videos.length; i++){
_self.addVideo(videos[i]);
}
}
/**
* Adds a video to the movie
* @param {app.model.video} video
*/
this.addVideo = function(video){
/**
* You can add any video validation here
* before it's added to the movie
*/
_videos.push(video);
}
/**
* Gets all actors associated with the movie
* @return {Array}
*/
this.getActors = function(){
return _actors;
}
/**
* Gets an actor at a specific index
* @param {Integer} index
* @return {app.model.actor}
*/
this.getActor = function(index){
return _actors[index];
}
/**
* Sets all actors associated with the movie
* @param {Array}
*/
this.setActors = function(actors){
_actors.length = 0;
/**
* Rather than setting the actors all in one go,
* you use the addActor method, which can handle
* any validation for each actor before it's
* added to the object
*/
for(var i = 0; i < actors.length; i++){
_self.addActor(actors[i]);
Search WWH ::




Custom Search