Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Demos and Utils / Re: Loadup - A PureMVC AS3 Utility on: February 11, 2010, 09:56:01
Thanks for this tip. I actually thought about this loader issue. But I didn't find the right place to change it... Now I found it and it's working.
I added a new loader AssetLoadBySoundLoader.as, which organizes the sound load. The only problem is, that the loaderContext should be of type SoundLoaderContext. If I change it, it cannot implement IAssetLoader... So I just set this parameter to null (loader.load( url, null)).
I'll send the files to you, so you can add them to the package, if you want.
2  PureMVC Manifold / Demos and Utils / Loadup - SoundAsset on: February 10, 2010, 01:42:44
Hi Philip,
Thanks for this great utility. I just started a big project with a lot of asset-loading stuff and it's really amazing, how easily and clearly I can manage these loading operations with your Loadup utility. Thanks to Tek (http://www.tekool.net), I use it in a pure actionscript project.
But now I came to a problem. I would like to use this utility to load sound assets (.mp3). In fact, your utility does load such assets. At least I think it does. But I don't know how to cast this asset properly to a sound object.
I wrote an AssetOfTypeFlashAudio class, extending the AssetBase class and implementing IAsset with a getter method, that returns a Sound object. Finally I added a AUDIO_ASSET_TYPE const to the Loadup class.

When the asset is loaded now, it's returned by the AssetOfTypeFlashAudio class. Then I try to cast it with var sound:Sound = audioAssetClass.sound . This works, too. But as soon as I try to play it (sound.play) it throws an error #1009: Cannot access a property or method of a null object reference.

Has anyone already used this utility to load sound assets?

Thank you for your time.
Pages: [1]