User Guide
874 Media components (Flash Professional only)
Usage
myMedia.preferredHeight
Description
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.
Example
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));
}
Media.preferredWidth
Applies to
MediaDisplay, MediaPlayback.
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
myMedia.preferredWidth
Description
Property; set according to a FLV file’s default width value. The default value is undefined.
Example
The following example sets the desired width of the variable mediaWidth:
var mediaWidth:Number = myMedia.preferredWidth;