As Jellby said, the current standard doesn't provide for embedded media or scripting. There are a couple of non-standard solutions, though they should only be used if you are only targeting a specific reading device.
Here's Liza Daly's post on using JavaScript with iBooks. As with the other link, this will
only work on the iPad.
Adobe's reading system will recognise flash elements, there's an example
here. This won't work on the majority of device implementations, but does work on the desktop reader.