[flexcoders] Flex + PayPal.

2007-01-28 Thread rozhkovalexey
Hi everyone.
All very simple.
In HTML I use this and it's working. I see paypal page with correct 
information.

form method=post action= https://www.sandbox.paypal.com/cgi-
bin/webscr 
input type=hidden name=cmd value=_xclick 
input type=hidden name=business value=[EMAIL PROTECTED] 
input type=hidden name=item_name value=Shopping cart 
input type=hidden name=item_number value=22 
input type=hidden name=amount value=42.00 
input type=hidden name=no_shipping value=0 
input type=hidden name=rm value=1 
input type=submit value=Checkout  
/FORM 

In Flex I use this:

var url : String = https://www.sandbox.paypal.com/cgi-bin/webscr;;
var variables : URLVariables = new URLVariables();
variables.cmd = _xclick;
variables.business = [EMAIL PROTECTED];
variables.item_name = Shopping cart;
variables.item_number = 22;
variables.amount = 15.00;
variables.no_shipping   = 0;
variables.rm = 1;
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.data = variables;
try
{
   navigateToURL(request);
}
catch (e:Error)
{
}

And I see paypal page with We are sorry, we are experiencing 
temporary difficulties. Please try again later. ...
Anybody know how it fix?



[flexcoders] Different font height on Mac and Win.

2006-11-29 Thread rozhkovalexey
Create for example TextInput with fontFamily=TimesNewRoman, 
fontSize=14. If you run the function TextInput.measureText
( ).ascent on Mac the result will never be 14. On Windows - all 
good.

It's problem with measureText function.
Try to run this is simple application on Mac and on Win and you will 
see what I'm speeking about.

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute
mx:Script
![CDATA[
public function showHeight():void
{
height1.text = String
(textInput1.measureText(textInput1.text).ascent);
height2.text = String
(textInput2.measureText(textInput1.text).ascent);
}
]]
/mx:Script
mx:VBox width=100% height=100% horizontalAlign=center
mx:HBox
mx:TextInput id=textInput1 text=Test 
fontSize=10/
mx:Spacer width=30/
mx:Label text=Text height/
mx:TextInput id=height1/
/mx:HBox
mx:HBox
mx:TextInput id=textInput2 text=Test 
fontFamily=TimesNewRoman fontSize=10/
mx:Spacer width=30/
mx:Label text=Text height/
mx:TextInput id=height2/
/mx:HBox
mx:Button label=Get height click=showHeight()/
/mx:VBox
/mx:Application

Anybody know how can fix this?