[flexcoders] Embed AIR app to MS Word

2009-06-24 Thread lehaianh1986
Hi all, I know some function of Adobe Reader is embed to MS Word. I wonder that 
can AIR app have ability to embed to MS Word? And how to do it? 



[flexcoders] Read pdf file

2009-05-06 Thread lehaianh1986
Hi all. I see that AIR can access pdf file and display it by htmlloader. But to 
manipulate with it, firstly I need to write javascript function and add to each 
pdf file like http://www.adobe.com/devnet/air/flex/quickstart/scripting_pdf.html

What I want is manipulate with random pdf file and do some action (copy all 
text to clipboard, or convert pdf file to text file). The reason is I want to 
read information from pdf file then get important data. So how to write 
external javascript which can do it and don't need write any added javascript 
on pdf file. Thank advanced any help

Hai Anh



[flexcoders] Synchronize time

2009-04-23 Thread lehaianh1986
Hi all, can AIR have ability to check date-time from internet? Depend on my 
knowledge, I think I need to send request to some websites, then receive the 
response is the date. Any one know about it can help me? I search but don't see 
anything guide me to do that.



[flexcoders] Re: Expiration date

2009-04-22 Thread lehaianh1986
Thank all, I read carefully all replies. Sent a request, then analyze a 
response to know the state of expiration date... Yeah,I think it is good idea. 
It help me control the date I want to expire and don't care about clock of user 
computer.

Are you have any simple example about it? I know about send one request to 
server, but how to receive response? Thank all of you very much

Hai Anh

--- In flexcoders@yahoogroups.com, Kenneth Sutherland 
kenneth.sutherl...@... wrote:

 Depending on what your app does, restricting its use, for example
 disable saving/loading/copying of text and similar are quite common
 features to make users upgrade.
 
  
 
 Or what you could do is put in some code on startup that sent a request
 to your server to accept a response.  Only if the response was OK would
 the app run and not exit.  That way your beta version would expire on a
 set date and not from when a user had actually installed it.  You could
 also use the auto-update feature of AIR for this, once you wish you app
 to go from beta to release force the update on the user and then they
 need to enter a license key which they will get from yourself.
 
  
 
 Kenneth.
 
  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of lehaianh1986
 Sent: 22 April 2009 04:03
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Expiration date
 
  
 
 
 
 
 
 
 Hi all, I have small AIR project, now it is beta version. I will send it
 to some testers. So, I want to write some code to set expired date for
 it. Example as set this soft to stop working 1 month from first use, or
 set the number of using soft is 100 times.
 
 Any one can guide me some steps to do it? Thank in advanced
 
 Hai Anh
 
 
 
 Disclaimer 
 ---
 This electronic message contains information which may be privileged and 
 confidential. The information is intended to be for the use of the 
 individual(s) or entity named above. If you are not the intended recipient, 
 be aware that any disclosure, copying, distribution or use of the contents of 
 this information is prohibited. If you have received this electronic message 
 in error, please notify us by telephone on 0131 476 6000 and delete the 
 material from your computer. 
 Registered in Scotland number: SC 172507. 
 Registered office address: Quay House 142 Commercial Street Edinburgh EH6 
 6LB. 
 
 This email message has been scanned for viruses by Mimecast.
 ---





[flexcoders] Expiration date

2009-04-21 Thread lehaianh1986
Hi all, I have small AIR project, now it is beta version. I will send it to 
some testers. So, I want to write some code to set expired date for it. Example 
as set this soft to stop working 1 month from first use, or set the number of 
using soft is 100 times.

Any one can guide me some steps to do it? Thank in advanced

Hai Anh



[flexcoders] Re: InteractiveObject Problem

2009-04-17 Thread lehaianh1986
Thank Amy

I have found about evt.mouseTarget as ... and now no error appear.

Hai Anh

--- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote:

 --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@ wrote:
 
  I know it, but I can't choice another Class because evt.mouseTarget is 
  InteractiveObject
  
  I write code 
  
  if (evt.mouseTarget.hasOwnProperty(data))
var inObj:AdvancedDataGridItemRenderer = evt.mouseTarget;
  
  The error message
  
  1118: Implicit coercion of a value with static type 
  flash.display:InteractiveObject to a possibly unrelated type 
  mx.controls.advancedDataGridClasses:AdvancedDataGridItemRenderer.
 
 var inObj:AdvancedDataGridItemRenderer = evt.mouseTarget as 
 AdvancedDataGridItemRenderer;





[flexcoders] Re: InteractiveObject Problem

2009-04-15 Thread lehaianh1986
I know it, but I can't choice another Class because evt.mouseTarget is 
InteractiveObject

I write code 

if (evt.mouseTarget.hasOwnProperty(data))
  var inObj:AdvancedDataGridItemRenderer = evt.mouseTarget;

The error message

