Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Media components > Media.preferredHeight | |||
MediaDisplay, MediaPlayback.
Flash Player 7.
Flash MX Professional 2004.
myMedia.preferredHeight
Property; set according to a FLV file's default height value. This property applies only to FLV media, because the height is fixed for MP3 files. This property can be used to set the height and width properties (plus some margin for the component itself). The default value is undefined if no FLV media is set.
The following example sizes a MediaPlayback instance according to the media it is playing and accounts for the pixel margin needed for the component instance:
if (myPlayback.contentPath != undefined) {
var mediaHeight:Number = myPlayback.preferredHeight;
var mediaWidth:Number = myPlayback.preferredWidth;
myPlayback.setSize((mediaWidth + 20), (mediaHeight + 70));
}
Flash CS3