core: Allow pulling the AVM2 Object out of a participating movie clip.
This commit is contained in:
parent
f85319aa4c
commit
edd31c4b83
|
@ -1,5 +1,6 @@
|
|||
//! `MovieClip` display object and support code.
|
||||
use crate::avm1::{Avm1, Object as Avm1Object, StageObject, TObject, Value as Avm1Value};
|
||||
use crate::avm2::Value as Avm2Value;
|
||||
use crate::backend::audio::AudioStreamHandle;
|
||||
|
||||
use crate::avm1::activation::{Activation, ActivationIdentifier};
|
||||
|
@ -1276,6 +1277,15 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
|
|||
.unwrap_or(Avm1Value::Undefined)
|
||||
}
|
||||
|
||||
fn object2(&self) -> Avm2Value<'gc> {
|
||||
self.0
|
||||
.read()
|
||||
.object
|
||||
.and_then(|o| o.as_avm2_object().ok())
|
||||
.map(Avm2Value::from)
|
||||
.unwrap_or(Avm2Value::Undefined)
|
||||
}
|
||||
|
||||
fn unload(&self, context: &mut UpdateContext<'_, 'gc, '_>) {
|
||||
for child in self.children() {
|
||||
child.unload(context);
|
||||
|
|
Loading…
Reference in New Issue