1118: Implicit coercion of a value with static type 
flash.display:InteractiveObject to a possibly unrelated type 
mx.controls.advancedDataGridClasses:AdvancedDataGridItemRenderer.

In debug mode I can see value of evt.mouseTarget but I can assign it to any 
variables in my knowledge :(


 Here, you've chosen to type your variable as InteractiveObject:

 var inObj:InteractiveObject;
 inObj = evt.mouseTarget;
 
 Yet you say that the actual data type of your object is this:
 
 inObj = inObj =
 (mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer)
 mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer (@9385479)
 
 
 AdvancedDataGridItemRenderer has a data property.  InteractiveObject, its 
 great-great-grandparent class, does not.  So, you have the choice of typing 
 this object as anything in its inheritance chain, plus the five interfaces it 
 implements.  You've chosen to type it as InteractiveObject, which doesn't 
 have a data property, nor does UITextField, FlexTextField, DisplayObject, 
 EventDispatcher, or Object.
 
 Change var inObj:InteractiveObject
 
 to var inObj:SomeClassOrInterfaceThatHasADataProperty
 
 HTH;
 
 Amy





[flexcoders] InteractiveObject Problem

2009-04-14 Thread lehaianh1986
I have an event for my right click mouse on AdvancedDataGrid. I want to collect 
row item data so my code is

public function menuItemSelect(evt:ContextMenuEvent):void
{
  var searchString:String;
  var inObj:InteractiveObject;
  inObj = evt.mouseTarget;
  if (inObj.hasOwnProperty(data))
  {
var obj:Object = inObj.data;
if (obj.hasOwnProperty(Index))
searchString = obj.Index;
else
searchString = ;
  }
  else
searchString = ;
...
}

The error is Access of possibly undefined property data through a reference 
with static type 
 flash.display:InteractiveObject in line

var obj:Object = inObj.data;

but I see in debug mode

inObj = inObj = 
(mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer) 
mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer (@9385479)  

inObj.data = inObj.data = (Object) Object (@699b629)
Index = 1 : String
mx_internal_uid = AC2A10E1-8A14-7CDD-FF42-A40DE4F2CDA2 : String   


So why the code false? How to solve it?






[flexcoders] Re: InteractiveObject Problem

2009-04-14 Thread lehaianh1986
How? I don't understand what you say. If I click on header of AdvancedDataGrid 
or another area, it false because an object have no data property. But when I 
click on row item in AdvancedDataGrid, an object I collect have data property. 
I use code
if (inObj.hasOwnProperty(data))
to avoid wrong case, after that I assign inObj.data to obj

I don't know why I still see value of data, but I can't assign it

Any one help me?

 It fails because InteractiveObject, unlike, say, UIComponent, doesn't have a 
 data property.  So instead of casting it to an object that doesn't have a 
 data property, try casting it to one that does.
 
 HTH;
 
 Amy





[flexcoders] Re: PrintAdvancedDataGrid Problem

2009-04-13 Thread lehaianh1986
Can anyone help me solve my problem?



[flexcoders] PrintAdvancedDataGrid Problem

2009-04-12 Thread lehaianh1986
Hi all, I have data in AdvancedDataGrid and want to print it. If I only print 
data is provided by Results(ArrayCollection), it will print ok. But I want to 
print data is showed in AdvancedDataGrid because it is grouped by some grouping 
field. 

Here is my old code, it  print data in multi page ok

FormPrintView.mxml copmponent

?xml version=1.0?
mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; 
backgroundColor=#FF
paddingTop=30 paddingBottom=30 paddingLeft=30
mx:PrintAdvancedDataGrid id=myDataGrid width=95% height=100%
mx:columns
mx:AdvancedDataGridColumn headerText=Index dataField=Index 
width=120/
mx:AdvancedDataGridColumn headerText=Data dataField=Data/
mx:AdvancedDataGridColumn headerText=Note dataField=Note 
width=160/
/mx:columns
/mx:PrintAdvancedDataGrid
/mx:VBox

Main.mxml

...
private function openNewWindow():void{

var newWindow:Window = new Window;
//add a datagrid to the new window  
var client:AdvancedDataGrid = new AdvancedDataGrid;
client.dataProvider = Results; // Results is ArrayCollection
var col1:AdvancedDataGridColumn = new AdvancedDataGridColumn();
col1.dataField = Index;
col1.headerText = Index;
col1.width = 120;
var col2:AdvancedDataGridColumn = new AdvancedDataGridColumn();
col2.dataField = Data;
col2.headerText = Data;
var col3:AdvancedDataGridColumn = new AdvancedDataGridColumn();
col3.dataField = Note;
col3.headerText = Note;
col3.width = 160;
client.groupedColumns = [col1,col2,col3];   

var mygroup:GroupingCollection=new GroupingCollection();
mygroup.source = Results
var group:Grouping = new Grouping();
var gf:GroupingField = new GroupingField(Index);
gf.numeric = true;  
gf.groupingFunction = utils.groupFunction; // private function
gf.groupingObjectFunction = utils.groupObjFunction; // private function
group.fields = [gf];
mygroup.grouping = group;
mygroup.refresh();
client.dataProvider = mygroup;
client.validateNow();
client.displayItemsExpanded = true;
newWindow.addChild(client);


var btn2:Button = new Button();
btn2.label = Print;
btn2.addEventListener(MouseEvent.CLICK, 
function(evt:MouseEvent):void
{
  var printJob:FlexPrintJob = new FlexPrintJob();   
  if (printJob.start()) 
  {
var thePrintView:FormPrintView = new FormPrintView();
addChild(thePrintView);
thePrintView.width=printJob.pageWidth;
thePrintView.height=printJob.pageHeight;
thePrintView.myDataGrid.dataProvider = Results


if(!thePrintView.myDataGrid.validNextPage)
{
  printJob.addObject(thePrintView);
}
else
{
  printJob.addObject(thePrintView);
  while(true)
  {
thePrintView.myDataGrid.nextPage();
if(!thePrintView.myDataGrid.validNextPage) 
{
  printJob.addObject(thePrintView);
  break;
}
else
{
  printJob.addObject(thePrintView);   
}
  }
}
removeChild(thePrintView);
printJob.send();
  }
  else
Alert.show(Not connect to Printer, Message, Alert.OK, newWindow);   

});

newWindow.addChild(btn2);   
//show the new window
newWindow.open();
newWindow.activate();

}

Now I want print data is provide by AdvandcedDataGrid and I change code

thePrintView.myDataGrid.dataProvider = Results

- thePrintView.myDataGrid.dataProvider = client.dataProvider

But the code doesn't run. I run in debug mode and see:

client.dataProvider = (mx.collections.HierarchicalCollectionView) 
mx.collections.HierarchicalCollectionView (@493f281)  
thePrintView.myDataGrid.dataProvider = null. 

It print only first page of AdvancedDataGrid. I don't know why?
Any one can help me what is false?

Hai Anh





[flexcoders] Re: Create XML List by code

2009-04-10 Thread lehaianh1986
Thank all of you, now I see how to build each XML element that I want.

Hai Anh

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 First, just build XML then use e4x expressions to return the XMLList that
 you want.
 
  
 
 Create the equivalent string… does not mean static.  You can dynamically
 build your string that represents XML, using whatever run-time logic you
 need, the pass that string to  the top-level XML() function, which returns
 XML.
 
  
 
 Alternatively, you can instantiate an XML node root, then use the XML API to
 manipulate it:
 
 var sMyVar:String = attributevalue;
 
 var xml:XML = myroot;
 
 var xmlNewNode:XML;
 
 xmlNewNode = node attrName={sMyVar} ;
 
 xml.appendChild(xmlNewNode);
 
  
 
 etc. 
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of thomas parquier
 Sent: Friday, April 10, 2009 11:47 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Create XML List by code
 
  
 
 
 
 
 
 
 I think you can get an xml object from your xmllist and then use XML
 methods, most of them returns xmllist.
 
 
 thomas
 
 
 
 2009/4/10 lehaianh1986 lehaianh1986@ mailto:lehaianh1...@...
 yahoo.com
 
  
 
 No, I can't use static string. Depend on my data, I will use regexp to sort
 and classify items to some groups (like example I show). 
 I think it like a dynamic tree and can be add or edit, etc...
 
 So how do I do to create each element and add to XMLList, then add another
 element to become children of the previous element?
 
 
 
 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
 Alex Harui aharui@ wrote:
 
  Create the equivalent string, then pass that into the constructor of
 XMLList
  
  Alex Harui
  Flex SDK Developer
 
  Adobe Systems Inc.http://www.adobe. http://www.adobe.com/ com/
 
 
  Blog: http://blogs. http://blogs.adobe.com/aharui adobe.com/aharui
  
  From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
 [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com]
 On Behalf Of lehaianh1986
  Sent: Thursday, April 09, 2009 2:33 AM
  To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com
  Subject: [flexcoders] Create XML List by code
  
  
  
  
  
  Hi all,
  
  I have XMLList like:
  
  mx:XMLList id=treeData
  node label=Mail Box
  node label=Inbox
  node label=Marketing/
  node label=Product Management/
  node label=Personal/
  /node
  node label=Outbox
  node label=Professional/
  node label=Personal/
  /node
  node label=Spam/
  node label=Sent/
  /node
  /mx:XMLList
  
  But I want to create XML List by code, so how do I do?
 
 
 
 
 
 
 
 -- 
 http://www.web- http://www.web-attitude.fr/ attitude.fr/
 msn : thomas.parquier@ mailto:thomas.parqu...@...
 web-attitude.fr
 softphone : sip:webattitude@ mailto:sip%3awebattit...@... ekiga.net
 téléphone portable : +33601 822 056





[flexcoders] Create XML List by code

2009-04-09 Thread lehaianh1986
Hi all,

I have XMLList like: 

mx:XMLList id=treeData
node label=Mail Box
node label=Inbox
node label=Marketing/
node label=Product Management/
node label=Personal/
/node
node label=Outbox
node label=Professional/
node label=Personal/
/node
node label=Spam/
node label=Sent/
/node
/mx:XMLList

But I want to create XML List by code, so how do I do?



[flexcoders] Re: Create XML List by code

2009-04-09 Thread lehaianh1986
No, I can't use static string. Depend on my data, I will use regexp to sort and 
classify items to some groups (like example I show). 
I think it like a dynamic tree and can be add or edit, etc...

So how do I do to create each element and add to XMLList, then add another 
element to become children of the previous element?

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Create the equivalent string, then pass that into the constructor of XMLList
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of lehaianh1986
 Sent: Thursday, April 09, 2009 2:33 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Create XML List by code
 
 
 
 
 
 Hi all,
 
 I have XMLList like:
 
 mx:XMLList id=treeData
 node label=Mail Box
 node label=Inbox
 node label=Marketing/
 node label=Product Management/
 node label=Personal/
 /node
 node label=Outbox
 node label=Professional/
 node label=Personal/
 /node
 node label=Spam/
 node label=Sent/
 /node
 /mx:XMLList
 
 But I want to create XML List by code, so how do I do?





[flexcoders] Re: Alert Control help

2009-04-08 Thread lehaianh1986
Thank Carlos

I use Title window and have result I expect. Here is my code

private var tw:TitleWindow = new TitleWindow(); 
private function Load():void
{
tw.title = Wait to update...;
mx.managers.PopUpManager.addPopUp(tw,this,true);
PopUpManager.centerPopUp(tw);
...
}
// then call remove when finish work
private function handleWorkDone(event:ResultEvent):void
{
PopUpManager.removePopUp(tw);
...
}

--- In flexcoders@yahoogroups.com, carloscarvalhar carloscarval...@... 
wrote:

 i think you need more Popup than Alert...
 
 you can add childs to your popup, take a look at this example:
 http://blog.flexexamples.com/2007/08/06/creating-custom-pop-up-windows-with-the-popupmanager-class/
 
 reference:
 http://livedocs.adobe.com/flex/3/langref/mx/managers/PopUpManager.html
 
 bye
 Carlos





[flexcoders] Alert Control help

2009-04-07 Thread lehaianh1986
Hi every one. I need your help. I create an Alert like Wait to update... I 
show it for user when I do some work from inside. After I finish it, I want 
remove an Alert by code.

I search and see some guide. Here is my code follow it

private var msg:Alert = new Alert;
private function Load():void
{
  msg = Alert.show(Wait to update...);
  ...
}
// then call remove when finish work
private function handleWorkDone(event:ResultEvent):void
{
  msg.deletePopUp();
  ...
}

But it is error in msg.deletePopUp();

How do I do in this case? Or if I don't use Alert message, what the component I 
can use in order to have the same function.



[flexcoders] Re: AdvancedDatagrid

2009-03-31 Thread lehaianh1986
Thank Tracy and Tim, your code is great. I have seen what I want. Thank very 
much.

--- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote:

 
 event.itemRenderer.data
 
 -TH
 
 --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@
 wrote:
 
  I use the line to test. It show the row index in advanceddatagrid that
 I want to select.
  What I need is data of object in each row I select. But how to give
 it?
 
  --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote:
  
   What are you trying to do with the line?:
  
   AdvancedDataGrid(event.currentTarget).selectedIndex =
 event.rowIndex;
  
  
  
   As it is is sets the selectedIndex to itself. rowIndex is the
   selectedIndex.
  
  
  
   Tracy Spratt,
  
   Lariat Services, development services available
  
   _
  
   From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com]
 On
   Behalf Of lehaianh1986
   Sent: Monday, March 30, 2009 10:29 PM
   To: flexcoders@yahoogroups.com
   Subject: [flexcoders] Re: AdvancedDatagrid
  
  
  
   Yeah I see. Thank you very much. I still have small question
   To give index of row I use
   AdvancedDataGrid(event.currentTarget).selectedIndex =
 event.rowIndex;
  
   But to give data of it, how do I do?
  
   --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
 ups.com,
   Tim Hoff TimHoff@ wrote:
   
   
