How to turn off verbose stacktraces in Flash Builder? - actionscript-3

I have been trying to create a debug version of an AIR desktop runtime and seem to have somehow permanently turned on verbose-stacktraces. I am using Flash Builder and was playing with adl through the Terminal (OSX).
In Flash Builder for a test project I had the compiler option set to:
-locale en_US -swf-version=21 -debug=true -verbose-stacktraces=true
And was getting continuous console output like this:
2301 AVMINF: MTHD spark.primitives.supportClasses::GraphicElement/get drawY ()
2301 AVMINF: MTHD spark.primitives.supportClasses::GraphicElement/get displayObjectSharingMode ()
2301 AVMINF: MTHD spark.primitives.supportClasses::GraphicElement/get y ()
2301 AVMINF: MTHD flash.geom::Point ()
2301 AVMINF: MTHD spark.primitives.supportClasses::StrokedElement/get stroke ()
I set -verbose-stacktraces=false, tried it, and then removed that directive completely, but I still get the console dump. Worse, I created a new test project and am getting the verbose console dump for that.
What did I do and how do I undo it?
I'm supporting a legacy Flex project and use Flex and Flash Builder rarely now so my knowledge has rusted and blown away.

You'll always see console output and verbose stacktraces for swfs compiled with -debug=true.
If you set this option to true, Flex also sets the verbose-stacktraces
option to true
Here's the docs.
If you want to avoid console output. Just "Run" the app instead of launching it in debug mode.
Run vs Debug Docs
Edit: I think I figured out what you did.
Try going into your mm.cfg and changing (or removing) this setting:
AS3Trace = 1 // should be AS3Trace = 0
Reference: https://jpauclair.net/2010/02/10/mmcfg-treasure/

Related

i want to use job command in v8.release, so how can i do it ? or just by pass the dcheck within v8.debug

I am working with a pwn question, and I want to debug v8 using gdb.
But in release version, I can not use job command.
And in a debug version, I will got abort when I called the function which is the main function in this pwn question.
And I have tried to change some #define code, but I failed.
And I tried to pass some compile args, I failed too.
So, how can I solve it?
For Release mode:
The job GDB macro should be functional if you add v8_enable_object_print = true to your args.gn (using gn args out/x64.release). Obviously, debugging a Release-mode binary will be a somewhat "interesting" experience.
For Debug mode:
Bypassing a DCHECK is easy: just comment it out and recompile.
And of course, if you find any bugs, please report them at crbug.com/v8/new :-)

Error 1046: Type was not found or was not a compile-time constant: EncryptedLocalStore

