2

I am getting Warning: 'flash' has no property 'prototype' every time I load a swf in my flashlog.txt.

Does anyone know how to disable that warning or all warnings in the mm.cfg file or maybe some other way? I use the flash tracing religiously for debugging and have not ever found a way to do this. Thanks in advance.

TrebledJ
  • 8,713
  • 7
  • 26
  • 48
thomallen
  • 1,926
  • 1
  • 18
  • 32
  • You could try using `try{ }catch(e){ }` around the object that's having the error. That's if you're using as3, I don't know if it's dealing with flex. – Shaz Feb 17 '11 at 01:23
  • @Shaz and how can you tell which object is causing it? Don't tell us to put in a trace in every other line. – cregox Jul 04 '11 at 21:06
  • Yeah sorry @shaz but like I said it is happening somewhere that I have no access to the object. I can't even find what "Prototype" is or where its being referenced. – thomallen Jul 07 '11 at 04:49

3 Answers3

1

This is a known problem. I can't remember if it started in 10 or 10.1 but it is happening to basically everyone.

The only work around I have seen out there is disabling the error reporting but then it won't log the actual errors.

Surfing around the web with the debug player is funny everyone's site is spitting out this warning.

Feltope
  • 1,098
  • 6
  • 9
1

Modifying mm.cfg is one way to deal with this.

just set/add the line...

MaxWarnings=1

This will allow FlashPlayer to log one warning only, (setting to zero will allow unlimited Warnings)

However, a better way to deal with this is to use something like...

tail -f flashlog.txt | grep -v "Warning: 'flash' has no property 'prototype'"

So that you filter out the dumb messages.

(if you're on a windows box, install cygwin so that you have *nix tools.)

ocodo
  • 29,401
  • 18
  • 105
  • 117
  • The grep solution works pretty nicely. I will mark that as the answer if someone doesn't come up with a better solution. Thanks! – thomallen Feb 17 '11 at 07:44
  • you could also do something like that with a script, (maybe add colorisation to the output too ;) ) - DEBUG/INFO/WARN/ERROR highlighting etc. – ocodo Feb 17 '11 at 09:23
  • Perhaps not completely suitable for this situation, but you might like to look at [MS's LogParser](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) - very useful for parsing large log files. (more suited when you need to do summaries/reports/charts based on Log input.) – ocodo Feb 17 '11 at 22:11
0

Are you using Flash or Flash Builder? Have you gone through the flex-config.xml file in your SDK/frameworks directory, one item in there seems like it might be what you're looking for. Try looking for the following

<!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
<!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
<!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
<!-- references to dynamic properties) -->

<es>false</es>

and changing it to true. You can also disable just about every type of warning in there as well as turn on some that normally aren't enabled but sometimes should be.

It should be noted however that none of these "settings" actually work or do anything, and neither does unchecking "Enable Warnings" in the Flash Builder/Flex Compiler settings, or changing your mm.cfg, or even holding an "Advanced Flex Builder Topics" book against the wall with your butt while you punch your nuts into the sheetrock and pray for inspiration.

I just thought I'd point out their existence in case some day Adobe decides to tighten things up a bit and actually implement some of the stuff that they have a zillion settings all over the place for.

Justin Buser
  • 2,813
  • 25
  • 32
  • I am familiar with the flex-config.xml file. It does have settings in it that make a very important difference when compiling. I am running Flash Builder 4 currently. I will look in the flex-config.xml though, and maybe look and see if "enable warnings" is checked in my project properties. – thomallen Jul 07 '11 at 04:46