header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
gourav
Points:540
Posts:0

10/6/2010 6:48:19 AM

Title: Air-cairngorm With Flex4


Hello All,

I am using Air-cairngorm With Flex, and i am facing some problem here, i used this type of code in flex3 but the same code is not working in flex4.

i am facing the fallowing problem.

1.In my "SQLStatementConfiguration.as" i got error

"Call to a possibly undefined method getResourceBundle through a reference with static type Class"

2.Might be the problem with fallowing code in "SQLStatementConfiguration.as".

[ResourceBundle('sql')]
private static const resource:ResourceBundle;


Can any one solve my problem ?


Thanks in advance



1
Rajesh
Points: 40
Posts:0
10/7/2010 12:19:50 AM



just spesify your resource bundles in project properties-> Flex Compiler put this lines to additional compiler: -locale=en_US,ja_JP -source-path=locale/{locale}

2
gourav
Points: 540
Posts:0
10/7/2010 1:54:25 AM



can any one suggest the solution. plz

3
Andrid
Points: 720
Posts:0
10/7/2010 2:56:53 AM



i think you need to configure your resource bundle in flex , see these article for more details about using resource bundle in flex

http://www.visible-form.com/blog/flex-localization-with-resource-bundles/
http://www.deitte.com/archives/2006/10/using_resource.htm

4
gourav
Points: 540
Posts:0
10/7/2010 3:52:02 AM



Thank i use this code, still i did not got solution can any one solve my problem


package rws.cairngorm.langomax.business
{
	import mx.resources.IResourceBundle;
	import mx.resources.IResourceManager;
	import mx.resources.ResourceBundle;
	import mx.resources.ResourceManager;

	public class SQLStatementConfiguration 
	{
		
		[ResourceBundle('sql')]
		private static const resource:ResourceBundle;
		
		private static const rm:IResourceManager = ResourceManager.getInstance();
		
		public static const CREATE_TABLE:String =  ResourceManager.getInstance().getString("sql", "CREATE_TABLE1");
		public static const GETALLUSERS:String =  ResourceManager.getInstance().getString("sql", "GETALLUSERS");
		public static const INSERT:String =  ResourceManager.getInstance().getString("sql","INSERT");
		public static const LOGINUSER:String =  ResourceManager.getInstance().getString("sql","LOGINUSER");
		public static const UPCOMINGWORDS:String =  ResourceManager.getInstance().getString("sql","UPCOMINGWORDS");
	}
}


5
nicky
Points: 0
Posts:0
12/9/2010 7:34:50 AM



1.Remove your Services and Controller from main.mxml

<!--
<business:Services id="services" />
<control:Controller id="controller" />
-->

then add these three as in business folder


6
nicky
Points: 0
Posts:0
12/9/2010 7:35:17 AM






package cairngorm.business
{
	import com.adobe.cairngorm.CairngormError;
	import com.adobe.cairngorm.CairngormMessageCodes;
	import com.ericfeminella.air.cairngorm.business.SQLService;
	
	import flash.filesystem.File;
	
	import mx.controls.Alert;
	import mx.states.OverrideBase;
	
	public class MySQLService extends SQLService
	{
		private static var instance:MySQLService;
		private const DBFile:String="users.db";
		public function MySQLService()
		{
			super();
			if ( instance != null )
			{
				
				throw new CairngormError( CairngormMessageCodes.SINGLETON_EXCEPTION , "MySQLService" );
			}
			instance = this;
			init();
			this.openAsync();
			
		}
		public static function getInstance() : MySQLService
		{
			if (instance == null)
			{
				instance = new MySQLService();
			}
			return instance;
		}
		private function init():void
		{
			var dbFileTest:File = File.applicationDirectory.resolvePath("users.db");
			var dbWorkedFile:File = File.applicationStorageDirectory.resolvePath("users.db");
			if(!dbWorkedFile.exists)
			{
				dbFileTest.copyTo(dbWorkedFile);
			}
			
			
			
			this.databaseFileName=DBFile;
			//this.databaseFilePath=File.documentsDirectory.nativePath;
			this.databaseFilePath=File.applicationStorageDirectory.nativePath;
			//Alert.show(""+File.applicationStorageDirectory.nativePath);
		}
			
	}
}


7
nicky
Points: 0
Posts:0
12/9/2010 7:37:07 AM






public class SQLStatementConfiguration 
	{	
		public static const CREATE_TABLE:String = "CREATE TABLE users(first_name VARCHAR(30),last_name VARCHAR(30),password VARCHAR(30),email VARCHAR(30),profile VARCHAR(30),dob DATE)"
		public static const GETALLUSERS:String = "select  *  from users where status=1";
	}






------------------------


public class UserServiceDelegate  
	{
		protected var responder:ISQLResponder;
		private  var sql:MySQLService=MySQLService.getInstance();
		private var myservice:SQLService;
		
			
		public function UserServiceDelegate(responder:ISQLResponder)
		{
			this.responder=responder;
			
			//myservice=sql.getSQLService();
				
			//this.sql= AIRServiceLocator.getInstance().getSQLService(Services.USERS_SERVICE);	
		}	

		protected function execute(statement:String) :void
		{
			//sql.openAsync();
			sql.executeAsync( statement, responder );
			
		}
	}
}

8
nicky
Points: 0
Posts:0
12/9/2010 7:37:57 AM



You can try with this code ....this will having some problem but you can update and apply

9
Arvind
Points: 0
Posts:0
1/9/2012 7:57:44 AM



Hi,
I am getting a same problem, can you help me in this?

Thanks


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+5 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions