If a tree falls in the woods…
If a tree falls in the woods and nothing is there to hear it, does it make a sound?
I'd have to say yes and no. No to the fact that sound is based solely on perception, and if nothing is there to perceive a sound, then it can't be a sound. Yes to the fact that sound is made up of tiny fluctuations in atmospheric pressure. Just because someone isn't there to perceive a sound, doesn't mean there aren't variations in pressure. This became clearer to me when I came across a Flash conundrum when creating a pulse Sprite using the ENTER_FRAME event…
If a DisplayObject isn't attached to a display list, does it have a framerate?
Of course this is true, otherwise how would the event fire. However, how do we access the framerate of the Sprite if it isn't attached to a display list or has any references to the stage? Using sprite.stage won't work, so of course we can't use sprite.stage.framerate. If the Sprite is instantiated, and an ENTER_FRAME is attached to the DisplayObject, then how does it know how fast to run?
I've created a Bitmap transition class/framework that uses a Sprite to generate a pulse for transitioning from one visual state to another using two sources. I don't want to create any references to the stage or the display list associated with the source and target Bitmaps. Some might say, well why not? I considered doing this, but my answer was A: I want to make it cleaner, encapsulated, and self contained (Hence my reason for not using HydroTween). B: Garbage Collection. The less references to anything else, the less chance of a memory leak.
It's possible the answer to this question is simple and I'm being deep, philosophical, and difficult for no reason. If you know the answer, then send it on over!
Until then, I've decided to file a bug/feature request with Adobe.
Given the current architecture of Flash, you can only have one Stage per compiled clip. So wouldn't it make sense to me to have static access to the Stage properties? I'm assuming that the Sprite in the forest (pardon the pun) is finding some way to know how fast it needs to cycle from frame to frame. If it can, then I want to be able to as well:)
So if you agree with me, click on the above link and vote for this issue to be addressed. Otherwise it's safe to say the only sound you'll hear is the chipmunk the tree is falling on.
Monday, August 25th, 2008