Posts Tagged ‘problem’

Flash AS3 Bug of the Week

SecurityError: Error #2121:  Security sandbox violation: SoundMixer.computeSpectrum:  
cannot access
This may be worked  around by calling Security.allowDomain.
at  app::Spectrum/onLoop()

So. I was tinkering with a ComputeSpectrum function in, Flash for Marduq, which basically gives you a music equalizer display. Little bars going up and down with music.. Nifty. So I build it in and started to get really weird security bugs. First I thought it my allowDomain(*) then my crossDomain.xml policy files. Then I asked Urias. Then Daniel. Then I started to scream and bitch and moan. Then I started drinking beer. Then, finally, I found this bug report: [#FP-147] which basically told me to write the fucking spectrum analyzer myself.

It’s these kind of bugs that makes me want to switch platform.


Posted: April 13th, 2010
Categories: nerd, research, site, technology, work
Tags: , , , , , , , , , , , ,
Comments: No Comments.

I hate Flash (AS3 part 3)

We are the Borg. You will be assimilated. Resistance is futile. Your distinctiveness will be added to our own…

- Star Trek

We had a glitch in the CNR website; on a Macintosh (may God punish the users of Apple with lightning and fire) the small Flash application that scrolls the pictures was making errors. When loading the page and clicking outside the browser window would make the pictures go berserk. Now I blamed my intern for writing sloppy code and thought nothing of it. In the v2 of the side I rewrote the entire thing in AS3, thinking that would fix the problem. The original file had used a tween-animation and a masking movieclip to make the animation and the ‘reflection’, in the new AS3 application everything was done in code.

So imagine my surprise when I found out that the new version exhibit the exact same error as the original one. I searched the web for hours but couldn’t find this bug anywhere. I found that quite odd because it seemed so elementary to me. Until there where some vague references to it on Flashkit forums. Still I haven’t found any to fix it to my satisfaction; but it seems that on an Apple running OSX mouseclicks are still recorded, even when the browser window, let alone the Flash application, loses focus. So if I click left from the window flash will still receive a (negative) mouse coordinate. Sloppy work there at Apple. frustrating too. I am now making plans to get some niggers from the hood and get medieval on Steve Jobs ass. (apple bashing is now off)

update: Waxle and I have been tinkering with this last nigth, and it is as I expected, OSX gives back weird coordinates when clicking outside the browser window. But it doesn’t return a number relative to the 0, 0 coordinate in Flash, but a rather weird but static number. Consider the following script:

addEventListener(Event.ENTER_FRAME, update)
addEventListener(MouseEvent.CLICK, clickHandler)
var mX:Number
var mY:Number

function update(evtObj:Event) {
mX = mouseX
mY = mouseY
msg.text = mX + “, ” + mY

function clickHandler(evtObj:Event) {
msg2.text = “the mouse was clicked at: ” + mX +”, ” +mY

Paste it in frame one and create 2 textfields (msg and msg2). You will now trace the mouse coordinates on ENTER_FRAME and register clicks. This works fine within flash but on macintosh it returns the following when clicking outside the browser:


Click for larger image

107374143.5 -107374182.4 ?!! (which does google some results, but still). The workaround is of course to limit the mouseX input by something like if (mouseX > 0 and mouseX < stage.stageWidth) but still.

What can produce such an error? different assignment of the register in Moterola chips? The overlays with the ’sensitive corners’ in Mac OSX ? I really don’t know.

But still, here is the problem and a workaround, thanks to Waxle who tested this through on the mac. And with this file: mousetracer2.swf you can test it for yourself.

Posted: April 3rd, 2008
Categories: nerd, research, technology, work
Tags: , , , , ,
Comments: No Comments.