2

I encountered the following problem when working with the built-in sqlite database and using TLF TextFields in Flash CS5

When I tried to use TLF TextFields alone, I don't face any probelem, but when I start using a database connectivity code, the TLF TextFields placed on the stage are not shown, but instead, the SWF file is showing the built-in preloader with five dots looping.

I tried changing the default Linkage in ActionScript 3 Settings to Merge Mode, but in this case nothing is shown, not the textfields, neither the preloader.

I think the problem is related to loading the TLF Text Engine, but I couldn't figure out what to do.

The following is my code placed in first frame:

==========================================

import flash.data.SQLConnection;
import flash.events.SQLErrorEvent;
import flash.events.SQLEvent;
import flash.filesystem.File;

var conn:SQLConnection = new SQLConnection();

conn.addEventListener(SQLEvent.OPEN, openHandler);
conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);

// The database file is in the application directory
var folder:File = File.applicationDirectory;
var dbFile:File = folder.resolvePath("DBSample.db");

conn.openAsync(dbFile);

function openHandler(event:SQLEvent):void
{
    trace("the database was created successfully");
}

function errorHandler(event:SQLErrorEvent):void
{
    trace("Error message:", event.error.message);
    trace("Details:", event.error.details);
}

stop();

==========================================

and I am using one TLF TextField on the stage for later use.

Publish Settings>> Player: AIR 2.6

The file textLayout_2.0.0.232.swz exists in the same appication directory.

and not to forget, when I test the file using Contol Panel >> Test in Air Debug Launcher (Desktop) the file is working correctly.

but when I open the generated SWF file, the problem appears.

I already reviewed many articles but no one is closed to this problem.

I hope that I find some help Thanks.

Mofeed
  • 21
  • 2
  • You wrote, "when I open the generated SWF file, the problem appears." SQLite is only available in an AIR project – it's not available when embedding a SWF file in an HTML page. For anyone who is using TLF in an AIR project: you should open the "Advanced ActionScript 3.0 Settings" window, click on the "Library path" tab, click on textLayout.swc and change the "Default linkage" setting from "Runtime shared library" to "Merged into code". – T Graham Nov 18 '12 at 22:44

0 Answers0