ActionScript Error 1138: Required parameters are not permitted after optional parameters.
ActionScript Error 1138 Description:
AS3 Error 1138 is a great Flash error. It is descriptive and tells you exactly what it means. This means that when setting up a AS3 function you must declare the required parameters before the optional or not have any optional. Both scenarios for error 1138 are shown below. Take a look at the code and it will all make sense.
Flex / Flash Error #1138 Fix:
Put your required parameters first and then your optional ones or else make them all required.
function someFunc(someNum:Number = 0, someOtherNum:Number):void
Good Code 1:
function someFunc(someNum:Number, someOtherNum:Number = 0):void
Good Code 2:
function someFunc(someNum:Number, someOtherNum:Number):void
This should help you resolve Flex / Flash Error #1138
Thanks and as always Happy Flashing
Curtis J. Morley
Just uploaded new photo of the topiary gardens in the heart of Lisbon Portugal. These beautifully crafted gardens look over the amazing ocean in Portugal. This photo is now available to purchase and download from iStockphoto.
Get the Full Size Photo Now!
AS3 Error 1195: Attempted access of inaccessible method cacheAsBitmap through a reference with static type flash.display:DisplayObject.
Error 1195 can have any number of methods listed in this AS3 Error so I probably should have listed it as Attempted access of inaccessible method someMethod through a reference with static type variableType. This is caused because you are either calling a private method from another class, or calling a method defined in a namespace that is not in use.
If you are calling a method defined in an unused namespace, add a use statement for the required namespace. Otherwise, check that the method is within scope and accessible.
Thanks and Happy Flashing
Curtis J. Morley