Re: [flexcoders] Re: Can someone rewrite this...

2010-04-17 Thread Joe Cabezas
Gordon:

that solution (the age switch) is what i proposed before, in the fisrt
reply, :D

PD: Adobe Flex SDK Team?, wow!, nice work adobe! :D

2010/4/16 Gordon Smith gosm...@adobe.com



  If age were an int rather than a Number (which it probably should be)
 then you could use a switch:



 switch (age)

 {

 case 0:

 case 1:

 case 2:

 return 1;

 case 3:

 case 4:

 case 5:

 return 2;

 case 6:

 case 7:

 case 8:

 return 3;

 case 9:

 case 10:

 case 11:

 case 12:

 return 4;

 case 13:

 case 14:

 case 15:

 return 5;

 case 16:

 case 17:

 case 18:

 return 6;

 default:

 return 0;

 }



 You could also use an array specifying the last age in each group - [ 2, 5,
 8, 12, 15, 18 ] - and iterate over it until you find the first one where the
 age is = the array entry. This would involve less code, but it would
 probably execute slightly slower.



 Finally, if the age groups were more sensible so that each one contained 3
 ages, then you could just do something like int(age/3) + 1.



 Gordon Smith

 Adobe Flex SDK Team





 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *Wally Kolcz
 *Sent:* Friday, April 09, 2010 9:00 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Re: Can someone rewrite this...





 Thanks for the catch on the GT. Haven't tried to run it yet. Just wrote is
 and hoped there would be a switch/case that is easier than having to case
 out each age..

 On 4/9/2010 11:43 PM, Joe wrote:



 it curious but a person who are 2000 years old, with your implementation
 it's group 1

 run this code:

 package
 {
 import flash.display.Sprite;

 public class test extends Sprite
 {
 public function test()
 {
 trace(this.getAgeGroup(2000));
 }

 private function getAgeGroup(age:Number):int {
 if (age = 0  age 3){ //Birth to 2
 return 1;
 }else if (age =3  age 6){ //3 to 5
 return 2;
 }else if (age =6  age 9){ //6 to 8
 return 3;
 }else if (age =9  age 13){ //9 to 12
 return 4;
 }else if (age =13  age 16){ //13 to 15
 return 5;
 }else if (age =16  age 19){ //16 to 18
 return 6;
 }else { //Older or Adults
 return 0;
 }

 }
 }
 }

 maybe you want to do this:

 private function getAgeGroup(birthday:Date):int {

 var age:int = getAge(birthday);

 if (age=0age3) {//Birth to 2
 return 1;
 } else if (age =3  age 6) {//3 to 5
 return 2;
 } else if (age =6  age 9) {//6 to 8
 return 3;
 } else if (age =9  age 13) {//9 to 12
 return 4;
 } else if (age =13  age 16) {//13 to 15
 return 5;
 } else if (age =16  age 19) {//16 to 18
 return 6;
 } else {//Older or Adults
 return 0;
 }

 }

 see i changed yours  with  ???

 HOWEVER, a switch implementation is like this:

 private function getAgeGroup(birthday:Date):int {

 var age:int=getAge(birthday);

 switch (age) {
 case 0 :
 case 1 :
 case 2 :
 return 1;
 break;
 case 3 :
 case 4 :
 case 5 :
 return 2;
 break;
 case 6 :
 case 7 :
 case 8 :
 return 3;
 break;
 case 9 :
 case 10 :
 case 11 :
 case 12 :
 return 4;
 break;
 case 13 :
 case 14 :
 case 15 :
 return 5;
 break;
 case 16 :
 case 17 :
 case 18 :
 return 6;
 break;
 default :
 return 0;
 break;
 }

 }

 Point for testing! :D

 greetings from Chile!, Latin America

 _



 



[flexcoders] When Flash Builder 4 will allow us to develop mobile applications?

2010-04-17 Thread fred44455
Apparently Flash CS5 has that capability but I wonder when Flex 4 developers 
will be able to create mobile application using Flash Builder 4? Does Adobe 
will come out with a plug for that purpose?



[flexcoders] Actionscript Project Flex Project How does the display list change?

2010-04-17 Thread Clark Stevenson
Hey guys.

Say your familiar with Flash document Class. Flash Develop or Flex
actionscript projects in that your not so familiar with MXML.

You take this class

package
{
 public class MyGraphic extends Sprite
 {

  private var customSprite:Sprite;

  public function MyGraphic()
  {
  super();
  }

 }
}



Ok heres the issue. If i start a new Flex Project because i want to combine
either an existing complex project or branch my application out to pure AS3
yet i want to retain the functionality of MXML for a form or a games room
etc.

How can i do this?

I remember last time i tried it was awkward.  MyGraphic needed to extend
UIComponent but then it got awkward because customSprite needed to also be a
UIComponent so i never found a way to combine them. Likewise, i read about a
rather obscure addRawChild() method but it seemed like a hack or frowned
apon.

That has something to do with the display list?

Is there any sources which i can read that deal with AS3 OOP TO Flex MXML
instead of treating you like you dont know what actionscript 3.0 is and
concentrating on MXML only?  I cannot find the relationship or common
functionality between the 2 different approaches. If i go with MXML im stuck
in modular tags with supporting actionscript, or if go with only AS3 i
have no access to the framework.

Cheers.

Clark.


Re: [flexcoders] Re: With the latest eula agreement from Apple

2010-04-17 Thread Nick Collins
Agreed, my point was simply that is was possible to do without the FP code.
If OpenPlug can do it, imagine what the company that holds the keys to the
kingdom can do.

