[flexcoders] current date for mx:DateField

2012-03-08 Thread markflex2007

Hi,

current date for mx:DateField seems get from window system. May I change 
current date with code?

Thanks

Mark



RE: [flexcoders] Flex Menu.createMenu on mouseDown issue

2012-03-08 Thread Philip Smith

The menu doesn't open. And 'mouseDown' is required in the context of the app. 
Any ideas, Alex?

Here's the test code:

?xml version=1.0 encoding=utf-8?
s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; 
   xmlns:s=library://ns.adobe.com/flex/spark 
   xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300
fx:Declarations
!-- Define the menu data. --
fx:XML format=e4x id=myMenuData
root
menuitem label=MenuItem A 
menuitem label=SubMenuItem A-1 enabled=false/
menuitem label=SubMenuItem A-2/
/menuitem
menuitem label=MenuItem B type=check toggled=true/
menuitem label=MenuItem C type=check toggled=false/
menuitem type=separator/ 
menuitem label=MenuItem D 
menuitem label=SubMenuItem D-1 type=radio 
  groupName=one/
menuitem label=SubMenuItem D-2 type=radio 
  groupName=one toggled=true/
menuitem label=SubMenuItem D-3 type=radio 
  groupName=one/
/menuitem
/root
/fx:XML
/fx:Declarations

fx:Script
![CDATA[

import mx.controls.Menu;

// Create and display the Menu control.
private function createAndShow():void 
{
var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
myMenu.labelField=@label;
myMenu.show(10, 10);
}
]]
/fx:Script
s:VGroup
s:Button id=myButton 
  label=Open Menu 
  click=createAndShow();/
/s:VGroup
/s:Application


To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Wed, 7 Mar 2012 22:55:23 -0800
Subject: Re: [flexcoders] Flex Menu.createMenu on mouseDown issue


















 



  



  
  
  

What happens?





On 3/7/12 6:06 PM, method_air loudj...@hotmail.com wrote:



 

 

 

   



Attempting to create a flex Menu on 'mouseDown' is failing (but works using the 
'click' event):



private function createAndShow():void 

{

var myMenu:Menu = Menu.createMenu(null, myMenuData, false);

myMenu.show(10, 10);

}

]]

/mx:Script







!-- Define a Button control to open the menu --

s:Button mouseDown=createAndShow();/



Is there a workaround?



Thanks,



Philip



 

   







-- 

Alex Harui

Flex SDK Team

Adobe Systems, Inc.

http://blogs.adobe.com/aharui








 









  

RE: [flexcoders] Flex Menu.createMenu on mouseDown issue

2012-03-08 Thread Philip Smith

Substitute this button code to see the menu create fail:

!--- mouse down fails to show menu --
s:Button id=myButton 
  label=Open Menu 
  mouseDown=createAndShow();/

To: flexcoders@yahoogroups.com
From: loudj...@hotmail.com
Date: Thu, 8 Mar 2012 17:27:45 +
Subject: RE: [flexcoders] Flex Menu.createMenu on mouseDown issue


















 



  



  
  
  


The menu doesn't open. And 'mouseDown' is required in the context of the app. 
Any ideas, Alex?

Here's the test code:

?xml version=1.0 encoding=utf-8?
s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; 
   xmlns:s=library://ns.adobe.com/flex/spark 
   xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300
fx:Declarations
!-- Define the menu data. --
fx:XML format=e4x id=myMenuData
root
menuitem label=MenuItem A 
menuitem label=SubMenuItem A-1 enabled=false/
menuitem label=SubMenuItem A-2/
/menuitem
menuitem label=MenuItem B type=check toggled=true/
menuitem label=MenuItem C type=check toggled=false/
menuitem type=separator/ 
menuitem label=MenuItem D 
menuitem label=SubMenuItem D-1 type=radio 
  groupName=one/
menuitem label=SubMenuItem D-2 type=radio 
  groupName=one toggled=true/
menuitem label=SubMenuItem D-3 type=radio 
  groupName=one/
/menuitem
/root
/fx:XML
/fx:Declarations

fx:Script
![CDATA[

import mx.controls.Menu;

// Create and display the Menu control.
private function createAndShow():void 
{
var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
myMenu.labelField=@label;
myMenu.show(10, 10);
}
]]
/fx:Script
s:VGroup
s:Button id=myButton 
  label=Open Menu 
  click=createAndShow();/
/s:VGroup
/s:Application


To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Wed, 7 Mar 2012 22:55:23 -0800
Subject: Re: [flexcoders] Flex Menu.createMenu on mouseDown issue


















 



  



  
  
  

