AS3 Error #3104: A SQLConnection must be open to perform this operation.

AS3 Error #3104: A SQLConnection must be open to perform this operation.

Description:
This AS3 error is really straight forward and easy to fix. It means that you have to open the Database before you can put anything in or take anything out. (or change anything). You cannot do any interaction with the DB without having it open. The solution is easy. Open the database before interacting with it.

Fix:
To fix AS3 Error 3104 make sure you have written this line of code dbConnection.open(dbfile); or dbConnection.openAsync(dbfile); If you have written this line of code then check where it sits in your ActionScript if it doesn’t sit above the first try-catch statement then you need to move it there. Placing the open(); call in the right place will resolve ActionScript Error 3104);

Bad Code:

try
{
statement.execute();
}
catch(error:Error)
{
trace(error.message);
}

dbConnection.open(dbfile);

 

Good Code:

dbConnection.open(dbfile);

try
{
statement.execute();
}
catch(error:Error)
{
trace(error.message);

AS3 Error 3104 is a straight forward AS3 error message, with a very easy fix.

As always Happy Flashing

Curtis J Morley

App used to work with AIR 3.2 or 3.4, doesn’t work with AIR 3.5 or 3.6

AIR 3.5 and 3.6 SDK for mobile require TLF Text to be merged into code.

Because I just spent the last full day dealing with this issue (without finding an answer on any forum) I thought I would share this so that you don’t have to bang your head against the wall. You probably found this page because your mobile project worked in AIR 3.2 or AIR 3.4 but when you try to publish your iPhone app or Android app using AIR 3.5 or AIR 3.6 SDK it  breaks.

This is the full error that I was getting when trying to publish from Flash CS6 using AIR 3.6:

Warning: Ignoring ‘secure’ attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml. The ‘secure’ attribute is only permitted in HTTPS and socket policy files. See http://www.adobe.com/go/strict_policy_files for details.

TypeError: Error #1009: Cannot access a property or method of a null object reference. at startMeUp/firstRunAnim()[/Users/speedclimb/Documents/cjm/Flash/Mobile/MobileDev/STARTME/startMeUp.as:229] at startMeUp()[/Users/speedclimb/Documents/cjm/Flash/Mobile/MobileDev/STARTME/startMeUp.as:210]

Neither of these AS3 Warnings/ Errors make sense nor have any info to point you to a resolution. Don’t try and troubleshoot AS3 Error 1009 The problem is that Apple now requires that all of this is embedded. Adobe complied with the changes from Apple and because of this when creating a mobile app using AIR 3.5 SDK or AIR 3.6 SDK with TLF Text you must have the .swc “Merged into code”.

Solution:

In order to compile with AIR 3.5 or 3.6 SDK you have to do one of two things. You can change all of your TLF Text into “Classic” text. This works but is not ideal because then you lose all of the great formatting features of TLF Text. The better solution is that you change the “Default Linkage” in your ActionScript settings to “Merged into code”. Sounds complicated but it’s not. Go to File >> ActionScript Settings, when the dialog window pops up make sure you are on the “Library Path” tab and then change the drop down from “Runtime Shared Library” to “Merged into code”. Below is a screenshot showing how to solve this AIR 3.5+ SDK compiler issue. The important areas are highlighted in red.

Change the Default linkage from "Runtime shared library" to "Merged into code"

Change the Default linkage from “Runtime shared library (RSL)” to “Merged into code”

I hope this saves you 16 hours of brain damage trying to compile your code using AIR 3.5 or AIR 3.6 SDK.

As always Happy Flashing (for mobile)

Curtis J. Morley

 

AS3 ArgumentError: Error #1508

ActionScript3 Error 1508: The value specified for argument font is invalid

Description:
This ActionScript 3 error is caused by several different things. It can be a font embedding issue. It can be an issue with loading a font swf to the same location on a server. It can be several things. One of those reasons is easy to solve. This ActionScript error will show up when you have an incompatible font in  Flash or Flex. TLF text is great and most of the time you won’t run into error 1508. I have only ranAS3 Error 1508 once, thus this post.

Fix:
One simple fix is to specify a font that is compatible with TLF Text. In my case I was using TradeGothic LH Extended and BoldExtended. Flash didn’t like these fonts and threw out ActionScript Error 1508. If I scrolled up I also noticed that it gave me a very nice description of the error. It said, “The font named TradeGothic LH Extended is not compatible with TLF text. TLF text using this font will not display properly. Fonts should be embedded for any text that may be edited at runtime, other than text with the “Use Device Fonts” setting. Use the Text > Font Embedding command to embed fonts.” So as you can see I just needed to change the font to a compatible font and everything worked out fine.

AS3 Error 1508 is a complex AS3 error message, but in this case a very easy fix.

As always Happy Flashing

Curtis J Morley

Flash AS3 Error 1152: a conflict exists with inherited definition in namespace public

ActionScript3 Error 1152: a conflict exists with inherited definition in namespace public

Description:
This ActionScript 3 error is confusing by description but easy to solve. This error will show up when you have one or more names that are duplicated from a  Flash/Flex object to a variable within a class. The conflict error 1152 is referencing is between a variable in your class and an instance on the stage.

Fix:
To fix AS3 Error 1152 just change the name of a variable to something other than the name of a button or movieClip on the stage. (You can also change the name of the button to resolve ActionScript Error 1152) Basically make sure the names don’t match or you will keep getting AS3 Error 1152.

Bad Code:

Button on Flash stage named “isPlaying”

//ActionScript3 code that uses the same name as a variable
private var isPlaying:Boolean = false;

Good Code:

Button on Flash stage named “isPlaying”

//ActionScript3 code that uses the same name as a variable
private var isPlayingNow:Boolean = false;

AS3 Error 1152 is a confusing AS3 error message, but a very easy fix.

As always Happy Flashing

Curtis J Morley

Flash Error #1006: addEventlistener is not a function.

ActionScript TypeError: Error #1006: addEventlistener is not a function.

Description:
This ActionScript error is wonderfully simple. It comes from calling something that you think is a function but Flash doesn’t recognize as such. Error #1006 can pop up for a different reason too. Make sure to see my first post on AS3 Error 1006 if the answer below doesn’t solve it for you.

Fix:
Look closely at the code above. In my case I just misspelled the native call to add an event listener. I typed addEventlistener with a lower case “l” instead of “addEventListener” with “L” capitalized. The fix is just to spell it correctly.

Bad Code:

blackBarFull_mc.addEventlistener(TouchEvent.TOUCH_TAP, navBack);

Good Code:

blackBarFull_mc.addEventListener(TouchEvent.TOUCH_TAP, navBack);

Easy Error, Easy Fix.

Related AS3 Error:
Flex / Flash Error #1006 value is not a function

As always Happy Flashing

Curtis J Morley

Flex / Flash TypeError: Error #1006: value is not a function.

ActionScript Error #1006: A user-defined namespace attribute can only be used at the top level of a class definition.

Description:
This ActionScript error will pop-up when a namespace is declared anywhere besides the class definition. What is a class definition you ask? It is simply the code that names the class – something like ‘public class MyClass’

After the class is defined you are allowed to create custom(or ‘user-defined’) namespace on that level. Anywhere else in the code is not legal. This ActionScript Error is closely related to the Flash/Flex error #1114.
This AS3 error may also just be a typo. you may have typed something like ‘publi class’ rather than ‘public class’ or ‘prvate function’ rather than ‘private function’

Fix:
Either fix the misspelling in your code or place the ‘user-defined namespace’ inside the class definition. The second code example shows a namespace to separate cars and animals. Notice how the bad example nested the ‘user-defined namespace’ inside the constructor function.

Bad Code 1:

package com.cjm.somepackage
{
publi
class MyClass {
publi
function MyClass() {}
}
}

Good Code 1:

package com.cjm.somepackage
{
public
class MyClass {
public
function MyClass() {}
}
}

Bad Code 2:

package
{
public class MyClass
{
public namespace Cars;
public namespace Animals;

public function MyClass()
{
Animals var Jaguar:String = “A large cat chiefly of South America”;
Cars var jaguar:String = “A large car chiefly driven in North America”;
}

Cars function run():void {
trace(“At $30/mile”);
}

Animals function run():void {
trace(“On four legs”);
}
}
}

Good Code 2:

package
{
public class MyClass
{
public namespace Cars;
public namespace Animals;

Animals var Jaguar:String = “A large cat chiefly of South America”;
Cars var jaguar:String = “A large car chiefly driven in North America”;

public function MyClass()
{

}

Cars function run():void {
trace(“For 100,00 miles”);
}

Animals function run():void {
trace(“On four legs”);
}
}
}

Adobe has a great explanation of how to use namespaces as well as Collin Moock in Essential ActionScript 3 in Chapter 17

Related AS3 Error:
Flex / Flash Error #1006 addEventlistener is not a function

As always Happy Flashing

Don’t need to Get Tickets for the Late Show and Newsies because Letterman is IN Newsies.


At first we felt really lucky that we got tickets to the Late Show, Statue of Liberty night cruise, and Newsies while we are in NYC. But then we found out that we could have seen Dave in his new leading role in Newsies and saved the money for the Late Show. (Late Show has free admission btw)

Most Used Android Apps

Home Screen – Clock /Weather Widget(1/2), Gospel Library, LDS Tools,  Ward Tools,  Indexing, Messages,  Mail,  Play Store,  Camera
Screen 2 – Dictionary. com widget, The HTC EVO 4G LTE made it through customers and is available this morning at 10 a.m. #HTC Facebook,  WordPress, Traffic Widget to work and home,  Sleep bot tracker,  Internet,  Calculator,  Sprint  TV, Fly Delta, Citation Index, Evernote, Telenav GPS,
Screen 3 – Stocks  Widget (FC, ADBE, AAPL, IAUS.PK,etc )
Screen 4 – friend stream widget
Screen 5 – Audio widget(1/2), Audible, Amazon Kindle,  Reader, Linked In, WordPress,  People, Voicemail,
Screen 6 – Agenda Widget
Screen 7 – 4G, Hotspot, Bluetooth, GPS, People Widget(1/2)

Continue reading