Friday, May 25, 2012

[Action Script] Security Sandbox Violation? May,2012

I'm trying to draw a section of my app's screen, but because sections of it use Netstream I'm getting this error:

Code: SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:////GRAYLE/Nexstar/No%20Background/final.swf cannot access null. No policy files granted access.
        at flash.display::BitmapData/draw()
        at final_fla::MainTimeline/captureFrame()
        at final_fla::MainTimeline/startRecording()
        at final_fla::MainTimeline/setState()
        at final_fla::MainTimeline/rec_btn_click()Ive done a bit of research and found a few snippets of code that mention this error coming out when the movie being netstreamed hasn't finished loading yet. So I modified my code to this:

ActionScript Code: var fgvid:Video = new Video(320, 240);            fgvid.x = 14;            fgvid.y = 45;            captureScreen.addChild(fgvid);            var fgnc:NetConnection = new NetConnection();            fgnc.connect(null);            var fgns:NetStream = new NetStream(fgnc);            fgvid.attachNetStream(fgns);            var fglistener:Object = new Object();            fglistener.onCuePoint = function(e:Object):void {};            fglistener.onMetaData = function(e:Object):void {};            fgns.client = fglistener;            switch(event.currentTarget.video_label_txt.text){            case "Fire Wedge":            fgns.play("foreground/fire_wedges.flv");            break;                        case "Blue Spiral":            fgns.play("foreground/blue_spiral.flv");            break;            }                        fgns.addEventListener(NetStatusEvent.NET_STATUS, fgNetStatusHandler);            fgns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);            function fgNetStatusHandler( event:NetStatusEvent ) :void            {                if(event.info.code == "NetStream.Play.Stop")                fgns.seek(0);            }            function asyncErrorHandler(e:AsyncErrorEvent):void {}        };
So far, still no joy. I have the bitmapdraw code attached to a button inside the stage. Could any of you experts help a clueless guy like me? :confused:
Security Sandbox Violation?

Related Post



0 comments: