Skip to content

How to check that sound is already load? #11

@katopz

Description

@katopz

Hi, noobs here!

question is... How to check that sound is already load?
so i can just play if sound already load...
far as i try is

var si:SoundInstance = SoundAS.getSound("somesound");

but at present it will throw error if it not exist, i did expected null for first load then call SoundAS.loadSound if si is null e.g.

if(!si)
    SoundAS.loadSound("somesound.mp3", "somesound");

and if i load sound via SoundAS.loadSound again without check for existing
SoundAS.loadCompleted is seem to be never fire for second load same url and type.

btw, i don't think it's a good idea to try catch there. "null for non exist SoundAS.getSound" should be better there.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions