Preventing error from being thrown in child swf - actionscript-3

I want to load user submitted swf files into a parent Flex application. I'll be loading the swf from a different sandbox and i will deliberately not be granting security access.
Often flash applications will have functions that try to access the stage, and in this case the child swf would throw an error because it would not have access.
I want to prevent such errors in the child swfs from causing actionscript debug error windows to pop up. Does anyone know if this is possible, with code in my parent app?

Flash Player 10.1 can do this!
http://blogs.adobe.com/cantrell/archives/2009/10/global_error_handling_in_air_20.html

Related

swf file terminates automatically after publishing

I create app using flash cs 5.5. It works fine. Then I started using flash cs6. The app was running fine until today. It runs fine but the problem is when i tried to publish it, it start playing but after some time(about 30 secs), swf file terminates itself. There is no problem in using cs5.5. It's just when i tried to publish it, it runs and swf file is close itself. Do any one have any idea what might be the problem ?
When you say "the swf file terminates itself", are you talking about the standalone flash player? Normally if this happens, it's because an error was thrown, but if you're not using the debug player, you won't see it, it'll just close.
Download the debugger player here: http://www.adobe.com/support/flashplayer/downloads.html and run your swf in debug mode (so all the debug symbols are present and you get the most complete error message). This should give you an idea of what the error is, and where to go to fix it.
NOTE: to know if you're running in the debug player or not, right-click on the swf in the player, and if you see an option for "Show redraw regions", then it's the debug player

Database content not retrieved in the exported SWF and published HTML

I have this problem that when i am running my project in Flash cs6 using ctrl+enter, the project is ok, the flash player is retrieving the files from mysql database. but when i run the independent swf file outside, there is no retrieval happening. the text box that suppose to be showing the retrieved data is empty. how can i fix this?
Make sure you are running the published html from an actual page in the browser and not from the local file system.
Just make sure that the URL doesn't start with file:///
You must be having a security sandbox error, but you probably don't have the Debugger version of the Flash Player, so it's not telling you anything.
Just go to http://www.adobe.com/support/flashplayer/downloads.html and choose the proper one for your operating system and browser.
If you STILL want to run the files from your local file system, you can have a look at Flash Player's Global Configuration, to give access to the files/directories you want. Just right click on your swf file in the browser, and when the Menu opens, select Global Configuration.
The reason it is working when running inside Flash CS6 is that the player has less security restrictions in there.
Let me know if you were able to solve your problem.

Why does my second loaded subapp stop after FlexEvent.INITIALIZE

I have a Flex 4 application that loads Flex 4 applications into it by using the mx.controls.SWFLoader component. I load the same swf-subapp several times as each subapp also runs standalone, and the content of the subapp is determined by a XML that I pass into it via the loader context.
This has worked until recently, but now, the second time I load the same swf (with a different xml) the loaded swf stops executing anything after the FlexEvent.INITIALIZE is triggered (I'm not doing anything in my initialized event handler). In other words, I don't get a CreationComplete event, which is where I start my code (and worse, no errors either).
As I've been working on a different part of my main application, I can't quite remember which change crashed my project, but what I do remember is that I updated my Flex SDK and I've hade similar silent errors in relation to a SDK upgrade earlier.
In my main application I do cleanup after myself before loading a new swf, so it shouldn't be garbage laying around.
Please help!
Solved it.
There was an enterframe handler that kept the first instance of the swf in memory, that in some way blocked the next one from loading (eventhough I used the removeAllElements on the parent container and hoped that would do the trick).
Now I use a NativeSignal and remove all listeners from that on onRemove handler (RobotLegs). Works like a charm.

VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds. - Flash CS5

I tested this flash application in Flash IDE, it never through this error. But When I uploaded in server, got this error. Why we getting this VerifyError? It is a flash application loads all the library assets through bulk loader, later it will get assets from bulkloader to display in the main page. Assets includes swf,xml etc.
Usually this happens when loading external SWF files, which are using a different version of classes that are in the main application.
This could be because you compiled some RSL's, modules or other external SWF against a different version of the Flex SDK. It could also be that you changed a class and didn't recompile all of the SWF's again.
Sometimes you can do everything right, but an old SWF is cached by your browser, and so is incompatible with your main application. You can get around this by adding the version number to file names, so that an old cached version is never used.

Disable the error message box while loading an external movie with actionscript 3

I have a compiled swf file and a I can't edit it, but the movie is working fine (but gives an error message with a message box).
I am using it from an other movie (load with as3 code).
When the loader movie loads it the error message box appears.
I wonder is it possible to disable the errors while loading a movie with as3.
Here is the error in the message box:
"TypeError: Error #1009: Cannot access a property or method of a null object reference.
at motionsound11_fla::_all_29/motionsound11_fla::frame249()"
Yes. Here is the error message (editted my first post):
"TypeError: Error #1009: Cannot access a property or method of a null object reference.
at motionsound11_fla::_all_29/motionsound11_fla::frame249()"
And I don't want to decompile my movie. It becomes more complex when decompiled. Yes, for understanding the problem I did. But my first problem is disable the error message box.
Thanks so much.
Yes, You are right.
There is no error in a browser (with flash player plugin).
My project wont be in a browser. It will be an executable file (.exe) or .swf . So people who have "Adobe Flash CS3" on their computers will see the error in swf format file.
(i will add this information to my question : " The loader wont be on a web page. It will be used as .swf file or executable file" )
And your answer is acceptable. I will publish as html page not .exe or .swf. This will be more secure,dynamic and has no platform dependence.
Thanks.
I might be wrong here, but I'm not sure the release version of Flash player plugin would produce an error like that - are you running this in the debug plugin? What you could do is test on a box you know has never been used for development - it's possible the error simply won't appear when you deploy your application.
That said, any Flash developers who use your app might still see it!