Adobe Animate 2019 BUG? Air Mobile development layerDepthEnabled Error #1056: - actionscript-3

Anyone know why I am getting this strange error? Here is the code I used. I also make a little video for you to see what it's doing as well. Check out the link below.
https://youtu.be/xPx2A13lIJA
Here is the full error code:
[SWF] love.swf - 3194 bytes after decompression
ReferenceError: Error #1056: Cannot create property ___layerDepthEnabled___ on love.
at love/frame1()[love::frame1:10]
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at ADLAppEntry/run()
at global/runtime::ADLEntry()

For some reason, they have a setting called "Advanced Layers Mode" that's turned on by default that's triggering the error messages. You have to disable it.
Disable Advanced Layers Mode in Properties
In the Properties Window:
Properties Window > Advanced Settings > Mode > Uncheck Advanced Layers and click on Make Default

Related

DataVizExtention: issue with clearing viewables while a sprite is selected

In my code, I have this workflow:
When user wants to see some things, add Sprites using 'DataVizCore.addViewables()'
Use 'viewer.addEventListener(DataVizCore.MOUSE_CLICK, onDotClick)' to show info bubble
When user wants to show other things, call 'DataVizCore.removeAllViewables()' to clear Sprites
Repeat from step 1
This sequence works OK except in one situation.
If a sprite was selected (by clicking on it) before removeAllViewables() is called, I don't get MOUSE_CLICK event for newly added Sprites. In browser console, I see following error is thrown.
CustomViewables.js:318 Uncaught TypeError: Cannot read property 'style' of undefined at ViewableData.getViewableUV (developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/DataVisualization/DataVisualization.js:454)
As a workaround, I added 'event.hasStopped = true' to click event handler to prevent Sprite getting selected internally. That seems to work.
This seems like a bug in DataVizExtension to me. Or, my workflow is wrong?
Thanks
Bandu
Bandu. Thanks for the detailed steps to reproduce this issue. I tried with v7.46.0 version of the DataVisualization.js (latest as of my message) but was not seeing the same issue. I'd be curious if you are using this same version of the Forge Viewer (you can figure that out by looking at the viewer3D.js fetched under the Network tab of Chrome DevTools).
Setting event.hasStopped = true works because it internally avoided the code path calls into getViewableUV that threw the exception, but the flag is meant for other use cases (e.g. overriding default sprite selection behavior).
In any case, I've just tweaked our internal code to make use-cases like yours more robust. The changes will be released with the upcoming v7.47.0. Thank you for your feedback 🙂

How to get specific error message from SourceBuffer

I have an HTML5 video with a MediaSource for its source. When I call SourceBuffer.appendBuffer() the SourceBuffer throws an error.
I'm able to detect when this error is thrown like so:
sourceBuffer.addEventListener("error", function() {
console.log(arguments);
});
However the "arguments" in this case contain an ErrorEvent with no meaningful message or data. Just a reference to the SourceBuffer that failed.
I need to figure out why it failed, so I can fix it.
Yes, this is one of the most frustrating parts about MSE... it's really difficult to debug. I think the issue is that the errors have to be standardized from browser to browser. Since there's a lot of
If you're using Chrome, the best place to look is chrome://media-internals.
As of Chrome 91 the media-internals pane is removed. Instead. go to
DevTools / hamburger menu (=== Customize and Control DevTools) / More Tools â–¶ / Media
Then you'll have a Media tab on DevTools.

Security Sandbox Violation by a Bitmap in a Flex AIR desktop application?

*** Security Sandbox Violation ***
SecurityDomain 'file:///Users/Bluebird/Desktop/Demo/Project/Level_01
/Background.png' tried to access incompatible context 'app:/project.swf'
I understand that these "security" alerts are difficult to track down and even more difficult with scant information but I thought I would ask.
I have a large Flex/AIR desktop project where the user can select images off their local drive and collage them. There are also some swfs provided which they can use as "stamps". I am getting the error below when stamps are added to the app and clicked – the stamps have eventListeners attached – but the error does not reference the stamp (swf) but instead it references the background image.
The background image is a Spark Image defined in MXML:
<s:Image id="backgroundImage" x="{renderX}" y="{renderY}"
width="{renderWidth}" height="{renderHeight}"
smooth="true" smoothingQuality="high" scaleMode="stretch"
complete="backgroundImage_completeHandler(event)" />
The complete function does nothing important. The source property for the image is defined once the user has selected a local image:
backgroundImage.source = userFile.url
I don't see anywhere to provide a loaderContextfor the Image component (one solution usually suggested for "security" errors). Also, the backgroundImage component has no eventListeners – so I am completely baffled why it is throwing an error.
I've set the Flex compiler option to -use-network = false since this is just a desktop app and that is another commonly suggested "security" fix. I am also loading the "stamp" swfs through the trick of loading them as a byteArray first – another commonly suggested "security" fix.
Can someone help me hate Flash a little less?
For a quick check and probably fix, Instead the following line:-
backgroundImage.source = userFile.url
Trying giving it the relative path to the image file instead full absolute path.
like:
backgroundImage.source = "../images/bg.png";
Also, I assume you have already provided Security.allowDomain("*") in your stamp swfs.
First of all, per the Loader documentation, if you include the swf in the installed application content there won't be any security restrictions when loading it.
Otherwise, the Image component extends SWFLoader which does have a loaderContext property. Try passing in the current domain:
new LoaderContext(ApplicationDomain.currentDomain, SecurityDomain.currentDomain)

AS3 Trace an info message

I'm a AS3 developer but I'm not sure how can I trace this kind of messages in firebug as an info messsages.
I know that for an error I just need to inherit for an error but I'm not sure how can I trace this kind of messages.
This code:
trace("Hola")
will show "Hola" in Firebug, but I want the fancy Info icon at the beginning also the background of the line is blue.
Thanks for your help.
you can try https://addons.mozilla.org/en-US/firefox/addon/flashbug/
years ago I've used http://www.sephiroth.it/firefox/flashtracer/ not sure if anyone uses it still.
The trick is to use Debug version of flash player
In the case where you don't want to install the Flash Debug player (performance?), rather than using trace, route it to a Debug method that traces and logs to the console:
import flash.external.ExternalInterface;
var debug:Boolean = true;
function log(msg:String):void {
if ( debug ) {
trace(msg);
ExternalInterface.call('console.log',msg);
}
}
log('Hello World');
You should be able to throw that in a frame. If you're using class definitions, you'll have to interpret that code block as snippets.
Also note that in a browser that doesn't have console.log (like IE7) this will throw an error, so maybe you should test for console.log first and store the result in a global.
Notice the debug variable. When you want to turn debug logging off, just set debug to false. This is an overly simplified idea, but provides the basic concept.
Another way enhance this concept is to include a debug "window" if you will... really just a scrollable text box on top of everything else. This is helpful when dealing with devices that do not support logging, debug versions of flash or are just difficult to debug, e.g. mobile and AIR.

how do you find error in a SWF?

i feel stupid asking that question, but it seems like i'm unable to find out.
i have a SWF that works perfectly inside flash. once i export as SWF, it doesn't work anymore.
i can't use "trace"
i have tryed that function but it doesn't trigger it for some reason. :
function quikTrace(string:String){
//INIT VARIABLES
var tmpTxtField:TextField;
//TEXTFIELD PROPERTIES
tmpTxtField = new TextField();
tmpTxtField.text = string;
tmpTxtField.x = stage.width / 2;
tmpTxtField.textColor = 0xFFFFFF; //white (black background)
tmpTxtField.y = stage.height / 2;
addChild(tmpTxtField);
}
is there any "outside the box" way to find errors in a SWF?
You can view trace statements in the browser by doing a few quick steps:
Get a debug flash player for your browser. link
Set up mm.cfg to enable flash logging to a file. link
Get a text editor / "tail" viewer and read the flashlog.txt file that is generated. This is where FireBug & Flashbug come in handy, if you're in firefox. You can also try baretail for PC, or regular old "tail -f" on a mac/linux machine.
Good luck.
It's not a stupid question at all! You're just learning how to debug Flash for the first time. You can use "trace" with an exported SWF by doing a debug/test build from Flash IDE or Flash Develop. You can then read these traces with Firefox by using the extentions Firebug combined with the Flashbug extension. Now you're all set for getting feedback using traces.
For this particular problem, it's hard to say. Is this function inside of a class or timeline code? If it's a class, it probably because Stage is not ready yet. You can use the event Event.ADDED_TO_STAGE to know when the Stage reference is ready to be used.
Hope this helps!
Install a debug version of flash player for your browser. It will tell you exactly which line of code is throwing error.
http://www.adobe.com/support/flashplayer/downloads.html