i'm using the MediaDisplay setup from this link: http://www.adobe.com/devnet/flash/articles/osmf-media-player.html
and i'm trying to get the DisplayObjectEvent.DISPLAY_OBJECT_CHANGE or DisplayObjectEvent.MEDIA_SIZE_CHANGE events, but i can't figure out where to put the listener.
player = new MediaDisplay(); player.autoPlay = false; player.loop = false; player.volume = 1; player.scaleMode = ScaleMode.LETTERBOX; player.addEventListener(MediaEvent.COMPLETE, completed); player.addEventListener(DisplayObjectEvent.DISPLAY_OBJECT_CHANGE, playerSized); player.source = source; addChild(player);
clearly this listener is not on the correct object, but for the life of me i can't figure out which object i should be listening to. please help!
I think it should be a MediaPlayer, something like:
mediaPlayer = new MediaPlayer();
Does this work for you?
i appreciate the answer, but i'm not using the OSMF directly, so it's not actually a MediaPlayerSprite that i'm instantiating, it's a MediaDisplay class, from the link i noted above.
i'm using the Media Player Template classes for this project.