I'm getting the error even though the import is not throwing errors:
1046: Type was not found or was not a compile-time constant: EncryptedLocalStore.
Here is my code:
import flash.data.EncryptedLocalStore;
var str:String = "Bob";
var bytes:ByteArray = new ByteArray();
bytes.writeUTFBytes(str);
EncryptedLocalStore.setItem("firstName", bytes);
var storedValue:ByteArray = EncryptedLocalStore.getItem("firstName");
trace(storedValue.readUTFBytes(storedValue.length)); // "Bob"
EncryptedLocalStore.removeItem("firstName");
I've checked and EncryptedLocalStore was introduced in AIR 1.0 (or 3.0). I'm using AIR 3.6. I'm also using this in a library project.
It's strange. I was somehow able to get rid of the errors by doing the following:
Clean
Restart
Select Include Adobe AIR libraries in the Project Properties > Compiler settings
Add -swf-version=19 to compiler arguments
Clean
Choose Use minimum Flash Player version
Clean
Change to different SDK
Clean project.
NOTE: It's working at this point. I then reversed back through those changes and after doing the following it still works.
Change back to original SDK
Clean
Uncheck Include Adobe AIR libraries in the Project Properties > Compiler settings
Clean
Remove -swf-version=19 from compiler arguments
Clean
Remove Use minimum Flash Player version and enter Flash Player 15.0.0
I'm back to where I started but now it's working?
UPDATE:
OK I figured it out:
Select "Include Adobe AIR libraries"
Switch SDK (Clicking apply doesn't work)
Errors should go away
Switch back to previous SDK

(cocos2d-x 3.1 + VS2012) TextureCache::addImageAsync causes a crash occasionally

I load some textures in asynchronously at the beginning of my game, about 40-50 of them.
vector<string> textureFileNames;
textureFileNames.push_back("textures/particle.png");
textureFileNames.push_back("textures/menu_title.png");
...
textureFileNames.push_back("textures/timer_bar.png");
for (auto fileName: textureFileNames)
{
Director::getInstance()->getTextureCache()
->addImageAsync(fileName, CC_CALLBACK_1(LoadingLayer::textureLoadedCallback, this));
}
My textureLoadedCallback method does nothing funky; at this stage it simply increments a value and updates a progress timer. The callback is called from the main thread by cocos2d-x design, so I don't suspect any problems arise from there.
90% of the time this works fine. But sometimes it crashes in VS2012 midway through loading the textures:
Debug Assertion Failed!
Program: C:\Windows\system32\MSVCP110D.dll
File: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector
Line: 1140
Expression: vector subscript out of range
Breaking at this point, I can see that it dies in the internals of vector, specifically the [] operator, and traces back through _Hash to the TextureCache::loadImage() method: auto it = _textures.find(asyncStruct->filename) on line 174 of CCTextureCache.cpp. _textures is defined as std::unordered_map<std::string, Texture2D*> _textures, a standard library unordered map. asyncStruct->filename resolves to the full path and filename of a texture to load.
Using the debugger, I can see that the filename is fine. I can see that _textures already contains the 19 textures before this one that it has processed just fine.
The fact that it seems to just be dying in the midst of the standard library doesn't strike me as right... but I'm unable to determine where CCTextureCache goes wrong. Only that it doesn't always fail, and that it's failing in an asynchronous thread. There's no concurrency bollocks going on with my code (as far as I know).
Is this a cocos2d-x bug, a VS2012 bug or a bug with my code I pasted above?
I think a potential cause could be that the for loop issues like 19 async image loads all at once, which may or may not be supported by that method. Try issuing the next async load only after your texture callback is called. That way no two async loads are performed simultaneously.

starling atf textures not displaying

So i'm running air 3.7, the latest starling frameworks, added -swf-version=20 -target-player=11.7 in compiler arguments and running the code
[Embed(source="/assets/wtf4.atf", mimeType="application/octet-stream")]
private static const why:Class;
var data:ByteArray = new why();
var texture:starling.textures.Texture = starling.textures.Texture.fromAtfData(data);
var image:Image = new Image(texture);
addChild(image);
if I'm using the starling atf that came with the framework demo it works fine, but whenever i try to display my own png that I create in photoshop converted into atf it gives me a error saying
ArgumentError: Error #3677: Texture decoding failed. Internal error.
The image I'm trying to convert into atf is just a red square png with 512x512 sizes with the compiler arguments: png2atf -c -i example.png -o example.atf. I'm not sure whether my flash builder isn't setup to decode atfs or if i'm creating the atfs wrong for some reason, if someone could shed some light on this it would be awesome!
When creating the .atf, did you created mipmaps also? If not, you need to set the second argument of the Texture.fromAtfData() function to false - don't use Mipmaps.
From Starlign wiki:
"If you omit mipmaps, you must set the parameter “useMipMaps” of the “Texture.fromAtfData()” method to “false”! Otherwise, you'll get a run-time error."
http://wiki.starling-framework.org/manual/atf_textures
The latest version of ATF requires AIR 3.8 (which is currently in beta). You need to download the AIR installer, and the latest AIR SDK. More details here: http://forum.starling-framework.org/topic/error-3677-texture-decoding-failed-internal-error

TypeScript 'var' is undefined error

I built a console app to find all the *.ts files in my project and then compile them using tsc.exe.
Everything was working fine, but as I converted my JavaScript files to TypeScript, I eventually ran into the following error:
ytsc.js(21053, 17) Microsoft JScipt runtime error: 'window' is undefined
Each time this happened when I was trying to extend window:
window['prop'] = "something";
I tested the code until I found the answer, which had little to do with my code...
The fault was my build tool.
I had declared the -e (execute) command line option when calling tsc.exe:
I did this because I thought I might add some automated testing code in the modules.
The cause for the error:
Most of my code is in functions.
However, there were a few places that I wanted to extend 'window' (for example if a built in function is missing from an old browser, I was shimming those calls). The code to shim the window object was running as the file loaded:
if (window.fun == null) {
window.fun = function(){...};
}
Anyway, because of the -e option, the tsc.exe was attempting to run the code (outside of a browser environment). This caused the above error.