What happens?





On 3/7/12 6:06 PM, method_air loudj...@hotmail.com wrote:




 

 

 

   



Attempting to create a flex Menu on 'mouseDown' is failing (but works using the 
'click' event):



private function createAndShow():void 

{

var myMenu:Menu = Menu.createMenu(null, myMenuData, false);

myMenu.show(10, 10);

}

]]

/mx:Script







!-- Define a Button control to open the menu --

s:Button mouseDown=createAndShow();/



Is there a workaround?



Thanks,



Philip



 

   







-- 

Alex Harui

Flex SDK Team

Adobe Systems, Inc.

http://blogs.adobe.com/aharui









 









  



 









  

Re: [flexcoders] Flex Menu.createMenu on mouseDown issue

2012-03-08 Thread Alex Harui
Did you try callLater on createAndhow?


On 3/8/12 9:30 AM, Philip Smith loudj...@hotmail.com wrote:






Substitute this button code to see the menu create fail:

!--- mouse down fails to show menu --
s:Button id=myButton
  label=Open Menu
  mouseDown=createAndShow();/


To: flexcoders@yahoogroups.com
From: loudj...@hotmail.com
Date: Thu, 8 Mar 2012 17:27:45 +
Subject: RE: [flexcoders] Flex Menu.createMenu on mouseDown issue





The menu doesn't open. And 'mouseDown' is required in the context of the app. 
Any ideas, Alex?

Here's the test code:

?xml version=1.0 encoding=utf-8?
s:Application xmlns:fx=http://ns.adobe.com/mxml/2009;
   xmlns:s=library://ns.adobe.com/flex/spark
   xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300
fx:Declarations
!-- Define the menu data. --
fx:XML format=e4x id=myMenuData
root
menuitem label=MenuItem A 
  ! ;  menuitem label=SubMenuItem A-1 enabled=false/
menuitem label=SubMenuItem A-2/
/menuitem
menuitem label=MenuItem B type=check toggled=true/
menuitem label=MenuItem C type=check toggled=false/
menuitem type=separator/
menuitem label=MenuItem D 
menuitem label=SubMenuItem D-1 type=! radio
  ! nbsp; n bsp; groupName=one/
menuitem label=SubMenuItem D-2 type=radio
  groupName=one toggled=true/
menuitem label=SubMenuItem D-3 type=radio
  groupName=one/
/menuitem
/root
/fx:XML
  nb! sp; /fx:Declarations

fx:Script
![CDATA[

import mx.controls.Menu;

// Create and display the Menu control.
private function createAndShow():void
{
var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
myMenu.labelField=@label;
myMenu.show(10, 10);
 !}
 !  n bsp; ]]
/fx:Script
s:VGroup
s:Button id=myButton
  label=Open Menu
  click=createAndShow();/
/s:VGroup
/s:Application



To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Wed, 7 Mar 2012 22:55:23 -0800
Subject: Re: [flexcoders] Flex Menu.createMenu on mouseDown issue




   What happens?


On 3/7/12 6:06 PM, method_air loudj...@hotmail.com wrote:







Attempting to create a flex Menu on 'mouseDown' is failing (but works using the 
'click' event):

private function createAndShow():void
{
var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
myMenu.show(10, 10);
}
]]
/mx:Script



!-- Define a Button control to open the menu --
s:Button mouseDown=createAndShow();/

Is there a workaround?

Thanks,

Philip






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


RE: [flexcoders] Flex Menu.createMenu on mouseDown issue

2012-03-08 Thread Philip Smith

That works. Thanks.

To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Thu, 8 Mar 2012 14:38:38 -0800
Subject: Re: [flexcoders] Flex Menu.createMenu on mouseDown issue


















 



  



  
  
  


Did you try callLater on createAndhow?





On 3/8/12 9:30 AM, Philip Smith loudj...@hotmail.com wrote:



 

 

 

   



Substitute this button code to see the menu create fail:



!--- mouse down fails to show menu --

s:Button id=myButton 

  label=Open Menu 

  mouseDown=createAndShow();/



To: flexcoders@yahoogroups.com

From: loudj...@hotmail.com

Date: Thu, 8 Mar 2012 17:27:45 +

Subject: RE: [flexcoders] Flex Menu.createMenu on mouseDown issue



 

 

 

   

The menu doesn't open. And 'mouseDown' is required in the context of the app. 
Any ideas, Alex?



Here's the test code:



?xml version=1.0 encoding=utf-8?

s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; 

   xmlns:s=library://ns.adobe.com/flex/spark 

   xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300

