PDA

View Full Version : Problem with ia_ambientmix not loading


mccoy
07-29-2008, 03:29 AM
I'm using ia_ambientmix for some background music in my pano.

The problem is that sometimes it works, and sometimes not, in an almost random fashion. When it doesn't work, it throws out this error:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ia.media::AmbientSoundPlugin/setAttribute()
at Hotspots/change()
at Hotspots/execute()
at Hotspots/addGlobal()
at Hotspots/parseHotspots()
at Hotspots/waitForParameters()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


But if you reload, it usually works (sometimes).

This is the (simplified) code that I use to start ia_ambientmix:


<parameters>
layer_4 = files/ia_ambientmix.swf
</parameters>

<ia_ambientmix>
gallery=files/gallery.mp3
mainhall=files/mainhall.mp3
cave1=files/cave1.mp3
cave2=files/cave2.mp3
hallway=files/hallway.mp3
chest=files/chest2.mp3
</ia_ambientmix>

<global onStart="external.ia_ambientmix.mix=mainhall:1,300;pano.beh aviour=-1" onEnterFullscreen="full.alt=exit fullscreen" onExitFullscreen="full.alt=enter fullscreen" >

[...]


You can check it out live here:

http://www.aftertheice.com/gallery

The most annoying thing is not only that the sound doesn't play, but also that it breaks other hotspots. When it fails, try to go out through the back door... it won't work. The door will make the sound (I'm using my own soundplayer plug-in for one-time sounds) but you won't "walk" to the next pano. But when ia_ambientmix works, everything works.

My theory is that sometimes the ia_ambientmix file is loaded later than the hotspot plugin, so when the global calls it, it doesn't work. But I've tried to put it in a thousand of different ways (after a timer, after clicking a button, after loading another hotspot...) and it still fails sometimes.


Any help solving this will be greatly appreciated!

mccoy
07-30-2008, 01:04 AM
I finally used mp3player instead of ia_ambientmix. I lost the cool cross-fade between background songs, but at least it's working flawlessly.