Go Back   Northcode Support > Third Party Developers > André Goliath Software & Solutions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 2006-02-01, 04:02 AM   #1
AGo
Plugin Developer
 
Join Date: Jun 2002
Location: Germany
Posts: 2,327
Lightbulb Problems publishing with SQLite

If you try to publish a SWF that uses the SQLite AS Class, you may recieve errors similar to these

Code:
*****
**Error** C:\ProjectPath\SQLite.as: Line 41: There is no method with
the name 'ssCore'.
     		var findexe_obj = ssCore.FileSys.fileExists({path:"internal://sqlhelper.exe"},
{sync:true});


**Error** C:\ProjectPath\SQLite.as:: Line 50: There is no method with
the name 'ssCore'.
     		var sqlite_answer = ssCore.Shell.execute({path:pathToExe, arguments:"-version",
saveStdOut:"true", winState:"hidden", topmost:"false"}, {sync:true});
These errors are due to the nature of AS2 Classes, and will affect all other Classes in which you use SWF Studio Commands, too.

The Problem is as follows:

The SQLite.as class gets compiled 'on it´s own' and does not have any connections to your Main fla file at compile-time.
That means however that Flash can not resolve any function or parameter names that are not defined within the AS Class, and therefore will abort the compile process with an Error similar to the one above.
(In fact, with maaaany errors )

So the point here is that Flash simply does not know what 'ssCore' or 'ssDebug' means, and aborts the publish.
To fix that we need to tell Flash what these Objects are and where they point to.

To get rid of these errors, you need to do one of these steps


case 1 - You are not a programer, and/or won´t work with other AS2 Classes

In this case, the easiest solution would be to alter the first lines of the AS Class a bit, like this


Code:
 
class SQLite {
	//Reference to the ssCore Object
	private static var ssCore:Object = _global.ssCore;
	//
by adding this Line right after the opening "class SQLite (" statement you are creating a reference to the ssCore Object, and from now on the Flash compiler will know where to look for the ssCore Obejct and the errors are gone.
The big disadvantage is that you will loose the code hinting ability of the ssCore Object while you are modifiying the SQLite class. If you do not plan to change the SQLite Class anyway, there is no problem.


case 2 - You want to register the ssCore object for your whole Project, and/or want to keep the Codehinting in AS2 Classes

For this purpose SWF Studio ships with so-called intrinsic classes. You could think of them as a kind of "Table of Contents". Flash can read these intrinsic classes and will now figure out what 'ssCore' means. More details on how to use these intrinsic classes can be found in the
Help File on the Intrinsic Classes

Hope that helps!
AGo is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.