Missed the return void.
   
private function myEventHandler( event:ListEvent ):void
{
// do something
}
   
-TH
   
--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
 ups.com,
   Tim Hoff TimHoff@ wrote:


 Just a syntax problem. Should be like this:

 var client:AdvancedDataGrid = new AdvancedDataGrid;
 client.dataProvider = ArrayResults;
 client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler
 );

 private function myEventHandler( event:ListEvent )
 {
 // do something
 }

 -TH

 Also, I'd suggest that you use an ArrayCollection instead of an
 array;
 if you want to do any data manipulation.

 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
   ups.com, lehaianh1986 lehaianh1986@
 wrote:
 
  Hi every body. I have a AdvancedDatagird and dataprovider from
 Array
 Collection. How to listen an event when I click to each row? I
 want
use
 an event when I click left mouse, right mouse, double
 click,...etc
 
  My code is here but it not run
 
  var client:AdvancedDataGrid = new AdvancedDataGrid;
  client.dataProvider = ArrayResults;
 

   
 client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\
 \
\
 oid
  {
  ...
  });
 

   
  
 





[flexcoders] AdvancedDatagrid

2009-03-30 Thread lehaianh1986
Hi every body. I have a AdvancedDatagird and dataprovider from Array 
Collection. How to listen an event when I click to each row? I want use an 
event when I click left mouse, right mouse, double click,...etc