On Thu, Apr 15, 2010 at 2:12 AM, Gregor Kiddie 
gregor.kid...@channeladvisor.com wrote:



  I have no idea how Elips are doing it, but they haven’t got the Player
 code, so they must be pulling some other trick to get it all to hang
 together!



 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *Nick Collins
 *Sent:* 14 April 2010 23:54
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Re: With the latest eula agreement from Apple





 If that were the case, then OpenPlug wouldn't be able to to it with Elips
 Studio, but they are. They basically are providing a modified Flex 3.x SDK
 to use within Flex Builder. Then their IDE extensions output an XCode
 project that even will give you hooks so you can tie into native services,
 like the camera, address book, etc.



  



[flexcoders] Re: amazon payments

2010-04-17 Thread groovydave36
so, no one here has ever used amazon as a payments system w/ Flex? There's 
gotta be someone...help a brotha' out!

--- In flexcoders@yahoogroups.com, groovydave36 groovydav...@... wrote:

 anyone? Buehler?
 
 --- In flexcoders@yahoogroups.com, groovydave36 groovydave36@ wrote:
 
  I am trying to integrate amazon payments w/ flex, as shown here:
  
  http://www.adobeopenoptions.com/devnet/flex/articles/flex_amazon_print.html
  
  I've got the payments system down in a standalone php version, so no issues 
  there. I'm having trouble with the flex integration. I've followed the 
  instructions and can click and get into amazon's sandbox fine and pay for 
  everything...well, almost. When I'm on the amazon co-branded site, I press 
  the confirm button and then get redirected to a page that says Signature 
  did not matchthis is coming from the return.php file that Miti created 
  but I can't figure out how to fix it. Anyone figured it out?
 





[flexcoders] Error while creating new project: Cannot access the web server

2010-04-17 Thread Pablo Augusto
Hello,


I'm starting in flex development, i had downloaded Flex Builder 4, im
following the adobe first videos, but when i'll create a new project, the
error is displayed:

Cannot access the web server. The server may not be running, or the web root
folder or root URL may be invalid.

I cannot validate mu paths and url.

I'm using the configs:

WebROOT: D:\xampp\htdocs
RootURL: http://localhost/
Output Folder: D:\xampp\htdocs\MyApp1-debug

Any idea to solve this problem?


[flexcoders] Why can't change title of application???

2010-04-17 Thread robin_w...@ymail.com
Hi,

I tried 2 ways to change the title of browser running my flex application:

1. set pageTitle of application
2. use code: BrowserManager.getInstance().setTitle(xxx);

The 2 ways work at very beginning, but after a remote call the title is changed 
to name of that web page, like xxx.html.

Any possible reasons?

thanks in advance.

Regards,
Robin






Re: [flexcoders] Why can't change title of application???

2010-04-17 Thread Alex Harui
File a bug with a simple test case.


On 4/16/10 6:55 PM, robin_w...@ymail.com robin_w...@ymail.com wrote:






Hi,

I tried 2 ways to change the title of browser running my flex application:

1. set pageTitle of application
2. use code: BrowserManager.getInstance().setTitle(xxx);

The 2 ways work at very beginning, but after a remote call the title is changed 
to name of that web page, like xxx.html.

Any possible reasons?

thanks in advance.

Regards,
Robin






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Actionscript Project Flex Project How does the display list change?

2010-04-17 Thread Alex Harui
You can use MXML w/o the Flex Framework.  You may need to create classes that 
implement IMXMLObject to do so, but it is possible.

But if you want to use the Flex Framework, then all things you add must follow 
the framework rules so it must implement IUIComponent.



On 4/17/10 7:55 AM, Clark Stevenson a.scots...@gmail.com wrote:






Hey guys.

Say your familiar with Flash document Class. Flash Develop or Flex 
actionscript projects in that your not so familiar with MXML.

You take this class

package
{
 public class MyGraphic extends Sprite
 {

  private var customSprite:Sprite;

  public function MyGraphic()
  {
  super();
  }

 }
}



Ok heres the issue. If i start a new Flex Project because i want to combine 
either an existing complex project or branch my application out to pure AS3 yet 
i want to retain the functionality of MXML for a form or a games room etc.

How can i do this?

I remember last time i tried it was awkward.  MyGraphic needed to extend 
UIComponent but then it got awkward because customSprite needed to also be a 
UIComponent so i never found a way to combine them. Likewise, i read about a 
rather obscure addRawChild() method but it seemed like a hack or frowned apon.

That has something to do with the display list?

Is there any sources which i can read that deal with AS3 OOP TO Flex MXML 
instead of treating you like you dont know what actionscript 3.0 is and 
concentrating on MXML only?  I cannot find the relationship or common 
functionality between the 2 different approaches. If i go with MXML im stuck in 
modular tags with supporting actionscript, or if go with only AS3 i have no 
access to the framework.

Cheers.

Clark.





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] MSSQL date field error: Error #1034: Type Coercion failed: cannot convert 2008-03-19 00:00:00.0 to Date.

2010-04-17 Thread Wally Kolcz
Anyone came across this bizarre error and know how to fix it? I am 
passing a value in result (which is typed datetime in MSSQL) to a 
function asking for a birthday variable, typed as Date, and its throwing 
this error. Never had this problem when I was using the same AS3 
function and value with MySQL.

I originally had the MSSQL column cast as Date but got this error so I 
switched to DateTime...same result.



[flexcoders] Flex and Google Check Out

2010-04-17 Thread Wally Kolcz
Anyone see an example out there using Flex or Flex/CF to use Google 
Checkout? Client prefers Google. Thanks!