×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    157

    Exclamation How to create combo box in FlashLite 3.x application?

    Hi,

    I have created a combo box in AS 2.0. It works well when published with FlashPlayer 8, but when I try to publish with FlashLite 3.x, I am unable to open the combo box data list box, however I somehow manage to change data selection using arrow keys. I have also checked the same on the remote access device. What should I change in the code or design to be able to see the data items list?

    This is my code:

    Code:
    stop();
    
    var dayCBData:Array = [{data:"01", label:"01"},{data:"02", label:"02"},{data:"03", label:"03"},{data:"04", label:"04"},{data:"05", label:"05"},{data:"06", label:"06"},{data:"07", label:"07"},{data:"08", label:"08"},{data:"09", label:"09"},{data:"10", label:"10"},{data:"11", label:"11"},{data:"12", label:"12"},{data:"13", label:"13"},{data:"14", label:"14"},{data:"15", label:"15"},{data:"16", label:"16"},{data:"17", label:"17"},{data:"18", label:"18"},{data:"19", label:"19"},{data:"20", label:"20"},{data:"21", label:"21"},{data:"22", label:"22"},{data:"23", label:"23"},{data:"24", label:"24"},{data:"25", label:"25"},{data:"26", label:"26"},{data:"27", label:"27"},{data:"28", label:"28"},{data:"29", label:"29"},{data:"30", label:"30"},{data:"31", label:"31"}];
    
    var monthCBData:Array = [{data:"01", label:"01"},{data:"02", label:"02"},{data:"03", label:"03"},{data:"04", label:"04"},{data:"05", label:"05"},{data:"06", label:"06"},{data:"07", label:"07"},{data:"08", label:"08"},{data:"09", label:"09"},{data:"10", label:"10"},{data:"11", label:"11"},{data:"12", label:"12"}];
    
    var yearCBData:Array = [{data:"1960", label:"1960"},{data:"1961", label:"1961"},{data:"1962", label:"1962"},{data:"1963", label:"1963"},{data:"1964", label:"1964"},{data:"1965", label:"1965"},{data:"1966", label:"1966"},{data:"1967", label:"1967"},{data:"1968", label:"1968"},{data:"1969", label:"1969"},{data:"1970", label:"1970"},{data:"1971", label:"1971"},{data:"1972", label:"1972"},{data:"1973", label:"1973"},{data:"1974", label:"1974"},{data:"1975", label:"1975"},{data:"1976", label:"1976"},{data:"1977", label:"1977"},{data:"1978", label:"1978"},
    {data:"1979", label:"1979"},{data:"1980", label:"1980"},{data:"1981", label:"1981"},{data:"1982", label:"1982"},{data:"1983", label:"1983"},{data:"1984", label:"1984"},{data:"1985", label:"1985"},{data:"1986", label:"1986"},{data:"1987", label:"1987"},{data:"1988", label:"1988"},{data:"1989", label:"1989"},{data:"1990", label:"1990"},{data:"1991", label:"1991"},{data:"1992", label:"1992"},{data:"1993", label:"1993"},{data:"1994", label:"1994"},{data:"1995", label:"1995"},{data:"1996", label:"1996"},{data:"1997", label:"1997"},{data:"1998", label:"1998"},
    {data:"1999", label:"1999"},{data:"1980", label:"2000"},{data:"2001", label:"2001"},{data:"2002", label:"2002"},{data:"2003", label:"2003"},{data:"2004", label:"2004"},{data:"2005", label:"2005"},{data:"2006", label:"2006"},{data:"2007", label:"2007"},{data:"2008", label:"2008"},{data:"2009", label:"2009"},{data:"2010", label:"2010"},{data:"2011", label:"2011"},{data:"2012", label:"2012"},{data:"2013", label:"2013"},{data:"2014", label:"2014"},{data:"2015", label:"2015"}];
    
    var dayOfBirth:String = dayCBData[0].data.toString();
    var monthOfBirth:String = monthCBData[0].data.toString();
    var yearOfBirth:String = yearCBData[0].data.toString();
    var dateOfBirth:String = yearOfBirth + "-" + monthOfBirth + "-" + dayOfBirth;
    
    dayCB.dataProvider = dayCBData;
    monthCB.dataProvider = monthCBData;
    yearCB.dataProvider = yearCBData;
    
    //start - day of birth combo box
    // Create listener object.
    var dayCBListener:Object = new Object();
    // Create event handler function.
    dayCBListener.change = function (evt_obj:Object) 
    {
    	var item:Object = dayCB.selectedItem;
    	dayOfBirth = item.data.toString();
    	checkDateValidity();	
    }
    
    dayCB.addEventListener("change", dayCBListener);
    //end - day of birth combo box
    
    //start - month of birth combo box
    var monthCBListener:Object = new Object();
    monthCBListener.change = function (evt_obj:Object) 
    {
    	var item:Object = monthCB.selectedItem;
    	monthOfBirth = item.data.toString();
    	checkDateValidity();	
    }
    monthCB.addEventListener("change", monthCBListener);
    //end - month of birth combo box
    
    //start - year of birth combo box
    var yearCBListener:Object = new Object();
    yearCBListener.change = function (evt_obj:Object) 
    {
    	var item:Object = yearCB.selectedItem;
    	yearOfBirth = item.data.toString();
    	trace(" yearOfBirth = " + yearOfBirth);
    	checkDateValidity();
    }
    yearCB.addEventListener("change", yearCBListener);
    //end - year of birth combo box
    
    function checkDateValidity()
    {
    	trace("**********************");
    	trace(parseInt(yearOfBirth));	
    	trace(parseInt(yearOfBirth)/400);
    	trace(parseInt(yearOfBirth)/100);
    	trace(parseInt(yearOfBirth)/4);
    	trace(parseInt(dayOfBirth));
    	trace(monthOfBirth);	
    	trace("#######################");	
    	if(parseInt(dayOfBirth) == 31 && 
    		(monthOfBirth == "02"
    		||  monthOfBirth == "04"
    		||	monthOfBirth == "06"
    		||	monthOfBirth == "09"
    		||	monthOfBirth == "11"))
    	{
    		trace("Invalid Date");
    		dayOfBirth = "00";
    		dateDisplay.text = "Error 1";
    		trace("This month does not have 31 days")
    	}
    	else if(parseInt(dayOfBirth) > 29 
    		&& monthOfBirth == "02")
    	{
    		trace("Days in February do not exceed 29 days");
    		dateDisplay.text = "Error 2";
    	}
    	else if(parseInt(dayOfBirth) == 29 
    		&& monthOfBirth == "02")	
    	{
    		if((parseInt(yearOfBirth)%100 == 0 && parseInt(yearOfBirth)%400 == 0)
    		|| (parseInt(yearOfBirth)%100 != 0 && parseInt(yearOfBirth)%4 == 0))
    		{
    			dateOfBirth = yearOfBirth + "-" + monthOfBirth + "-" + dayOfBirth;
    			trace("February is leap!!! " + dateOfBirth);
    		}
    		else 
    		{
    			trace("February is not a leap month this year.");
    			dateDisplay.text = "Error 3";
    		}
    	}	
    	else
    	{
    		dateOfBirth = yearOfBirth + "-" + monthOfBirth + "-" + dayOfBirth;
    		dateDisplay.text = dateOfBirth;
    	}	
    }
    
    checkDate.onRelease = function()
    {
    	checkDateValidity();
    }
    Regards,
    Supriya Tenany

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: How to create combo box in FlashLite 3.x application?

    Hi supriyaakg,
    I Cant find the issue in first view but i advise you to keep debugging your component and i am sure u will find the issue. Just be patience and keep debugging each line. Because no body other than you can solve this issue.

    One Hint: Your error is very much saying that you are using some APIs which are not supported by Flash Lite but does supported by Flash for PC.

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Apr 2008
    Location
    India / Singapore
    Posts
    549

    Re: How to create combo box in FlashLite 3.x application?

    The adobe ux design team created several ui components. U can use them.. Search - mark Doherty as2 mobile components.
    There is also the shrunken ui components by Jesse warden
    Twitter - manikantan_k
    Just in --

Similar Threads

  1. Is a date selection combo box possible on FlashLite 3.1?
    By supriyaakg in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2011-02-16, 17:49
  2. how to get combo box in symbian
    By prathi in forum Symbian
    Replies: 3
    Last Post: 2010-11-29, 10:41
  3. how to create combo box in S60 3rd edition
    By anup007star in forum Symbian
    Replies: 11
    Last Post: 2009-08-24, 10:59
  4. Replies: 3
    Last Post: 2009-06-06, 06:55
  5. Need help to create Combo Box
    By RB_Sahu in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-03-12, 11:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×