Actionscript Securityerror Error #2000
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more securityerror: error #2000: no active security context. about Stack Overflow the company Business Learn more about hiring developers or posting securityerror: error #2060: security sandbox violation: ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3. SecurityError: Error #2000 when simply load external jpg up vote 3 down vote favorite 3 When I try to load an external image in the same folder with a Loader object, I receive the error SecurityError: Error #2000: No active security context. My code is : var urlImg = String("img.jpg"); var imgLoader:Loader = new Loader(); var _lInfo:LoaderInfo = imgLoader.contentLoaderInfo; _lInfo.addEventListener(Event.COMPLETE, handleComplete); imgLoader.load(new URLRequest(urlImg)); function handleComplete(evt:Event):void{ trace("handleComplete"); } Why doesn't it work? flash actionscript-3 security share|improve this question edited Jul 8 '11 at 11:49 midhunhk 3,76453264 asked Jul 8 '11 at 10:02 arteVitale 1613 add a comment| 6 Answers 6 active oldest votes up vote 2 down vote Try changing your call to load: imgLoader.load(new URLRequest(urlImg)); To do this instead: var context:LoaderContext = new LoaderContext(); context.applicationDomain = ApplicationDomain.currentDomain; imgLoader.load(new URLRequest(urlImg), context); Otherwise you can try changing the use-network property when you compile with mxmlc. In Flash Pro, under publish settings, look for "Local playback security: " and toggle between 'Access local files only' or 'Access network only'. Also don't forget to verify that your image is actually in the correct folder and named exactly "img.jpg" and not "image.jpg" or "img.JPG" or something like that. share|improve this answer edited Jul 8 '11 at 11:34 answered Jul 8 '11 at 11:28 Bakapii 9941612 is it case sensitive? –midhunhk Jul 8 '11 at 11:36 Depends on the platform the swf is running on. Doesn't hurt to verify the potential problems that are easy to find and correct. –Bakapii Jul 8 '11 at 12:19 add a comment| up vote 1 down vote The SecurityError exception is thrown when some type of security violation takes place. Examples of security errors: An unauthorized property access or meth
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign http://stackoverflow.com/questions/6622886/as3-securityerror-error-2000-when-simply-load-external-jpg up Loader-Class - SecurityError: Error #2000: No active security context up vote 0 down vote favorite I try to "catch" this error when I'm loading some images. The following code is an test-case for my problem to secure that there are no errors in the surrounding code. import flash.events.SecurityErrorEvent; import flash.display.Loader; import flash.net.URLRequest; loadImage (); function loadImage (): void { var _imageLoader http://stackoverflow.com/questions/7405262/loader-class-securityerror-error-2000-no-active-security-context = new Loader(); _imageLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, imageSecurityErrorEventListener); var request:URLRequest = new URLRequest("this-image-not-exits.jpg"); _imageLoader.load(request); } function imageSecurityErrorEventListener (e:SecurityErrorEvent) { trace ("This is my own trace for the Security Error"); } I know that there are lot's of posts and questions in the www and here, but I couldn't find an answer to my problem. I'm working on an interactiv-movie with many images and movies which are loaded dynamically in the application. In this snipped I generated the worst case in my application (try to load an image that not exits). When I run this code I get the trace "SecurityError: Error #2000: No active security context" and not the trace of my the Listener. Do you have any idea whats going wrong? actionscript-3 security flash-cs5 loader share|improve this question edited Sep 13 '11 at 16:34 asked Sep 13 '11 at 16:28 crashbus 947831 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote That specific security error is thrown rather than dispatched as an ErrorEvent. It can be detected by using a try...catch block instead: function loadImage (): void { var _imageLoader = new Load
here for a quick overview of the site Help http://stackoverflow.com/questions/23754575/song-application-securityerror-error-2000-no-active-security-context Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges error #2000 Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Song Application - SecurityError: Error #2000: No active security context up vote 0 down actionscript securityerror error vote favorite When I click on the respective button for each song it comes up with the following error. SecurityError: Error #2000: No active security context. None of the songs play. I have checked the path to the MP3s folder but I cant find what I have done wrong. var songList:Array=new Array("Faster","Floofin","Healing Invitation","Leave The Light On","Lift Me Up","Looking Up","Shelter","Sparkles On Her Dress","Squirrel Map","TapTouch","Vancouver Transit","What_"); song1.addEventListener(MouseEvent.CLICK, chooseSong); song2.addEventListener(MouseEvent.CLICK, chooseSong); song3.addEventListener(MouseEvent.CLICK, chooseSong); song4.addEventListener(MouseEvent.CLICK, chooseSong); song5.addEventListener(MouseEvent.CLICK, chooseSong); song6.addEventListener(MouseEvent.CLICK, chooseSong); song7.addEventListener(MouseEvent.CLICK, chooseSong); song8.addEventListener(MouseEvent.CLICK, chooseSong); song9.addEventListener(MouseEvent.CLICK, chooseSong); song10.addEventListener(MouseEvent.CLICK, chooseSong); song11.addEventListener(MouseEvent.CLICK, chooseSong); song12.addEventListener(MouseEvent.CLICK, chooseSong); for (var i = 0; i < songList.length; i++){ var str:String = songList[i] as String; str = str.replace(".mp3",""); var clip = this["song"+(i+1)].title; clip.text = str; } function chooseSong(e:MouseEvent):void{ switch(e.currentTarget.name){ case "song1": currSong = "../MP3s/"+songList[0] as String; break; case "song2": currSong = "../MP3s/"+songList[1] as String; break; case "song3": currSong = "../MP3s/"+s