03.05.13

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

Posted in Flash at 6:20 pm by Curtis J. Morley

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

Posted in Adobe, Embedding, Error, errors, Flash, Flash CS6, Flex, Mobile, quicktip, SmartPhones at 10:37 am by Curtis J. Morley

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

 

03.02.13

AS3 ArgumentError: Error #1508

Posted in Flash at 8:25 pm by Curtis J. Morley

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