My code is here but it not run

var client:AdvancedDataGrid = new AdvancedDataGrid;
client.dataProvider = ArrayResults;
client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):void
{
...
});



[flexcoders] Re: AdvancedDatagrid

2009-03-30 Thread lehaianh1986
Yeah I see. Thank you very much. I still have small question
To give index of row I use 
AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex;

But to give data of it, how do I do?

--- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote:

 
 Missed the return void.
 
 private function myEventHandler( event:ListEvent ):void
 {
 // do something
 }
 
 -TH
 
 --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote:
 
 
  Just a syntax problem. Should be like this:
 
  var client:AdvancedDataGrid = new AdvancedDataGrid;
  client.dataProvider = ArrayResults;
  client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler );
 
  private function myEventHandler( event:ListEvent )
  {
  // do something
  }
 
  -TH
 
  Also, I'd suggest that you use an ArrayCollection instead of an array;
  if you want to do any data manipulation.
 
  --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@
  wrote:
  
   Hi every body. I have a AdvancedDatagird and dataprovider from Array
  Collection. How to listen an event when I click to each row? I want
 use
  an event when I click left mouse, right mouse, double click,...etc
  
   My code is here but it not run
  
   var client:AdvancedDataGrid = new AdvancedDataGrid;
   client.dataProvider = ArrayResults;
  
 
 client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\
 \
  oid
   {
   ...
   });
  
 





