Media.setMedia()
Applies to
MediaDisplay, MediaPlayback
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
myMedia.setMedia(contentPath [, mediaType])
Parameters
contentPath
.
undefined
A string used to set the media type to either FLV or MP3. This parameter
mediaType
is optional. The default value is FLV.
Returns
Nothing.
Description
Method; sets the media type and path to the specified media type using a URL parameter.
This method provides the recommended way of setting the content path and media type for the
MediaPlayback and MediaDisplay components. The
used to set the content path, but does not allow you to set the media type.
If you are working only with FLV files, you do not need to specify a
are working exclusively with MP3 files, you must set the
you are switching back and forth between FLV and MP3 files, you must change the media type
each time in your
the media type to MP3, the file will not play.
Example
The following code provides new media for a component instance to play.
myMedia.setMedia("http://www.RogerMoore.com/moonraker.flv", "FLV");
Media.stop()
Applies to
MediaDisplay, MediaPlayback
Availability
Flash Player 7.
A string that indicates the URL of the media to be played. The default value is
call. If you attempt to play an MP3 file without explicitly setting
setMedia()
Media.contentPath
mediaType
parameter to MP3 once. If
mediaType
Media components (Flash Professional only)
property can also be
parameter. If you
535
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?