Skip navigation
Polygon Jedi
Currently Being Moderated

Loaded youtube video appearing above other layers. Help needed on getNextHighestDepth ()

May 8, 2012 12:23 AM

Tags: #depth #youtube_video #getnexthighestdepth

Dear All,

 

I have loaded a youtube video inside a flash and also couple of other mouseover pulllout animations As of now the youtube video is loading above the other animations. If I replace the youtube video with a couple of images everything works fine. But with the youtube video. i'm not able to see the mouve over effects.

 

Here's how I loaded the animation:

 

 

function checkBounds1(X, Y, W, H)

{

    bounds1.onEnterFrame = function ()

    {

        var _loc2 = _root._xmouse;

        var _loc3 = _root._ymouse;

        if (_loc2 < X || _loc2 > X + W || _loc3 < Y || _loc3 > Y + H)

        {

            delete bounds1.onEnterFrame;

            checkBoundsCallback1();

 

        } // end if

    };

} // End of the function

function checkBoundsCallback1()

{

    promo1_anim.gotoAndPlay("out");

    promo1.enabled = true;

} // End of the function

promo1.onRollOver = function ()

{

    promo1_anim.gotoAndPlay("in");

    this.enabled = false;

    checkBounds1(0, 0, 338, 228);

};

var bounds1 = createEmptyMovieClip("bounds1", getNextHighestDepth());

 

 

 

 

And here's how I loaded a youtube video:

 

 

// create a MovieClip to load the player into

var ytplayer:MovieClip = _root.createEmptyMovieClip("ytplayer",0);

 

 

 

 

// create a listener object for the MovieClipLoader to use

var ytPlayerLoaderListener:Object = {

  onLoadInit: function() {

    // When the player clip first loads, we start an interval to

    // check for when the player is ready

    loadInterval = setInterval(checkPlayerLoaded, 250);

  }

};

 

 

var loadInterval:Number;

 

 

 

 

function checkPlayerLoaded():Void {

    // once the player is ready, we can subscribe to events, or in the case of

    // the chromeless player, we could load videos

    if (ytplayer.isPlayerLoaded()) {

        ytplayer.addEventListener("onStateChange", onPlayerStateChange);

        ytplayer.addEventListener("onError", onPlayerError);

        clearInterval(loadInterval);

ytplayer.setSize(850,493);

ytplayer._x = 95;

ytplayer._y = 0;

 

 

    }

}

 

 

function onPlayerStateChange(newState:Number) {

    trace("New player state: "+ newState);

}

 

 

function onPlayerError(errorCode:Number) {

    trace("An error occurred: "+ errorCode);

}

 

 

// create a MovieClipLoader to handle the loading of the player

var ytPlayerLoader:MovieClipLoader = new MovieClipLoader();

ytPlayerLoader.addListener(ytPlayerLoaderListener);

 

 

// load the player

ytPlayerLoader.loadClip("http://www.youtube.com/v/2K2554Wxssk&autoplay=1&loop=1", ytplayer);

 

 

 

The animation code has been working for years now. I think all this has got to do with the getNextHighestDepth (). I have tired giving values like 0 and 1 but ended up helpess.

Any help would really great at this point.

 

Thank-you.

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points