fx:Declarations

!-- Define the menu data. --

fx:XML format=e4x id=myMenuData

root

menuitem label=MenuItem A 

  ! ;  menuitem label=SubMenuItem A-1 enabled=false/

menuitem label=SubMenuItem A-2/

/menuitem

menuitem label=MenuItem B type=check toggled=true/

menuitem label=MenuItem C type=check toggled=false/

menuitem type=separator/ 

menuitem label=MenuItem D 

menuitem label=SubMenuItem D-1 type=! radio 

  ! nbsp; n bsp; groupName=one/

menuitem label=SubMenuItem D-2 type=radio 

  groupName=one toggled=true/

menuitem label=SubMenuItem D-3 type=radio 

  groupName=one/

/menuitem

/root

/fx:XML

  nb! sp; /fx:Declarations



fx:Script

![CDATA[



import mx.controls.Menu;



// Create and display the Menu control.

private function createAndShow():void 

{

var myMenu:Menu = Menu.createMenu(null, myMenuData, false);

myMenu.labelField=@label;

myMenu.show(10, 10);

 !}

 !  n bsp; ]]

/fx:Script

s:VGroup

s:Button id=myButton 

  label=Open Menu 

  click=createAndShow();/

/s:VGroup

/s:Application





To: flexcoders@yahoogroups.com

From: aha...@adobe.com

Date: Wed, 7 Mar 2012 22:55:23 -0800

Subject: Re: [flexcoders] Flex Menu.createMenu on mouseDown issue



 

 

 

   What happens?





On 3/7/12 6:06 PM, method_air loudj...@hotmail.com wrote:





 

 

 

   



Attempting to create a flex Menu on 'mouseDown' is failing (but works using the 
'click' event):



private function createAndShow():void 

{

var myMenu:Menu = Menu.createMenu(null, myMenuData, false);

myMenu.show(10, 10);

}

]]

/mx:Script







!-- Define a Button control to open the menu --

s:Button mouseDown=createAndShow();/



Is there a workaround?



Thanks,



Philip



 

   







-- 

Alex Harui

Flex SDK Team

Adobe Systems, Inc.

http://blogs.adobe.com/aharui








 









  

[flexcoders] how to add nativemenu on topLevelApplication

2012-03-08 Thread isa_loyer
I developp a AIR application.

I try to add menu on it.

My application has custom chrome, and I like to have a transparent background 
on main application.

Today, I insert the nativemenu on a native window:

 FlexGlobals.topLevelApplication.visible = false;
var options:NativeWindowInitOptions = new 
NativeWindowInitOptions(); 
options.systemChrome = NativeWindowSystemChrome.STANDARD; 
options.transparent = false; 
options.maximizable= false;
options.resizable = false;
menuWindow = new NativeWindow(options); 
menuWindow.width = Capabilities.screenResolutionX; 
menuWindow.height = 55; 
menuWindow.x = 0;
menuWindow.y = 0;


menuWindow.title = MyApp;
menuWindow.menu = menuBarSE.initMenuOE();
menuWindow.alwaysInFront = true; 
menuWindow.activate();   
menuWindow.addEventListener(Event.CLOSING, 
applicationExitHandler);

But, with this approach is difficult to manage other window, like reduce or 
maximize action.

So, if it's possible I'd like to add the menu on the main window 
(topLevelApplication), but I don't know how!

If someone could help me.

thanks



[flexcoders] how to add nativemenu on topLevelApplication

2012-03-08 Thread isa_loyer
I developp a AIR application.

I try to add menu on it.

My application has custom chrome, and I like to have a transparent background 
on main application.

Today, I insert the nativemenu on a native window:

 FlexGlobals.topLevelApplication.visible = false;
var options:NativeWindowInitOptions = new 
NativeWindowInitOptions(); 
options.systemChrome = NativeWindowSystemChrome.STANDARD; 
options.transparent = false; 
options.maximizable= false;
options.resizable = false;
menuWindow = new NativeWindow(options); 
menuWindow.width = Capabilities.screenResolutionX; 
menuWindow.height = 55; 
menuWindow.x = 0;
menuWindow.y = 0;


menuWindow.title = MyApp;
menuWindow.menu = menuBarSE.initMenuOE();
menuWindow.alwaysInFront = true; 
menuWindow.activate();   
menuWindow.addEventListener(Event.CLOSING, 
applicationExitHandler);

But, with this approach is difficult to manage other window, like reduce or 
maximize action.

So, if it's possible I'd like to add the menu on the main window 
(topLevelApplication), but I don't know how!

If someone could help me.

thanks