[flexcoders] Re: AdvancedDatagrid

2009-03-30 Thread lehaianh1986
I use the line to test. It show the row index in advanceddatagrid that I want 
to select.
What I need is data of object in each row I select. But how to give it?
 
--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 What are you trying to do with the line?:
 
 AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex;
 
  
 
 As it is is sets the selectedIndex to itself.  rowIndex is the
 selectedIndex.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of lehaianh1986
 Sent: Monday, March 30, 2009 10:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: AdvancedDatagrid
 
  
 
 Yeah I see. Thank you very much. I still have small question
 To give index of row I use 
 AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex;
 
 But to give data of it, how do I do?
 
 --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
 Tim Hoff TimHoff@ wrote:
 
  
  Missed the return void.
  
  private function myEventHandler( event:ListEvent ):void
  {
  // do something
  }
  
  -TH
  
  --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
 Tim Hoff TimHoff@ wrote:
  
  
   Just a syntax problem. Should be like this:
  
   var client:AdvancedDataGrid = new AdvancedDataGrid;
   client.dataProvider = ArrayResults;
   client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler );
  
   private function myEventHandler( event:ListEvent )
   {
   // do something
   }
  
   -TH
  
   Also, I'd suggest that you use an ArrayCollection instead of an array;
   if you want to do any data manipulation.
  
   --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com
 ups.com, lehaianh1986 lehaianh1986@
   wrote:
   
Hi every body. I have a AdvancedDatagird and dataprovider from Array
   Collection. How to listen an event when I click to each row? I want
  use
   an event when I click left mouse, right mouse, double click,...etc
   
My code is here but it not run
   
var client:AdvancedDataGrid = new AdvancedDataGrid;
client.dataProvider = ArrayResults;
   
  
  client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\
  \
   oid
{
...
});
   
  
 





Re: Fwd: [flexcoders] Tree View Issue

2009-03-25 Thread lehaianh1986
Yeah, the code is great. Thank Pravin very much.

