Hey folks, so I’m still working with the accordion menu seen here.
If you click on Botswana (it’s the country just north of South Africa) you get a menu with 7-8 items. If you click on “Extension Gunners” that menu item has a swf with some interactivity. The interactivity is exactly what I want, but it’s kind of messy. The point here is that this swf loads into the menu just fine.
To clean it up I created a new swf. The only difference is that I am now adding all of the graphical elements via the custom class that the swf uses. And I also gave each item an ‘addChildAt’ value so I could control what ‘sat on top’ of what (This is important as I am trying to get an image to fade up under some of the elements on the stage).
So, the version on the map in the link above has the graphical elements loaded in the first frame of the timeline in the .fla file. The new version has nothing in the timeline. When I test the new version, it works fine by it self (and looks great, to boot).
Now, when I swap out the current swf (the one used in the link above) for this cleaner one it won’t work. With the new swf, I click on Botswana to generate the menu (and this is all XML driven), and I get this:
**TypeError: Error #1009: Cannot access a property or method of a null object reference.
at BlockAlphaMask/init()
at BlockAlphaMask()
**
BlockAlphaMask is the name of my custom class.
Again, the only difference is that I moved the graphical elements from the timeline into the cutom class. Why is this happening?
I’m also attaching the .fla and .as files for inspection. (Oops, barely over the (tiny) size limit for a zip file… they can be grabbed here instead: http://ninecommandments.com/MenuItem.zip])
Thanks in advance. I’m really trying hard not to throw my computer through a wall here. If only because it seems that every problem I solve with AS3 (yippee!) produces another problem that is totally unexpected and difficult for a noob to even isolate (boo).
Any help is appreciated.