Advertisement

08.24.2007 at 01:52AM PDT, ID: 22784511 | Points: 500
[x]
Attachment Details

Actionscript localconnection to database; using localhost

Tags: database, localhost
Hello,

I have been left with a flex product for a cd rom the wole thing will be published using zinc bu i need to get the debugging environment set up.

The previous developmer (who i cannot get hold of) used flashes localconnection object to access a sql server database. I know this somehow uses localhost but i am lost to how the two instances (dbin, dbout) were set up.



all i need is a good url clue on how to set up "dbin" and "dbout"
as for debugging the localconnection is susccessful because localhost is enabled

The access code goes something like.

declarations

private                    var _queryHandler:Function;
public                         var _queryTimer:Timer;
public                        var _queryQueue:Array;
public                         var _lcDBIn:LocalConnection;
public                         var _lcDBOut:LocalConnection;
public                         var _lcDBInConnected:Boolean;
public                         var _lcDBOutConnected:Boolean;  

            public function lcInit():void
            {
                                                                                                                                    //log("lcInit > called");
                  if (_lcDBIn == null)
                  {
                        _lcDBIn = new LocalConnection();
                        _lcDBIn.addEventListener(StatusEvent.STATUS, lcDBInStatus)
                  }
                  
                  if (_lcDBOut == null)
                  {
                        _lcDBOut = new LocalConnection();
                        _lcDBOut.addEventListener(StatusEvent.STATUS, lcDBOutStatus)
                        _lcDBOut.client = this;
                  }
            }
            
            public function lcDBInStatus(event:StatusEvent):void
            {
                  switch(event.level)
                  {
                        case "status":
                                                                                                                                    log("lcDBInStatus > Query request success (DBIn)");
                        break;
                        case "error":
                                                                                                                                    log("lcDBInStatus > Query request failed  (type : " + event.type + " | code : " + event.code + ")");
                        break;
                  }
            }
            
            public function lcDBOutStatus(event:StatusEvent):void
            {
                  switch(event.level)
                  {
                        case "status":
                                                                                                                                    //log("lcDBOutStatus > DB is talking to us");
                        break;
                        case "error":
                                                                                                                                    //log("lcDBOutStatus > DB is NOT talking to us (DBOut)");
                        break;
                  }
            }
            
            public function lcAvailable():Boolean
            {
                                                                                                                                    //log("lcAvailable > _lcDBInConnected : " + _lcDBInConnected + " | _lcDBOutConnected : " + _lcDBOutConnected);  
                  return (!_lcDBInConnected && !_lcDBOutConnected)      
            }
            
            public function lcQuery(sql:String, type:String):void
            {
                  try {
                              _lcDBOutConnected = true;
                              _lcDBOut.connect("DBOut");                                                                  //log("lcQuery > open 'DBOut' connection");
                        }
                  catch (error:ArgumentError)
                        {
                              _lcDBOutConnected = false;                                                                  //log("lcQuery > _lcDBOut > ERROR! : " + error.errorID + " > " + error.message);
                        }
try
      {
      _lcDBInConnected = true;
      _lcDBIn.send("DBIn", "query", sql, type);                                          
log("lcQuery (get data from DataBase): '" + sql + "' (" + type + ")");
                        }
                  catch (error:ArgumentError)
                        {
                        _lcDBInConnected  = false;                                                                   
                        log("lcQuery > _lcDBIn > ERROR! : " + error.errorID + " > " + error.message);
                        }
            }
            
            public function lcResult(data:*):void
            {
                                                                                                                                    //log("lcResult > result recieved (DBOut) '" + data.toString() + "'")
                                                                                                                                    //log("lcResult > connection closed (DBIn)")
                  _lcDBInConnected = false;
                  _lcDBOutConnected = false;
                  _lcDBOut.close();                                                                                           
                  queryQueuePop(data);
            }


Start your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: markofsoton
Question Asked On: 08.24.2007
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
08.24.2007 at 06:28AM PDT, ID: 19761928

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
08.24.2007 at 06:28AM PDT, ID: 19761928

Rank: Guru

I don't think you use the localconnection object to connect to databases, only to other swf files. Is there an intermediary / proxy swf file involved?

Also, beware of using Zinc if it's a CD-Rom application. It's known for having problems running direct from a CD-ROM on certain pc's.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628