david850067064 / asaplibrary

Automatically exported from code.google.com/p/asaplibrary
0 stars 0 forks source link

Error 1120 SoundManager and 1047 KeyMapper #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1120: Access of undefined property Debug.   
org/asaplibrary/util/sound/SoundManager.as as line 255  

<code>
catch (e:Error) {
      Debug.error("setPan error: " + e.message,toString());
}
</code>

Should be <code>Log</code> instead for <code>Debug</code> ?

1047: Parameter initializer unknown or is not a compile-time constant.
/org/asaplibrary/util/KeyMapper.as at line 44

<code>
public function setMapping (inKey:uint, inHandler:Function, inEventType :
String = KeyboardEvent.KEY_DOWN, inSendEvent : Boolean = false) : void {
            var map : Object = (inEventType == KeyboardEvent.KEY_UP) ? mKeyUpMap :
mKeyDownMap;

            map[inKey] = new KeyData(inHandler, inSendEvent);
        }
</code>

Weird one this, but I always changed then <code>inEventType</code> to
<code>inEventType : String = "keyDown"</code>

Issue described here;
http://curtismorley.com/2008/10/15/actionscript-error-1047-parameter-initializer
-unknown-or-is-not-a-compile-time-constant/

Original issue reported on code.google.com by hpe...@gmail.com on 11 Feb 2009 at 2:13

GoogleCodeExporter commented 9 years ago
Please submit separate bug reports for separate bugs.

The first issue has been fixed in the repository, indeed should be Log.

The second issue I haven't run into, and I've been using this class various 
times. Which compiler are you using, 
mxmlc, fcsh or the Flash IDE, and if so, which version? For which version of 
the Flash Player are you compiling?
The fix with a literal is unacceptable as the value of the constant may change 
in later versions, and then this code 
will break. If this can't be fixed otherwise, the default value for inEventType 
has to be left out.

Original comment by acidc...@gmail.com on 11 Feb 2009 at 2:53

GoogleCodeExporter commented 9 years ago
I use Flex builder (fp10) who automatically reports an error.

I'll always genereate a swc of the framework on startup of a new project, and 
Flex
Builder won't let me do so before I'll change the inEventType to a string
representation of the constant.

I agree in changing to literal is bad practise, do you have any 
advice/experience of
whice compiler i should use to compile?

Original comment by hpe...@gmail.com on 12 Feb 2009 at 11:00

GoogleCodeExporter commented 9 years ago
I'll change the code so the default value for inEventType is left out, I guess 
that's the best fix for now. This 
problem doesn't always occur (we're using fcsh to compile, which is what Flex 
Builder uses too), but at least it's 
been documented, so maybe Adobe fixes it. 

Original comment by acidc...@gmail.com on 12 Feb 2009 at 11:13