Security Sandbox Violation
Had a bizarre and irritating problem yesterday, Elevens decided to develop a bug while at auction. I would not mind but I always play test my games numerous times before commencing an auction to ensure no issues arise during the migration from desktop testing to web testing.
I became aware of the error when I uploaded a modified version to MindJolt. On rare occasions the game would not show the congratulations screen after clearing the pack ad on the menu screen MouseClick events would not register (though MouseOver would?). After a little investigation I realised it was happening after interaction with Mochi, i.e. displaying leaderboard or achievements, submitting highscores, or awarding an achievement. All the Mochi interactions worked as required but afterwards the game was broken. Annoyingly I could not recreate the problem on the desktop so had to keep uploading the game in order to test any fixes.
I decided to test if the problem happened in a different browser, and thankfully I tried Safari. This wonderful browser gave me the priceless gift of an error dialogue. Finally I had a culprit…
“SecurityError: Error #2121: Security sandbox violation: BitmapData.draw:http://games.mochiads.com/c/g/elevens/Elevens.swf/[[DYNAMIC]]/1cannot accesshttp://www.mochiads.com/static/lib/services/services.swf?mochiad%5Foptions=undefined&api%5Fversion=3%2E9%2E4%20as3&listenLC=%5F%5Fms%5F1329352736739%5F79046.This may be worked around by calling Security.allowDomain”
It was occurring while attempting to draw the contents of a MovieClip to a BitmapDataobject.
So I started googling Security Sandbox Violation, the first batch of websites I visited were full of people saying they were not a problem??? Clearly it is!!! The second batch concerned accessing remote assets, as far as I was concerned I was only drawing the contents of a MovieClip already presentin the display tree! Anyway I tried following their suggestions calling allowDomain() adding policy files with no success. To be honest it all seemed a little excessive for the sake of copying a MovieClip.
A cup of tea later I had my eureka moment. Clearly Mochi’s service.swf was impacting the display tree even though I had set Mochi up on a different branch to the main game. Therefore, I decided to remove the DisplayObject containing the Mochi API before performing the draw operation, and add the DisplayObject back after it had completed. Voila! Worked a treat, Mochi interactions executed without causing the game to hang. I don’t particularly like the solution, it doesn’t feel elegant, but it has the desire effect and I’ll accept that… for now.
Welcome!
Welcome to the Team Atomic Games website, “TAG” for short!
TAG is a small indie team borne out of our love of games and the desire to create our own. It has taken a few years for momentum to build, due to external commitments, but now with the right tools, practises, and process in place we can now begin to realise the flood of ideas spilling from our heads.
We have created this website to keep our fans (hi mom & dad) up to date with the latest developments and advertise our services to those who need help bringing their ideas to life. We’ll also be updating the blog with regular posts covering news and information about games development. Hopefully sharing our experiences may help you in yours and feel free to leave comments that we all can benefit from.
We’ll leave it there for now, this website isn’t going to build itself. We look forward to hearing from you in the future and promise to always try to deliver awesome new content and ever improving games. If you would like to get involved and help shape our future games get over to the Beta Test section and signup to be informed next time we are trialling our latest titles.
Jim
Recent Comments