--- In flexcoders@yahoogroups.com, p...@... Uttarwar pravinuttar...@... 
wrote:

 Hi,
 
 Just add these lines inside showtree function.
 
 for (i = 0; i  tree.dataProvider.length; i ++){
 tree.expandChildrenOf(tree.dataProvider[i], true)
 }
 
 Hope this helps...
 
 Regards,
 Pravin Uttarwar
 
 
 -- Forwarded message --
 From: lehaianh1986 lehaianh1...@...
 Date: 2009/3/25
 Subject: [flexcoders] Tree View Issue
 To: flexcoders@yahoogroups.com
 
 
   I use mx:Tree to view my data in XMLList. I want to show Tree in default
 with expand all item. I use method tree.expandItem() but it does not run.
 Here is my code
 
 mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=vertical
 applicationComplete=init()
 mx:Script
 ![CDATA[
 private function init():void{
 callLater(showtree);
 }
 private function showtree():void{
 tree.expandItem(treeData, true, true);
 }
 ]]
 /mx:Script
 mx:XMLList id=treeData
 node label=One
 node label=1.1 /
 node label=1.2 /
 node label=1.3 /
 node label=1.4/
 node label=1.5/
 /node
 node label=Two
 node label=2.1/
 node label=2.2/
 /node
 /mx:XMLList
 mx:Tree id=tree
 dataProvider={treeData}
 showRoot=false
 labelField=@label
 width=300/
 
 /mx:WindowedApplication
 
 Anyone can show me where is false?





[flexcoders] Re: How to add more context menu???

2009-03-24 Thread lehaianh1986
Thank Steve very much. I find out the link but I don't know how to follow it. 
Now I can add more context menu :) 

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 Is there any reason you can't use the workaround they suggest in Jira?
 
 Main Application:
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=init() xmlns:custom=*
  custom:myTextArea/
 /mx:Application
 
 
 myTextArea.as:
 package
 {
  import flash.events.ContextMenuEvent;
  import flash.text.TextField;
  import flash.ui.ContextMenu;
  import flash.ui.ContextMenuItem;
  import mx.controls.Alert;
  import mx.controls.TextArea;
 
  public class myTextArea extends TextArea
  {
  private var cm:ContextMenu;
  private var cmi:ContextMenuItem;
 
  public function myTextArea()
  {
  super();
  callLater(addCTMenu);
  }
 
  private function addCTMenu():void
  {
  cmi = new ContextMenuItem(View item..., true);
  cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
 contextMenuItem_menuItemSelect);
  cm = new ContextMenu();
  cm.hideBuiltInItems();
  cm.customItems = [cmi];
  (textField as TextField).contextMenu = cm;
  }
 
  private function
 contextMenuItem_menuItemSelect(evt:ContextMenuEvent):void
  {
  Alert.show(You just used a custom context menu on a
 TextArea.);
  }
  }
 }
 
 NB: The reason I used callLater was that the textField was not
 instanciated when the textArea was first created.
 
 
 HTH.
 
 
 Steve




[flexcoders] Tree View Issue

2009-03-24 Thread lehaianh1986
I use mx:Tree to view my data in XMLList. I want to show Tree in default with 
expand all item. I use method tree.expandItem() but it does not run.
Here is my code

mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
applicationComplete=init()
mx:Script
![CDATA[
   private function init():void{
 callLater(showtree);
   }
   private function showtree():void{
 tree.expandItem(treeData, true, true);
   }
]]
/mx:Script
mx:XMLList id=treeData  
node label=One
   node label=1.1 /
   node label=1.2 /
   node label=1.3 /
   node label=1.4/
   node label=1.5/
/node 
node label=Two
   node label=2.1/
   node label=2.2/
/node
/mx:XMLList
mx:Tree id=tree
dataProvider={treeData}
showRoot=false
labelField=@label
width=300/
  
/mx:WindowedApplication

Anyone can show me where is false?



[flexcoders] How to add more context menu???

2009-03-23 Thread lehaianh1986
Hi every body. I want to add my function when I click on word in text area 
(like copy, paste, ..etc). I follow the guide in 
http://www.adobe.com/devnet/air/flex/quickstart/adding_menus.html
But what i want is add my function to default context menu, not instead of 
remove default context menu.
Can anyone help me? Thank in advanced!!!



[flexcoders] Re: How to add more context menu???

2009-03-23 Thread lehaianh1986
Thank kenneth. I want to add context menu in text area. Here is the code 
?xml version=1.0 encoding=utf-8?
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; 
creationComplete=init() 

mx:Script
![CDATA[
import mx.controls.Alert;

[Bindable]
private var cm:ContextMenu;

private var alert:Alert;

private function init():void {
var cmi:ContextMenuItem = new ContextMenuItem(View item..., 
true);
cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, 
contextMenuItem_menuItemSelect);

cm = new ContextMenu();
cm.hideBuiltInItems();
cm.customItems = [cmi];

}

private function 
contextMenuItem_menuItemSelect(evt:ContextMenuEvent):void {
alert = Alert.show(You just used a custom context menu on a 
TextArea.);
}
]]
/mx:Script

mx:TextArea contextMenu={cm} /

/mx:WindowedApplication

I search and see in http://bugs.adobe.com/jira/browse/SDK-17684

seem the bug is not fixed :(

I don't know how to correct it. Can anyone help me!!!

--- In flexcoders@yahoogroups.com, Kenneth Sutherland 
kenneth.sutherl...@... wrote:

 Try something like
 
 mx:Canvas
 
   contextMenu={getyourMenu()}
 
  
 
 /
 
  
 
 private function getyourMenu () : ContextMenu {
 
 var paste:ContextMenuItem = new ContextMenuItem(paste);
 
 paste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, pasteHandler);
 
  
 
 var cm:ContextMenu = new ContextMenu();
 
  cm.hideBuiltInItems();
 
  cm.customItems.push(paste);
 
 return cm;
 
 }





