/// Preload the first movie in the player.
///
/// This should only be called once. Further movie loads should preload the
/// specific `MovieClip` referenced.
Preload the first movie in the player.
This should only be called once. Further movie loads should preload the
specific `MovieClip` referenced.
Preload the first movie in the player . This should only be called once . Further movie loads should preload the specific ` MovieClip ` referenced .
fn preload(&mut self) {
        let mut is_action_script_3 = false;
        self.mutate_with_update_context(|context| {
            let mut morph_shapes = fnv::FnvHashMap::default();
            let root = *context.levels.get(&0).expect("root level");
            root.as_movie_clip()
                .unwrap()
                .preload(context, &mut morph_shapes);
            let lib = context
                .library
                .library_for_movie_mut(root.as_movie_clip().unwrap().movie().unwrap());
            is_action_script_3 = lib.avm_type() == AvmType::Avm2;
            // Finalize morph shapes.
            for (id, static_data) in morph_shapes {
                let morph_shape = MorphShape::new(context.gc_context, static_data);
                lib.register_character(id, crate::character::Character::MorphShape(morph_shape));
            }
        });
        if is_action_script_3 && self.warn_on_unsupported_content {
            self.ui.display_unsupported_message();
        }
    }
fn preload ( & mut self ) { let mut is_action_script_3 = false ; self . mutate_with_update_context ( | context | { let mut morph_shapes = fnv :: FnvHashMap :: default ( ) ; let root = * context . levels . get ( & 0 ) . expect ( " " ) ; root . as_movie_clip ( ) . unwrap ( ) . preload ( context , & mut morph_shapes ) ; let lib = context . library . library_for_movie_mut ( root . as_movie_clip ( ) . unwrap ( ) . movie ( ) . unwrap ( ) ) ; is_action_script_3 = lib . avm_type ( ) == AvmType :: Avm2 ; // Finalize morph shapes. for ( id , static_data ) in morph_shapes { let morph_shape = MorphShape :: new ( context . gc_context , static_data ) ; lib . register_character ( id , crate :: character :: Character :: MorphShape ( morph_shape ) ) ; } } ) ; if is_action_script_3 && self . warn_on_unsupported_content { self . ui . display_unsupported_message ( ) ; } }
Preload the first movie in the player.
Preload the first movie in the player .
&mut self