Re: [flexcoders] SQL lite database and Tablet problem

2012-03-28 Thread Jeff Gomes

Mark-

Perhaps try applicationStorageDirectory instead of documentsDirectory.

-Jeff

On 3/28/2012 09:23, markflex2007 wrote:

Hi friends

I developed a Air mobile application with flex sdk 4.6.0. I test it in Flash 
Builder 4.6 simulators in windows.it works fine.

but when I install the apk and test it in Samsung Galaxy Tab 10.1 , the sqllite 
functions seems do not work

I save the sqllite database in the following path. I guess the tablet maybe do 
not allow me to use path.

var file:File = File.documentsDirectory.resolvePath(testDb.db);

Please help me if you have idea for this.

Thanks a lot

Mark



Re: [flexcoders] Re: popup on screen certer? [1 Attachment]

2012-02-19 Thread Jeff Gomes
Mark-

I don't know what you did to test this, but I was not guessing at my 
answer.  This is something I actually use (FB 4.6, btw, in case that 
matters).  As my gift to you, here is my simple Alert component that 
extends s:SkinnablePopUpContainer (attached as a ZIP and also pasted 
into the message, since I don't know which will work best on the list).

As you can see, it calls PopUpManager.centerPopUp(this) when it is first 
added to the stage and also anytime it receives a Resize event while it 
is open.  Some of the component is borrowed from tutorials I've seen on 
the web, but the code to handle resizing and centering was my own work.

-Jeff

?xml version=1.0 encoding=utf-8?
s:SkinnablePopUpContainer
 xmlns:fx=http://ns.adobe.com/mxml/2009;
 xmlns:s=library://ns.adobe.com/flex/spark
 addedToStage=_QueueCenter()
 creationComplete=_Init()
 
fx:Declarations
!-- Place non-visual elements (e.g., services, value objects) here --
/fx:Declarations
fx:Script
![CDATA[
 import mx.core.FlexGlobals;
 import mx.managers.PopUpManager;

 import spark.components.supportClasses.ViewNavigatorAction;

 [Bindable]
 public var alertTitle:String = alertTitle;

 [Bindable]
 public var alertMessage:String = alertMessage;

 private var _appTop:Object = 
mx.core.FlexGlobals.topLevelApplication;

 [Bindable]
 private var _nMaxWidth:Number = 300;

 private function _Center ( ) : void
 {
 if ( isOpen ) PopUpManager.centerPopUp ( this );
 }

 private function _Init ( ) : void
 {
 _appTop.addEventListener ( Event.RESIZE, _Resize );
 }

 private function _Resize ( e:* = null ) : void
 {
 if ( isOpen ) _QueueCenter ( );
 }

 private function _QueueCenter ( ) : void
 {
 _nMaxWidth = 0.9 * Math.min ( _appTop.width, 
_appTop.height );
 callLater ( _Center );
 }

 ]]
/fx:Script
s:TitleWindow
 id=titleWindow
 title={alertTitle}
 maxWidth={_nMaxWidth}
 close=close()
 
s:VGroup
 horizontalAlign=center
 horizontalCenter=0
 paddingLeft=16
 paddingTop=16
 paddingRight=16
 paddingBottom=16
 gap=24
 width=100%
 
s:Label
 id=message
 text={alertMessage}
 width=100%
 /
s:Button
 label=OK
 click=close(true)
 /
/s:VGroup
/s:TitleWindow
/s:SkinnablePopUpContainer

On 2/19/2012 08:15, markflex2007 wrote:
 I just test.PopUpManager can not work with s:SkinnablePopUpContainer.

 other idea?

 Thanks

 Mark
 --- In flexcoders@yahoogroups.com, Jeff Gomesjgomes@...  wrote:
 PopUpManager.centerPopUp(pop);

 On 2/17/2012 14:36, markflex2007 wrote:
 Hi

I uses:SkinnablePopUpContainer   build a pop component for mobile app

and use the following code to call the popup

var pop:PopUpWindows =  new PopUpWindows();  
pop.open(this,true);


but the popup always in top-left location of current page. how to make 
 the popup on screen certer

please help

Thanks for help

Mark
 



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location: 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links







 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location: 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links






Re: [flexcoders] popup on screen certer?

2012-02-17 Thread Jeff Gomes
PopUpManager.centerPopUp(pop);

On 2/17/2012 14:36, markflex2007 wrote:
 Hi

   I uses:SkinnablePopUpContainer  build a pop component for mobile app

   and use the following code to call the popup

   var pop:PopUpWindows =  new PopUpWindows(); 
   pop.open(this,true);


   but the popup always in top-left location of current page. how to make the 
 popup on screen certer

   please help

   Thanks for help

   Mark
   



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location: 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links






Re: [flexcoders] getting the total of values of an array collection that is updated manually

2011-12-03 Thread Jeff Gomes

One handy way to iterate the contents of an ArrayCollection to make a 
temporary vector from the source array of the collection, and use the 
vector.forEach method.

At 07:43 12/2/2011, ZIONIST wrote:
Hi Guys, i would like to get the total price calculated as an array 
collection for a list is populated plus i would like to update the 
total when the quantity changes too. Here is the code i have so far, 
could someone please help me correct it.

Main App
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=horizontal
 xmlns:ns1=*
 mx:states
 mx:State name=dark
 mx:SetProperty target={product}
 name=text
 value=Dark 
 Chocolate/
 mx:SetProperty target={price}
 name=text
 value=50/
 /mx:State
 mx:State name=spread
 mx:SetProperty target={product}
 name=text
 
value=Drinking Chocolate/
 mx:SetProperty target={price}
 name=text
 value=100/
 /mx:State
 /mx:states

 mx:Script
 ![CDATA[
 import mx.controls.listClasses.ListData;
 import mx.collections.ArrayCollection;

 [Bindable]
 private var orderColl:ArrayCollection=new 
 ArrayCollection();

 private function addProduct():void
 {

 //Create an object to hold the data
 var obj:Object=new Object();
 //Assign the variables to it
 obj.Product=product.text;
 obj.Price=price.text;
 //Add the object to the list
 orderColl.addItem(obj);

 }

 private function deleteOrder():void
 {

 //Remove the item from the array collection
 
orderColl.removeItemAt(products.selectedIndex);

 }

 private function init():void
 {
 var n:int=orderColl.length;
 var total:Number=0;
 for (var i:int=0; i  n; i++)
 {
 
//total+=orderColl[i][products.item.Price];
 total+=orderColl[i].Price++;
 }
 sum.text=total.toString();

 }
 ]]
 /mx:Script

 mx:Canvas width=500
height=300
 mx:Label x=10
   y=10
   text=Milk Chocolate
   id=product/
 mx:Label x=10
   y=36
   text=10
   id=price/
 mx:Button x=10
y=62
label=submit
click=addProduct();init()/
 mx:Button x=10
y=92
label=Change State
click=currentState='dark'/
 mx:Button x=10
y=122
label=Drinking Chocolate
click=currentState='spread'/
 /mx:Canvas

 mx:VBox width=340
 height=340
 horizontalAlign=center
 verticalAlign=middle
 mx:List id=products
 width=300
 height=300
 dataProvider={orderColl}
 itemRenderer=orderRenderer/
 mx:HBox
 mx:Label text=Total:
   color=#FF
   fontWeight=bold/
 mx:Label id=sum
   text=${}/
 /mx:HBox
 /mx:VBox

/mx:Application


Item Renderer (orderRenderer.mxml)

?xml 

Re: [flexcoders] Why can't I change the highlight color of Spark text?

2010-08-17 Thread Jeff Gomes

Assuming you want to set it for all text areas, you could experiment 
with the global styles selectionColor and focusedTextSelectionColor.

-Jeff

At 02:14 8/17/2010, dorkie dork from dorktown wrote:


I've spent soo much time trying to find how to do this.

I'm using, sparkTextArea.selectAll() to select text but I've found 
no way to change the highlight color.

JP



Re: [flexcoders] Rounding the corners of a scroller

2010-08-04 Thread Jeff Gomes
Brand-

I started with the default spark ComboBoxSkin and added a mask and 
some other tweaks to get it to look the way I wanted, such as moving 
the border rect to a higher z than the scroller.  It took a bit of 
trial and error, especially to get it to match up cleanly with the 
button, which also has a radius.

You can see the result here:  http://www.finselector.com/

-Jeff

At 06:58 8/3/2010, Brand wrote:
I've got a skin for my comboboxes, and while it's trivial to do 
rounded corners for the textentry portion, I can't seem to figure 
out how to round the corners of the dropdown.

If I remove the scroller altogether, the rounded background and 
border seem to work fine. However, the scroller portion of the 
dropdown doesn't seem to allow a radius.

I could put the rounded corner into the itemrenderer for the 
datagroup, but that would make each item have rounded corners, and 
if the bottom of the dropdown occurs in the middle of an item, I'll 
still have squared corners on the overall dropdown.

So, does anybody know if there's a way to round off the corners of 
the scroller object?

Thanks for your time and attention.

...