[flexcoders] Synonym Issue

2009-03-20 Thread lehaianh1986
I want to question anybody who know about synonym issue. In my AIR app, I have 
text area component to compose some document. I want to have synonym function 
in order to when I click any word in text area, the app show list of synonym 
word that I can replace this word by another word. I have searched in google 
but no result. Maybe someone in our forum know about the issue, and can show me 
a way that I can follow. Thank in advanced any help!!!



[flexcoders] Synonym Issue

2009-03-20 Thread lehaianh1986
I want to question anybody who know about synonym issue. In my AIR app, I have 
text area component to compose some document. I want to have synonym function 
in order to when I click any word in text area, the app show list of synonym 
word that I can replace this word by another word. I have searched in google 
but no result. Maybe someone in our forum know about the issue, and can show me 
a way that I can follow. Thank in advanced any help!!!



[flexcoders] Re: HTMLLoader Problem

2009-02-28 Thread lehaianh1986
I have tried IFrame but I meet problem. When I login to website that
include Recaptcha Authentication, I type password and pass through
authentication step. After that, when I search information in this
website, the connection is drop and I need to authenticate again. And
the loop don't stop. So how to solve the problem?



[flexcoders] HTMLLoader Problem

2009-02-27 Thread lehaianh1986
Hi all, I have a AIR desktop app that use to login to 1 website and
download data from it. I use HTMLLoader component to display this
website and authenticate before download data because this website
include Recaptcha Authentication.

Now, I want to embed it to my website but I know I can't use
HTMLLoader in Flash. What is the solution I can use in this case? 

Thank in advance any advice!

Hai Anh



[flexcoders] Re: why don't create AdvancedDataGrid in new window

2009-02-10 Thread lehaianh1986
The bug is here:
 var newWindow:NativeWindow = new NativeWindow(options);   

The solution is instead of create a new NativeWindow, I create a new
Window.



[flexcoders] PrintAdvancedDataGrid

2009-02-09 Thread lehaianh1986
I wonder that PrintAdvancedDataGrid have bug. I have an AIR app to
work with document file. The output is AdvancedDataGrid and I want to
print it.
I use code to work with AdvancedDataGrid follow link
http://livedocs.adobe.com/flex/3/html/help.html?content=printing_5.html#145939

When I debug my app by run only each code line, it can print my table
but not stable, sometimes ok and sometimes print nothing. When I run
normal, it always print white page. I check my printer and see the
flash object pending to print is very large ( 10MB) so I think seem
the app have no enough time to send object to printer.
Anyone meet the same problem? What do you think about it?

Thank in advance any comment!

Hai Anh



[flexcoders] why don't create AdvancedDataGrid in new window

2009-02-08 Thread lehaianh1986
I have a main window and want to create a new window to show result.
Result exist in the AdvancedDataGrid. I don't know although it run but
I can't see anything. Here is my code

import ...
var options:NativeWindowInitOptions = new NativeWindowInitOptions();

var newWindow:NativeWindow = new NativeWindow(options); 

var client:AdvancedDataGrid = new AdvancedDataGrid;
  client.dataProvider = DescriptionResults;

  var col1:AdvancedDataGridColumn = new AdvancedDataGridColumn();
  col1.dataField = abc;
  col1.headerText = abc abc;

  var col2:AdvancedDataGridColumn = new AdvancedDataGridColumn();
  col2.dataField = def;
  col2.headerText = def def;

  client.groupedColumns = [col1, col2];

  client.x = 200;
  client.y = 100;
  client.width = Capabilities.screenResolutionX - 600;
  client.height = Capabilities.screenResolutionY - 200;
  client.validateNow();

  newWindow.stage.addChild(client);
  //show the new window
  newWindow.activate();

In debug mode I am sure that client.dataProvider and
client.groupedColumns still have value. 

Anyone can help me why the AdvancedDataGrid don't visible ? 

Hai Anh



[flexcoders] Re: Visible issue

2009-01-30 Thread lehaianh1986
 I've got something like
 creationCompleteHandler:
   var sysTrayIcon:SystemTrayIcon =
   NativeApplication.nativeApplication.icon as 
 SystemTrayIcon;
   sysTrayIcon.addEventListener(MouseEvent.CLICK,undock);
 
 undock:
   if (!stage.nativeWindow.visible){
   stage.nativeWindow.visible = true;
   stage.nativeWindow.activate();
   
   }else{
   stage.nativeWindow.visible=false;   
   }
 and it works here to show/hide the main application window.
 
 Where are you assigning the event handler, and why are you using the
