# Class AsyncMedia.MediaStateChangeEvent

java.lang.Object
com.codename1.ui.events.ActionEvent
com.codename1.media.AsyncMedia.MediaStateChangeEvent

Enclosing interface:
  `AsyncMedia`

public static class AsyncMedia.MediaStateChangeEvent extends ActionEvent

Encapsulates a state-change event on a Media object.

##### Since

7.0

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class ActionEvent

  `ActionEvent.Type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MediaStateChangeEvent(AsyncMedia source, AsyncMedia.State oldState, AsyncMedia.State newState)`
  Creates a new state change event for the given source.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AsyncMedia.State`
  `getNewState()`
  The new state.
  `AsyncMedia.State`
  `getOldState()`
  The previous state.

  ### Methods inherited from class ActionEvent

  `consume, getActualComponent, getCommand, getComponent, getDraggedComponent, getDropTarget, getEventType, getKeyEvent, getProgress, getSource, getX, getY, isConsumed, isLongEvent, isPointerPressedDuringDrag, setPointerPressedDuringDrag`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MediaStateChangeEvent

    public MediaStateChangeEvent(AsyncMedia source, AsyncMedia.State oldState, AsyncMedia.State newState)

    Creates a new state change event for the given source.

    ###### Parameters

    - `source`: The media object whose state is changing.

    - `oldState`: The old state

    - `newState`: The new state

- ## Method Details

  - ### getOldState

    public AsyncMedia.State getOldState()

    The previous state.

    ###### Returns

    the oldState

  - ### getNewState

    public AsyncMedia.State getNewState()

    The new state.

    ###### Returns

    the newState