I am trying to modify some code to include a movie clip that covers existing media controls with “grayed out” buttons if there is no media.
The code uses an onEnterFrame to determine if there is media. What I’ve done is attach the movie w/ grayed out buttons if there is no media, and remove that movieClip if there is media.
The issue I’m having is that there seems to be a delay when I try to remove the movie clip. Does anyone know why this is happening? Or perhaps know a better way to remove the clip more quickly? (please see code below. My modifications are in red)
Thanks!!
//Pre-loader code
this.onEnterFrame = function(){
//trace(this._x + “/” +this.y)
//check to see if media is playing ni MediaDisplay component named “media_container”
mediaHolder = playerMain_mc.presentation.media_container; //media component
if (mediaHolder !== undefined) {
isMedia = true;
} else {
isMedia = false;
}
//Check loading percentage
var loadPerc:Number = playerMain_mc.currentPage_xmlnode.attributes.loadPercentage;
if (loadPerc == 0) {
//this._visible = false;
[COLOR=red] trace(“false”);
//Attach a movie which makes the player buttons appear grayed out if there is no media
this.attachMovie(“coverClip_mc”, “coverClip”, this.getNextHighestDepth());[/COLOR]
} else {
//Remove movie clip that makes player buttons appear grayed out
[COLOR=red]coverClip.removeMovieClip();
[/COLOR]
if (this._visible == false) {this._visible = true}