funny 
 inline function syntax ? 
 If you stop it in the debugger, what is the bit that is actually null ?
 
 -- 
 Tom Chiverton

Thank Tom very much. In my country, few days ago is Lunar new year so
I don't work and reply :( 
Your solution is very good if the event handler in MXML file. I
correct my code follow you and have good result.
But I have only special case, the event handler in AS class

My code in main.mxml 

?xml version=1.0 encoding=utf-8?
mx:WindowedApplication
  mx:Script
  ...
  /mx:Script

!--Call AS class --
  com:SysTrayApp

  /com:SysTrayApp
/mx:WindowedApplication

and code in systrayapp.as file

package com
{
  import flash.desktop.DockIcon;
  import flash.desktop.NativeApplication;
  import flash.desktop.SystemTrayIcon;
  import flash.display.Loader;
  
public class SysTrayApp extends Sprite
  {
  public function SysTrayApp():void{
NativeApplication.nativeApplication.autoExit = false;
var icon:Loader = new Loader();
var iconMenu:NativeMenu = new NativeMenu();
var showCommand:NativeMenuItem = iconMenu.addItem(new
NativeMenuItem(Show));
showCommand.addEventListener(Event.SELECT,
function(event:Event):void {
   
NativeApplication.nativeApplication.activeWindow.stage.nativeWindow.visible
= true; 
});

}

So the error display when I click show menuitem in taskbar
TypeError: Error #1009: Cannot access a property or method of a null
object reference.

In debug mode the error at line
NativeApplication.nativeApplication.activeWindow.stage.nativeWindow.visible
= true; 

how to solve it?



[flexcoders] Re: Call external App from AIR

2009-01-22 Thread lehaianh1986
A great solution that I find is FluorineFx Aperture Framework. Here is
link http://aperture.fluorinefx.com/ It allow us to write extension
library to control more things, then now I can control word automation.



[flexcoders] Visible issue

2009-01-22 Thread lehaianh1986
Hi everyone! I have problem with my AIR app. I build an AIR app with
Flex builder 3. I create a taskbar icon for my app. When I start app,
the icon visible in system taskbar. So what I want is that I minimize
the app, it is hidden until someone click to icon.

I write code to create taskbar icon object in AS3 class and in MXML
file, I call it. Here is my code in systrayap.as

var systray:SystemTrayIcon = NativeApplication.nativeApplication.icon;
systray.addEventListener(ScreenMouseEvent.CLICK,function(event:Event):void{
  stage.nativeWindow.visible = true;
});

but it error. The message is TypeError: Error #1009: Cannot access a
property or method of a null object reference.

How to solve it? I don't know how to invisible the app when I click
minimize button. 

Can anyone help me? Thank in advance!

Hai Anh



[flexcoders] Re: Call external App from AIR

2009-01-07 Thread lehaianh1986
Thank all of you!!!

I will try these solutions. In some next days, I will post questions.



[flexcoders] Re: Call external App from AIR

2009-01-06 Thread lehaianh1986
I want to build an App which have function : open MS word document,
work with it, save it to plain text, then upload text file to server.
So I choice AIR because I see it have same functions.

 The command proxy allows you to send calls to external code to do
 things you can't do in AIR via sockets. Effectively, it is a web
 server on the desktop. It will work, but you don't get the nice AIR
 experience because the command proxy isn't an AIR app, and AIR apps
 can't execute programs on the desktop.
 
So can command proxy execute something I talk above?

 Well how is your prototype working now? I assume you are using Flex
 and running the flex app in IE, and calling javascript in IE which in
 turn calls the Word ActiveX object to do stuff and return to you. Just
 distribute the .htm and .swf. But it will only work on Windows, and
 only if Office is installed.
 
Yes, now I am working with Flex builder 3. If I create desktop
app(AIR), I can't call ActiveXObject as you know. But if I create web
app, and run in IE (I accept the app only run in Windows, with Office
is installed) can the app has upload ability?




[flexcoders] Call external App from AIR

2009-01-05 Thread lehaianh1986
Hi every body. I'm a newbie in Flex and AIR. I have new project that
create an AIR app. It open MS word document, edit and save as to plain
text. So my idea is use Actionscript in AIR app to call javascript in
mx:html, then java code call an ActiveXObject to launch MS Word app. I
use Flexbuilder 3 to create AIR app. In html file, I can call an
ActiveXObject run ok, but in AIR app I can't call it. The message is
ReferenceError: Can't find variable: ActiveXObject

So why I'm wrong? How do I do to execute my idea?



[flexcoders] Re: Call external App from AIR

2009-01-05 Thread lehaianh1986
Thank Sam! I build an client AIR app. I find that all the way which I
have tried is can't execute. I have received another guide about
command proxy so I will search about it. 

How about just distributing that SWF and the HTML file instead of
using AIR? can you give me some information about this solution?

AIR's E4X support to work with the XML file the file I want to read
is *.doc therefore can E4X do it?