Nathan Adams
fe6b79a9b7
chore: Make avm1 accessible to MovieClip::preload
2020-04-17 23:48:58 -07:00
Mike Welsh
4df1128c19
core: Implement Object.registerClass (merge #344 )
...
Implement Object.registerClass
2020-03-25 18:55:49 -07:00
Nathan Adams
d850443c84
avm1: Refactor to expose `avm, context` in `post_instantiate`
2020-02-29 23:05:15 +01:00
David Wendt
ded7737ac0
`SwfMovie::from_data` is falliable and we should not hide those errors behind panics.
2020-02-26 18:15:01 -05:00
David Wendt
0313225164
Don't allow movie loads to be removed from the load manager unless they have completed or errored.
2020-02-26 18:03:45 -05:00
David Wendt
a023e161fc
Don't panic if our target handle was removed from the load manager. Instead, return an `Err` so that it can be properly reported on the console without killing the player.
2020-02-26 17:38:31 -05:00
David Wendt
aa6aba13dd
Abolish `context.root` completely.
...
`_root` is calculated dynamically based on the clip the currently executing function was called in.
Other things that used `context.root` have been changed to either update all layers or just update layer 0, which is the former `context.root`.
2020-02-22 00:02:46 -05:00
David Wendt
33d26b9149
Shorten `Pin<Box<dyn Future<Output=Result<T,E>> + 'static>>` into `OwnedFuture<T,E>`.
...
This is technically stricter on `fetch` impls, but right now we can't support non-`'static` futures at all.
2020-02-22 00:02:45 -05:00
David Wendt
aab339880d
Implement `XML.load()`, with tests.
...
Interestingly enough, very little actually has to be done inside the async process for XML. The async process basically just fetches data and fires an event handler when it's done. Everything else is handled via a system builtin, `XML.onData`.
2020-02-22 00:02:45 -05:00
David Wendt
b56c3b6aed
Fire events directly onto `broadcastMessage` instead of the individual event handlers on the `MovieClipLoader`, so that listeners run correctly.
...
Also, this fixes a double-borrow for `onClipInit`.
2020-02-22 00:01:19 -05:00
David Wendt
162b6b70f8
Allow unloading a movie by sending `None` to `replace_with_movie`.
...
This also adjusts `MovieClip.unloadMovie` to do just that, instead of removing the clip from the display list. We also have to unload clips when loading new movies into them, since `unloadMovie` desugars to loading `""` as the URL.
2020-02-22 00:01:19 -05:00
David Wendt
a8545ee277
Implement `onLoadInit` by pulling `LoadManager` into all clip load events.
2020-02-22 00:01:14 -05:00
David Wendt
7ff885a0de
Implement `MovieClipLoader` event broadcasts for `onLoadStart`, `onLoadProgress`, `onLoadComplete`, and `onLoadError`.
...
Note that we do not implement `onLoadInit` yet - this requires some ability to trigger an event when another movie clip loads.
2020-02-22 00:01:14 -05:00
David Wendt
64b787b73f
Implement `Collect` for `Loader`. (How did this compile without that?)
2020-02-21 23:57:58 -05:00
David Wendt
d84e11ed40
Introduce a new top-level object, `LoadManager`, which is responsible for all asynchronous behavior in the program. Migrate the existing async impls to it.
2020-02-21 23:57:58 -05:00