The undertaking Neal and I hold been killing ourselves to finish demonstrated in its last few years one of those exciting small morsels of runtime-error rancor, a rather thumbed nose to we who holded desired to complete it with accurate planning before. Its declaration was n't one of those long forced out several-day situations, so we can at least return the thumbing, but like parents, we 're now kinda pleased the site and what we larned in the procedure. We encountered both the cause ( be it buggy ) and a solution dead one eventide.
The situation is that we 've maked a flash site that ladens swfs as pages and grabs bitmap versions of the content to invigorate them in and out alternatively of invigorating the comparatively big and complex DisplayObjects
as they are, which would greatly increase the processing needed. Essentially this system is easily automated by our Rasterizer
and IRasterizable
categories which care all the oink work, all that is necessitated on the forepart is naming public map rasterize ( )
method.
At some point in the task, long after the Rasterizer
was implemented, we commenced detecting security sandbox infraction run-time error when content was voyaged. This would destruct the animating content bitmap but the content would naturally reappear when unrasterize ( )
was named. Through procedures of riddance, we found that it was merely one laded contented swf making such jobs and only the swf was ladened on the other hand instantly voyaged forth from. The contented swf was the only swf on the site that applies our picture participant, a simple bundle that wraps upwardly a picture participant 's main functionality into a individual category. The mistake was easy to hunt down, its call stack growing from the BitmapData.draw()
method ( named from Rasterizer
) and the sandbox security fault message was mussitating something about not being able to pull from the orbit `` zero ''.
This mistake is documented
in the Adobe mention files, course, and throws if
The rootage object and ( in the instance of a Fay
or MovieClip
object ) all of its tyke objects make not come from the same field as the company, or are not in a content that is accessible to the company by holding named the Security.allowDomain ( )
method.
This is an perceivable security mistake throw but what was confounding was that the field it kvetched about was named `` nothing ''. Moreover, there were no petitions we Holded been cognizant of yet, no videos holded been bespoken to play.
To do a long tale short, we bumped the job to lie in the NetConnection
object, needed to laden an external picture into the picture participant. The
NetConnection.connect()
method 's first statement must be layed to null if the full apparatus is to be instantiated but not to get streaming a picture directly. A new connectedness is afterward done when the picture participant case is eventually stated to play something. So the dislocation in communicating is that the BitmapData.draw ( )
method demands all forced objects to incorporate pluses from letted fields, but the void arrow passed into NetConnection
tie ( )
is looking to the draw ( )
method like a Twine corresponding an existent way, thence throwing the mistake draw ( )
I 'm not sure whether the NetConnection
and NetStream
objects are smart plenty to recognise the void object when making their usual work, I ca n't retrieve any particular sandbox security situations like this apart from this one. I ca n't tell it certainly but I enquire if the BitmapData
draw ( )
method makes checking on NetConnection
uris and makes n't believe to deal the void object which could all told likelyhood, be returned thereto not as nil, but as `` void ''.
Our work-around was to but instantiate our picture participant not in the making sequence, but after, when the user snaps a picture to see. This left out the clip between instantiation and existent connexion, so if the page was sailed and draw ( )
n, it would n't be returning a connectedness to null. This looks to be farther encouragement in simply instantiating objects when they are eventually involved, especially when they are user-initiated. I 'm not cognizant of proper conducts decent to cognise whether `` zilch '' is something the NetConnection
and BitmapData
objects should cognise how to deal, but at least there are easy jams available.
Related posts:
Substantiation Therapy Proceeded
Why maked Europeans ballot against immigrants?
Cincinnati Supper Nine: The Twenty Tierce