[flexcoders] Menubar source-- only XML? Urgent

2005-04-22 Thread nithya karthik



hai!
 I want to know if only a XML file can be a source for a menubar.. Can a list of array be the source for a menu bar like :
mx:MenuBar mx:dataProvider mx:Array mx:StringAlabama/mx:String mx:StringAlaska/mx:String mx:StringArkansas/mx:String /mx:Array /mx:dataProvider/mx:MenuBar
The above code doesnt work.. 

regrds,
nithya  
Yahoo! Messenger - Communicate instantly..."Ping" your friends 
today! Download Messenger Now







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Webservice result

2005-04-22 Thread Dzafer










Sorry , small correction : function
myResultCallback(event)













From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Dzafer
Sent: Friday, April 22, 2005 12:43
PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
Webservice result





Hi there,



Here is the code :



var childHandlerCall:Object;

childHandlerCall = myService.function1.send()


childHandlerCall.marker =
myF1;



childHandlerCall = myService.function2.send()


childHandlerCall.marker =
myF2;







function myResultCallback()
{
 var myCall = event.call;





 if (myCall.marker ==  myF1) {

}



 if (myCall.marker ==  myF2) {

}







}

Best regards,

Dzafer









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Fransjo Leihitu
Sent: Friday, April 22, 2005 12:33
PM
To: flex coders
Subject: [flexcoders] Webservice
result







ok, consider this code: 
 





mx:Script

function myResultCallback()
{

}

/mx:Script





 mx:WebService id=myService
wsdl=http://www.mydomein.com/script?wsdl
fault=alert(event.fault.faultstring)
result=myResultCallback()
 
 mx:operation
name=function1

mx:request
inputmy input/input

/mx:request
 /mx:operation
 
 mx:operation
name=function2

mx:request
inputmy input1/input

/mx:request
 /mx:operation

 
 /mx:WebService
 
 
Everytime I do a send() and the result is done, then everytime the function
myResultCallback() is called.
But how do I know from wich operation the result is?





So when I do myService.function1.send() and the server responds back,
the function myResultCallback() is called, how do I know the result was meant
for myService.function1 ?









__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 









Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












RE: [flexcoders] Webservice result

2005-04-22 Thread CHANSOU Patrick ROSI/SICOR





You 
should find anything you want in the event object


function myResultCallback(event)
{
 if (event.operation.name == 
"function1")
...
}

  
  
  De: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] De la part de Fransjo 
  LeihituEnvoyé: vendredi 22 avril 2005 
  12:33À: flex codersObjet: [flexcoders] 
  Webservice result
  
  ok, consider this code:  
  mx:Scriptfunction 
  myResultCallback(){}/mx:Script
   mx:WebService id="myService" wsdl="http://www.mydomein.com/script?wsdl" 
  fault="alert(event.fault.faultstring)" 
  result="myResultCallback()" 
   mx:operation 
  name="function1" 
  mx:requestinputmy 
  input/input 
  /mx:request 
  /mx:operation 
   mx:operation 
  name="function2" 
  mx:requestinputmy 
  input1/input 
  /mx:request 
  /mx:operation 

  /mx:WebService  
  Everytime I do a send() and the result is done, then everytime the 
  function myResultCallback() is called.But how do I know from wich 
  operation the result is?
  So when I do myService.function1.send() and the server responds back, the 
  function myResultCallback() is called, how do I know the result was meant for 
  myService.function1 ?
  
  __Do You 
  Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around 
  http://mail.yahoo.com 







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Webservice result

2005-04-22 Thread Dirk Eismann

Another possibility would be to assign a different result handler for each 
operation. you can do this declaratively via MXML or by using ActionScript.


!-- via MXML --
mx:operation name=function1 result=function1Result(event)
  mx:request
inputmy input/input
  /mx:request
/mx:operation

mx:operation name=function1 result=function2Result(event)
  mx:request
inputmy input/input
  /mx:request
/mx:operation


// via ActionScript
import mx.services.PendingCall

var pc:PendingCall = myService.function1.send();
pc.onResult = mx.utils.Delegate.create(this, function1Result)

Dirk.


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] using mx.graphics.Rect

2005-04-22 Thread Duccio Del Ministro

I'm trying to use the class mx.graphics.Rect to design
a rectangle inside a component that extends from
mx.controls.Image. When i declare a private varible i
get a compilation warning: The member, myBorder,
hides a member in ancestor class, 'mx.core.View'..
Why? How can i draw a rectangle inside a component
using Rect class? Is there an example?
Thanks
Duccio Del Ministro 



___ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica… Scaricalo ora! 
http://it.messenger.yahoo.it


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] using mx.graphics.Rect

2005-04-22 Thread Dirk Eismann

Hi,

have you tried using another identifier name instead of myBorder? The warning 
you're getting simpy tells you that the class you're subclassing 
(mx.controls.Image) already defines a variable myBorder.

Dirk.

 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 Behalf Of Duccio Del Ministro
 Sent: Friday, April 22, 2005 1:13 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] using mx.graphics.Rect
 
 
 
 I'm trying to use the class mx.graphics.Rect to design
 a rectangle inside a component that extends from
 mx.controls.Image. When i declare a private varible i
 get a compilation warning: The member, myBorder,
 hides a member in ancestor class, 'mx.core.View'..
 Why? How can i draw a rectangle inside a component
 using Rect class? Is there an example?
 Thanks
 Duccio Del Ministro 
 
 
   
 ___ 
 Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, 
 Avatar, Webcam, Giochi, Rubrica... Scaricalo ora! 
 http://it.messenger.yahoo.it
 
 
  
 Yahoo! Groups Links
 
 
 
  
 
 
 
 


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] using mx.graphics.Rect

2005-04-22 Thread Duccio Del Ministro

Thanks Dirk, i think i'll try with createClassObject
method.
Best Regards
Duccio Del Ministro
--- Dirk Eismann [EMAIL PROTECTED]
wrote:

-
Hi,

have you tried using another identifier name instead
of myBorder? The warning you're getting simpy tells
you that the class you're subclassing
(mx.controls.Image) already defines a variable
myBorder.

Dirk.

 -Original Message-
 From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED]
 Behalf Of Duccio Del Ministro
 Sent: Friday, April 22, 2005 1:13 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] using mx.graphics.Rect
 
 
 
 I'm trying to use the class mx.graphics.Rect to
design
 a rectangle inside a component that extends from
 mx.controls.Image. When i declare a private varible
i
 get a compilation warning: The member, myBorder,
 hides a member in ancestor class, 'mx.core.View'..
 Why? How can i draw a rectangle inside a component
 using Rect class? Is there an example?
 Thanks
 Duccio Del Ministro 
 
 
 
 ___ 
 Nuovo Yahoo! Messenger: E' molto più divertente:
Audibles, 
 Avatar, Webcam, Giochi, Rubrica... Scaricalo ora! 
 http://it.messenger.yahoo.it
 
 
  
 Yahoo! Groups Links
 
 
 
  
 
 
 
 


-
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
 
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
   Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.




___ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica… Scaricalo ora! 
http://it.messenger.yahoo.it


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] string to xml - datagrid

2005-04-22 Thread Fransjo Leihitu



well, the thing is, I'm using NuSoap PHP Toolkit on my serverside php to to generate my wsdl and ofcourse register my functions. But I've never managed to get an working array as an result type back to Flex, so I returned a string. 

But yesterday I finally got the NoSoap working to return an array such as

array[0]["element"]="blt"
array[0]["element1"]="blt"


array[1]["element"]="blt"
array[1]["element1"]="blt"

And now I don't have to convert a string to xml anymore and I can bind the result to the datagrid.Shlomi Cohen [EMAIL PROTECTED] wrote:


Hi 

I think you are missing the point of automated conversions of flex. 
you already have your soap method that can return objects - why return a string and then go to objects again.
just return objects (in a certain structure) - flex will do the rest.

believe me i struggled for 3 days to get this result and not get into objects-XML--objects conversions. ( i know flex do it , so do u need to :-)


for example 

class Ticket{
 int ticketID;
 String label;
}

class TicketContainer{

 Ticket[] tickets;
 
}

The WebService is something like this.

public TicketContainer someWSmethod(){



 Ticket t = new Ticket(1,"label1");

 Ticket t1 = new Ticket(2,"label2");

 Ticket t2 = new Ticket(3,"label3");

 TicketContainer cont = new TicketContainer(); // you must have a root node (top level) objectthat contains array of childs.
 cont.addTicket(t);
 cont.addTicket(t1);
 cont.addTicket(t2);


 return cont; 
}



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Erik WestraSent: Friday, April 22, 2005 10:46 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] string to xml - datagrid
Then it would bevar xml:XML = new XML();xml.ignoreWhite = true;xml.parseXML(str);Greetz Erik-Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] OnBehalf Of Tracy SprattSent: donderdag 21 april 2005 18:34To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] string to xml - datagridIt is "better" to use the createXML() utility function because it tellsthe parser to ignore whitespace. If you have carriage returns in yourxml string and do not tell the compiler to ignore whitespace, the xmlwill not work well with the tree control.Tracy-Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] OnBehalf Of Erik WestraSent: Wednesday, April 20, 2005 7:51 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] string to xml - datagridTo create XML from
 a string u can just do this:var xml:XML = new XML(str);Then u can use an xmlToObject coverter to convert the xml object to anobject wich consists of arrays and objects. I believe there is amacromedia utility available for this.Greetz Erik-Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] OnBehalf Of core_elementsSent: woensdag 20 april 2005 13:41To: flexcoders@yahoogroups.comSubject: [flexcoders] string to xml - datagridHi I don't know if this is possible.I have an soap-function that returns a string. The content of thestring:ticketsticketticketID1/ticketID/ticketticketticketID2/ticketID/ticket/ticketsOf course this is just a string. Is it possible to convert the string toan xml object and then bind that object to a datagrid?I did
 found this :   var xmlStr:String;   xmlStr=ticketsService.getTickets.result;  var xml:XML;   xml=mx.utils.XMLUtil.createXML(xmlStr);but I don't know if this is the right way ... Yahoo! Groups LinksYahoo! Groups LinksYahoo! Groups Links__This email has been
 scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email This email has been scanned by the MessageLabs Email Security System.For more information please visit http://www.messagelabs.com/email Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com 







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] ActionScript Components

2005-04-22 Thread Stephen Gilson
Title: Message





Excuse me for the late reply, but you are coming across a 
known limitation when creating an MXML component that uses a container as its 
base tag. If you define the mxml component to contain a child, you cannot add a 
child to it when you use the tag. In order to be able to add children to 
panel.mxml, you must not define any children within the definition. Here's the 
doc on it:

http://livedocs.macromedia.com/flex/15/flex_docs_en/0455.htm 


Stephen


From: Erik Westra [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 07, 2005 11:03 AMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] ActionScript 
Components

Well, flex is whining about subclassing mxml components 
wich have children with other mxml components containing 
children:

The component 
mx.controls.Button may not be used as a child of erik.extend.panel because the 
erik.extend.panel is a container with internal children.
[panel.mxml]
mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml"mx:Button 
label="crazy" //mx:Panel

[panelSub.mxml]
panel xmlns:mx="http://www.macromedia.com/2003/mxml" 
xmlns="erik.extend.*"mx:Button label="yellow" 
//panel

Greetz 
Erik




From: JesterXL [mailto:[EMAIL PROTECTED] 
Sent: donderdag 7 april 2005 16:48To: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] ActionScript 
Components

Can you be more specific? I don't have any 
problems sub-classes my MXML components.

- Original Message - 
From: Erik Westra 

To: flexcoders@yahoogroups.com 
Sent: Thursday, April 07, 2005 5:42 AM
Subject: RE: [flexcoders] ActionScript Components

A good reason to make pure actionscript components is that 
they can be subclassed. 

When u create an mxml component, u cant extends a custom 
mxml component wich has children.

Greetz Erik


From: Gordon Smith 
[mailto:[EMAIL PROTECTED] Sent: donderdag 7 april 2005 
9:04To: 'flexcoders@yahoogroups.com'Subject: 
RE: [flexcoders] ActionScript Components

It is 
essentially a matter of preference. There are no performance differences that I 
know of.

I 
generally recommend creatingcomponents in MXML because it makes several 
things easier, such as creating internal subcomponents, laying them out, and 
assigning event handlers to them.For example, if I was creating a 
LoginPanel, I would certainly do it in MXML.

Can 
you explain what is "a bit messy" about MXML components?

- 
Gordon

  







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










[flexcoders] Re: DataGrid displaying remote object data

2005-04-22 Thread dhiren9


Thanks Matt. I'm displaying information received dynamically, so I 
cannot specify the columns before hand. I could parse through the 
data I receive and set them on the fly. Is this possible in 
ActionScript? Any examples?

Thanks.

--- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:
 The column ordering by default is unfortunately often backwards 
due to how
 ActionScript enumerates properties.  You'll need to specify the 
columns
 explicitly if order is important to you.
 
  
 
 Matt
 
  
 
   _  
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 21, 2005 5:42 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] DataGrid displaying remote object data
 
  
 
 
 I have a DataGrid with an object set as the data provider:
 
 mx:DataGrid id=dg3  dataProvider={my_list.dataValues}/
 
 dataValues is a 2 dimensional array in the my_list variable. The 
 my_list object is populated via a remote object call. Everything 
works 
 ok and I get the data back in my grid. However, the data is 
displayed 
 with the last column first. eg. If my data comes back with 5 
columns 
 and 5 rows, the grid diplays it as follows:
 
 Col 4   Col 3   Col 2   Col 1   Col 0
 
 instead of
 
 Col 1   Col 2   Col 3   Col 3   Col 4
 
 Am I missing something? Thanks.
 
 
 
 
 
 
   _  
 
 Yahoo! Groups Links
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/ 
   
 * To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
subject=Unsubscribe 
   
 * Your use of Yahoo! Groups is subject to the Yahoo!
 http://docs.yahoo.com/info/terms/  Terms of Service.





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] Re: any ideas about flex client side caching?

2005-04-22 Thread Johan Lopes



Hi,

Zhu FengCan I delete files by using action script APIs? When I use the shared
object, I don't want the .sol files stay in disk persistently, although
we can clear the context of the file.

You could use onUnload() see example code below [1] or use
onBeforeUnload() events in IE (not sure about the other browsers
FireFox/Mozilla/Opera/Safari etc) to trap the event triggered when the
browser is closing down and then call Flash [2]. When the close event
is detected in Flash you could physically delete the SharedObjects
from disk using the solution described in [3].

code
function onUnloadHandler(){
 if(self.VBArray){
 var e = self.event, s = self.screen;
 if(e.clientX + s.width  0  e.clientY + s.height  0 
typeof(window.onclose) == function)
 {
 window.onclose();
 };
 };
};

>

function onclose(){
 alert(The window has left the desktop);
};
/code

Zhu Feng3. When I close the browser, I want to capture this event
and clear the context of shared object (or remove the file if action
script can do this). Could AS capture this kind of event?

Basically: Macromedia's docs don't show us how to remove the physical
file from a user's drive, (although they say it's possible), but we can
combine two things we know already to figure it out. Firstly, when we
write a SO with no properties in its data child, no file is written.
Secondly when we delete a property from the data child and re-write the
SO the property is removed from the file on the disk also. So in order
to delete the actual file, one need only delete all the properties of
the data child. This is probably best done with a for...in loop. [3]

Source:
[1] http://chattyfig.figleaf.com/mailman/htdig/flashcoders/2002-May/033799.html
[2] http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_15683#jt
[3] http://www.actionscript.org/tutorials/intermediate/SharedObjects/index3.shtml 
HTH,

/JohanOn 4/22/05, Feng Zhu [EMAIL PROTECTED] wrote:
















Thank you very much. This
will be helpful.

And, What about the 2, 3,
4 questions, any ideas?





Best Regards!

Zhu Feng



-Original
Message-
From: 
flexcoders@yahoogroups.com
[mailto:
flexcoders@yahoogroups.com]
On Behalf Of Johan Lopes
Sent: 2005
421
 20:57
To: 
flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: any
ideas about flex client side caching?



Zhu
Feng 1. The shared object stored in local disk is plain; we can see the
.sol file context easily by text editor

If you're saving sensitive data then use an encryption scheme to scramble your
data before saving them as SharedObjects.

There are many implementations being ported to AS2, just google it and you'll
see.

Try this one: http://www.meychi.com/archive/31.php

HTH,

Johan



On 4/21/05, Feng Zhu 
[EMAIL PROTECTED] wrote:

Hi,
Sorry to disturb you again.
The following things for shared object/client side caching puzzle me:
1. The shared object stored in local disk is plain; we can see the .sol file
context easily by text editor. Is there anything security for shared object or
is there any method to cache data shared by several applications in memory not
in hard disk?

2. Can I delete files by using action script APIs? When I use the shared object,
I don't want the .sol files stay in disk persistently, although we can clear
the context of the file.

3. When I close the browser, I want to capture this event and clear the context
of shared object (or remove the file if action script can do this). Could AS
capture this kind of event?

Best Regards!
Zhu Feng

Best Regards!
Zhu Feng

-Original Message-
From: flexcoders@yahoogroups.com
[mailto: flexcoders@yahoogroups.com]
On Behalf Of Abdul Qabiz
Sent: 2005415 19:36
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: any ideas about flex client side caching? 

Hi,

You can allow all swfs from a domain to read/write to same SharedObject,

There is second parameter to SharedObject.getLocal(..,..) method. Read about
in docs.

var so = SharedObject.getLocal ('myCookie', /);

This way all swfs in same domain have access to myCookie SO...But remember
there name collision issues, so read the docs properly...

http://livedocs.macromedia.com/flex/15/flex_docs_en/1668.htm

-abdul

-Original Message-
From: flexcoders@yahoogroups.com
[mailto: flexcoders@yahoogroups.com]
Sent: Friday, April 15, 2005 1:54 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: any ideas about flex client side caching? 

HI,
I tried SharedObject. It is perfect. But I ocurs another problem. Only
the same swf can read the cache context.
For example:
I write a simple mxml file: test1.mxml:
mx:Script
![CDATA[ 
function save(){
var so=
SharedObject.getLocal('myCookie');
var str:String = text.text;
so.data.string = str;
var sucess:String =
so.flush(10);
alert(sucess); 
}
function ini(){
var so= SharedObject.getLocal(myCookie);
var str:String = so.data.string;
alert(str);
}
]]

and in text2.mxml:
function ini(){
var so= SharedObject.getLocal (myCookie);
var str:String 

[flexcoders] Re: TextArea help

2005-04-22 Thread AC


Thanks Matt 
The help is appreciated.

AC

--- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:
 Instead of using focusOut and focusIn I used keyDown and mouseUp and
that
 seemed to do the trick.  It may not be perfect all the time, I'd
imagine you
 can type fast enough and maybe confuse it, but this should get you
going.
 
  
 
 Matt
 
  
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 21, 2005 4:43 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: TextArea help
 
  
 
 
 Matt
 
 The Selection.getCartIndex() doesn't seem to work, I've tried to call
 it when I loose or gain focus within the textArea control. 
 Irrespective of where the cursor is within the text area the
 Selection.getCartIndex() seems to return 0 or -1; naturally there
 is text inside the text area.
 
 Do you have an instance where it's been used correctly, I been through
 the MM web documentation and have failed to get it to work.
 
 I include my test bed. Am I using it correctly?
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml
 http://www.macromedia.com/2003/mxml  
   mx:Script
   ![CDATA[
 
   private var nCurPos:Number = -2;
 
   private function getCurPos(event):Void
   {
 this.nCurPos = Selection.getCaretIndex();
   }
 
   private function myAddTextToTxtArea(event):Void
   {
 var sValue = event.target.selectedItem;
 
 var text:String = txaTop.text;
 //
 var start: String = text.substring(0, nCurPos);
 var end: String = text.substring(nCurPos);
 var whole: String = start + + sValue + + end;
 txaTop.text = whole;
   }
 
   function showCaretIndex():Void
   {
 this.lblX.text =.getCaretIndex() return Position
 +nCurPos.toString()+\n+this.txaTop.text;
   }
 
   ]]
   /mx:Script
 
   mx:HBox width=100% height=60%
 mx:Panel width=220 height=100%
   mx:List id=dgIF width=100% height=100%
 change=myAddTextToTxtArea(event);
 mx:dataProvider
   mx:Array
 mx:StringInternational/mx:String
 mx:StringJewel/mx:String
 mx:StringThief/mx:String
   /mx:Array
 /mx:dataProvider
   /mx:List
 /mx:Panel
 
 mx:Panel width=90% height=100%
   mx:TextArea id=txaTop
 focusIn=getCurPos(event);showCaretIndex();
 focusOut=getCurPos(event);showCaretIndex(); editable=true
 width=350 height=80% /
   mx:Label id=lblX width=100% color=#FF
 height=40/
   mx:Button label=Show Cart Position amp; Data
 click=showCaretIndex(); /
 /mx:Panel
   /mx:HBox
 
 /mx:Application
 
 Thanks you.
 
 
 --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:
  Check out the Selection.getCaretIndex() function maybe?  I haven't
tried
  this but you could probably do something like this:
  
   
  
  var text : String = myTA.text;
  
  var idx : Number = Selection.getCaretIndex();
  
  var start : String = text.substring(0, idx);
  
  var end : String = text.substring(idx);
  
  var whole : String = start + my new text + end;
  
  myTA.text = whole;
  
   
  
  Matt
  
   
  
_  
  
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, April 20, 2005 8:45 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] TextArea help
  
   
  
  
  Hello to all flex masters
  
  Can somebody tell me how to programmatically enter a piece of text
  into a specific position within a TextArea that already contains a
  block of text. 
  
  I have a TextArea containing a block of text. I am trying to insert
  additional text into an arbitrary position within the already existing
  block of text. I want to select the text insert position using the
  MOUSE cursor then click a button to add text to the previously
  selected position.
  
  A code example/snippet would be most helpful. 
  
  Thanks in advance
  
  
  
  
  
  
_  
  
  Yahoo! Groups Links
  
  *  To visit your group on the web, go to:
  http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/ 
  http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/  

  *  To unsubscribe from this group, send an email to:
  [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] 

  *  Your use of Yahoo! Groups is subject to the Yahoo!
  http://docs.yahoo.com/info/terms/
http://docs.yahoo.com/info/terms/ 
 Terms of Service.
 
 
 
 
 
 
   _  
 
 Yahoo! Groups Links
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 

[flexcoders] Re: Tomcat

2005-04-22 Thread reubenbrown13


Are you trying to access Tomcat through the default port as a
standalone (8080) or are you trying to use IIS/Apache to hit it?  Does
the samples/index.jsp file display correctly?  Which sample app are
you trying to hit?

Also, what version of Tomcat and Java VM are you using.  I have
successfully deployed Flex as described below in Tomcat 5.0.30 and Sun
JSDK 1.4.2.08.  I used the Jakarta Isapi Redirector version 1.2.10
(the windows .exe version) to connect through IIS 5.

--- In flexcoders@yahoogroups.com, Michel Jansen [EMAIL PROTECTED]
wrote:
 Steven Webster wrote:
 
 Any users running Flex on Tomcat? I am looking for a 
 Flex-Tomcat HOWTO...
 
 
 
 1. copy samples.war {TOMCAT_HOME}\webapps\ 
 2. start tomcat
 3. Browse to http://localhost:{port}/samples/
   
 
 After doing this i get the message below...
 
 
 This XML file does not appear to have any style information 
 associated with it. The document tree is shown below.
 
 
 Since i am not familiar with java i need some more hints here...
 
 Thanx in advance...
 
 MJ





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Tomcat

2005-04-22 Thread reubenbrown13


Are you trying to access Tomcat through the default port as a
standalone (8080) or are you trying to use IIS/Apache to hit it?  Does
the samples/index.jsp file display correctly?  Which sample app are
you trying to hit?

Also, what version of Tomcat and Java VM are you using.  I have
successfully deployed Flex as described below in Tomcat 5.0.30 and Sun
JSDK 1.4.2.08.  I used the Jakarta Isapi Redirector version 1.2.10
(the windows .exe version) to connect through IIS 5.

--- In flexcoders@yahoogroups.com, Michel Jansen [EMAIL PROTECTED]
wrote:
 Steven Webster wrote:
 
 Any users running Flex on Tomcat? I am looking for a 
 Flex-Tomcat HOWTO...
 
 
 
 1. copy samples.war {TOMCAT_HOME}\webapps\ 
 2. start tomcat
 3. Browse to http://localhost:{port}/samples/
   
 
 After doing this i get the message below...
 
 
 This XML file does not appear to have any style information 
 associated with it. The document tree is shown below.
 
 
 Since i am not familiar with java i need some more hints here...
 
 Thanx in advance...
 
 MJ





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Calling a WebService from a Class

2005-04-22 Thread Fernando Barros










Hi there!



Im new on flex and I dont know how to
implement this. Im using a ComboBoxCellRenderer.as from MM (or Adobe),
to put a Combo inside a Datagrid. So, in this class, I have this function:



 function handleEvent(evt:Object):Void

 {

 if (evt.type ==
change)

 { 

 // get the row
data corresponding to the current itemIndex (row #)

 var rd =
listOwner.getItemAt(getCellIndex().itemIndex);

 // update the
row's COMBODATA.selectedIndex with that of selectedIndex of

 // the combo box

 rd.COMBODATA.selectedIndex
= combo.selectedIndex;

 // update the
dataProvider to reflect this. this will cause setValue() to

 // be triggered
again, which then uses the COMBODATA.selectedIndex to

 // set the
comboBox properly.

 listOwner.editField(getCellIndex().itemIndex,COMBODATA,rd.COMBODATA);

 } 

 }



It is working with no problems. But Im case, I
have a datagrid who has this function cellEdit=fCarregaGridCliente(event)
and until now, this function only does it wsProposta.ClienteAtualiza.send() [my
webservice to data update]; If I change, for example, the clients name
the function is called, but nothing happen if I change my combo maded by ComboBoxCellRenderer.



So, How can I call this webservice [wsProposta.ClienteAtualiza.send()]
after the change event in the combo?



Thks in advance!







---
Fernando Barros

Internet Officer
+55 11 5014-7093
www.officer.com.br
---













Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












[flexcoders] Re: Running FLEX standalone as a service?

2005-04-22 Thread reubenbrown13


You can run the integrated JRun as a service, you just need a few
files from either the Jrun full demo or a CF Server.  The files
required are: 

$jrun_root\lib\wsconfig\*.*
$jrun_root\bin\jrunsvc*.* (there are 2 files)

From a coldfusion server it is:
$cf_root\runtime\lib\wsconfig\*.*
$cf_root\runtime\bin\jrunsvc*.* (there are 2 files)

The command lines are:
cd $flex_root\jrun4\bin\
jrunsvc -install default Name of Service (ex Flex) Name Displayed
in Service Window (ex Macromedia Flex)

To remove the service:
jrunsvc -remove Name of Service (ex Flex)

That is all there is too it.

--- In flexcoders@yahoogroups.com, Abdul Qabiz [EMAIL PROTECTED] wrote:
 Hi Scott,
 
 You can't run the integrated version of JRUN as service, though full
version
 of JRUN can be run as service, you need to buy it. You can download the
 trail version from macromedia.com
 
 This has been discussed in past. I am attaching some threads with this
 mail
 
 Hope that helps..
 
 -abdul
 
 -Original Message-
 From: Scott Barnes [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 14, 2005 10:07 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Running FLEX standalone as a service?
 
 
 Anyone know the cmd line to put FLEX standalone server as a service? I
 didn't do the instance j2ee approach yet i'm finding it annoying to
 have the dos prompt window open
 
 
 -- 
 Regards,
 Scott Barnes
 http://www.mossyblog.com
 http://www.flexcoder.com (Coming Soon)
 
 
  
 Yahoo! Groups Links
 
 
 
  
 
 
 
 
 
 No
 
 
   _  
 
 From: Speer, Dustin [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 18, 2005 2:48 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Install Flex service Windows?
 
 
 
 Is the full version of JRun included with the Flex license? 
 
  
 
 
   _  
 
 
 From: Cathy Murphy [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, January 18, 2005 1:52 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Install Flex service Windows?
 
  
 
 The embedded version of JRun which ships with Flex does not allow
 installation as a Windows Service.  If you require this functionality,
 install the full version of JRun available at
 http://www.macromedia.com/products/jrun
 http://www.macromedia.com/products/jrun  (during install, choose the
 option
 to run as a windows service) and then deploy your Flex applications
to that
 new server.
 
 - Cathy 
 
  -Original Message-
  From: Douglas Brito de Medeiros [mailto:[EMAIL PROTECTED] 
  Sent: Tuesday, January 18, 2005 2:26 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Install Flex service Windows?
  
  
  How to install the Flex in the services of windows 2000 Pro?
  
  -- 
  Douglas Brito de Medeiros
  MSN: [EMAIL PROTECTED]
  
  
   
  Yahoo! Groups Links
  
  
  
   
  
  
  
 
 
 
 
   _  
 
 Yahoo! Groups Links
 
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/ 
   
 
 * To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] 
   
 
 * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
 http://docs.yahoo.com/info/terms/ . 
 
 
 
 Thanks.  I will play with this as I have been wanting to try running
 ColdFusion development on JRun as well.
 
 -- Jeff
 
 
   _  
 
 From: Cathy Murphy [EMAIL PROTECTED]
 Sent: Monday, February 28, 2005 12:28 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Flex Trial Edition - Setting up JRun as
Windows
 Service?
 
 
 The Flex Trial version may not be run as a Windows Service.  You may
however
 download the Trial Version of JRun (
http://www.macromedia.com/products/jrun
 http://www.macromedia.com/products/jrun ) which runs as a Windows
Service
 and then deploy flex.war and samples.war on that version of JRun.
  
 - Cathy
 
 
   _  
 
 From: GroupOne Dev. [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 28, 2005 1:20 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Flex Trial Edition - Setting up JRun as Windows
 Service?
 
 
 A little off topic, but hopefully somebody knows a bit more about
this than
 I do.  I downloaded and installed the trial version of Flex about a week
 ago.  Out of the box, it appears I have to go find the jrun.exe file and
 start it manually every time.  Has anybody se! t this u p as a Windows
 service that can start automatically?
 
 Thanks
 -- Jeff
 
 
 
 
 
 
 Yahoo! Groups Sponsor  
 
 ADVERTISEMENT
  

http://us.ard.yahoo.com/SIG=129jccltq/M=298184.6018725.7038619.3001176/D=gr

oups/S=1705007207:HM/EXP=1109702323/A=2593423/R=0/SIG=11el9gslf/*http://www.
 netflix.com/Default?mqso=60190075 click here 
  

http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
 :HM/A=2593423/rand=604419695 
 
   _  
 
 Yahoo! Groups Links
 
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/ 
   
 

RE: [flexcoders] Calling a WebService from a Class

2005-04-22 Thread Dirk Eismann

Hi,

you could dispatch a cellEdit event from within your ComboBoxCellRenderer class 
directly on the listOwner itself. This should cause your fCarregaGridCliente() 
function to excute, i.e.

function handleEvent(evt:Object):Void
{
  if (evt.type == change)
  {
var rd = listOwner.getItemAt(getCellIndex().itemIndex);
rd.COMBODATA.selectedIndex = combo.selectedIndex;
listOwner.editField(getCellIndex().itemIndex,COMBODATA,rd.COMBODATA);

// dispatch a cellEdit event on the the owner (the DataGrid) 
listOwner.dispatchEvent({type: cellEdit});

  }
}

Dirk.

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Behalf Of Fernando 
Barros
Sent: Friday, April 22, 2005 4:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Calling a WebService from a Class


Hi there!
 
I'm new on flex and I don't know how to implement this. I'm using a 
ComboBoxCellRenderer.as from MM (or Adobe), to put a Combo inside a Datagrid. 
So, in this class, I have this function:
 
function handleEvent(evt:Object):Void
{
if (evt.type == change)
{ 
   // get the row data corresponding to the 
current itemIndex (row #)
   var rd = 
listOwner.getItemAt(getCellIndex().itemIndex);
   // update the row's COMBODATA.selectedIndex 
with that of selectedIndex of
   // the combo box
   rd.COMBODATA.selectedIndex = 
combo.selectedIndex;
   // update the dataProvider to reflect this. 
this will cause setValue() to
   // be triggered again, which then uses the 
COMBODATA.selectedIndex to
   // set the comboBox properly.
   
listOwner.editField(getCellIndex().itemIndex,COMBODATA,rd.COMBODATA);
} 
}
 
It is working with no problems. But I'm case, I have a datagrid who has this 
function cellEdit=fCarregaGridCliente(event) and until now, this function 
only does it wsProposta.ClienteAtualiza.send() [my webservice to data update]; 
If I change, for example, the client's name the function is called, but nothing 
happen if I change my combo maded by ComboBoxCellRenderer.
 
So, How can I call this webservice [wsProposta.ClienteAtualiza.send()] after 
the change event in the combo?
 
Thks in advance!
 
---
Fernando Barros
Internet Officer
+55 11 5014-7093
www.officer.com.br
---
 



Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
  
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Flex Project Metrics ?

2005-04-22 Thread reubenbrown13


Macromedia has an article about metrics in Flex: 
http://www.macromedia.com/devnet/flex/articles/analytic_app.html

I have not tried any of the suggestions yet, but it might help.


--- In flexcoders@yahoogroups.com, r0main [EMAIL PROTECTED] wrote:
 
 Hello,
 has anyone an idea on how I can get metrics an MXML and AS2 files on a
 given flex project ?
 Yet all I can do is count my files (43 mxml views, 351 AS files w/o
 FlexUnit tests), but I'd like to have codelines per files, total
 codelines, average by package etc...
 
 Idea ?
 
 Thanks, romain





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Re: help with setInterval...

2005-04-22 Thread Abdul Qabiz

Hi terry_hrtn,

Can you post the entire code now? I would like to see why it's not working. 

Correcting Michael's suggestion:

setInterval(mx.utils.Delegate.create(this, upCount), 1000);


I just tested your code after resolving scope issues, it works fine for
me

-abdul


-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 12:31 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: help with setInterval...


Does not work.

On 4/12/05, michael keirnan [EMAIL PROTECTED] wrote:
 
 it would be good to go through the Flex UG sections on scoping and event
 listeners. in the long run understanding scope is invaluable. in your
 test case the following might work:
 
   setInterval(mx.utils.Delegate.create(this, upCount, 1000);
 
/mgk
 
 terry_hrtn wrote:
 
 Matt...now I'm getting the message below in the debug file...any
 suggestions.
 
 Warning: [type Function] is not a function
at ()
 
 --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:
 
 
 You're having scope issues.  setInterval(this, upCount, 1000);
 
 
 
 More info here:
 http://livedocs.macromedia.com/flex/15/flex_docs_en/1662.htm
 http://livedocs.macromedia.com/flex/15/flex_docs_en/1662.htm
 
 
 
 Matt
 
 
 
   _
 
 From: terry_hrtn [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 11, 2005 10:03 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] help with setInterval...
 
 
 
 
 Needing some help with setInterval...
 Can someone tell me why setInterval calls the upCount function
 but does not update label on screen?
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml
 http://www.macromedia.com/2003/mxml  
   mx:Script
   ![CDATA[
 
 var nCnt : Number = 0;
 var lClock : Number = -1;
 
 function startClock()
 {
   btStart.enabled = false;
   btStop.enabled = true;
 
   upCount();
   lClock = setInterval(upCount,1000);
 
   lbClockStat.text = 'Started! (' + lClock
 + ')';
 }
 
 function upCount()
 {
   nCnt += 1;
   lbShow.text = 'Count: ' + nCnt;
 }
 
 function stopClock()
 {
   lbClockStat.text = Stopped at  + nCnt;
   nCnt = 0;
   btStop.enabled = false;
   btStart.enabled = true;
   clearInterval(lClock);
 }
 
 
   ]]
   /mx:Script
   mx:Panel width=304 height=121 
 mx:Label id=lbShow text=start /
 mx:HBox
   mx:Button id=btStart label=Start Clock
 click=startClock() /
   mx:Button id=btStop label=Stop Clock
 click=stopClock() enabled=false /
 /mx:HBox
 mx:Label id=lbClockStat /
   /mx:Panel
 /mx:Application
 
 
 
 
 
 
   _
 
 Yahoo! Groups Links
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/
 
 * To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 
 * Your use of Yahoo! Groups is subject to the Yahoo!
 http://docs.yahoo.com/info/terms/  Terms of Service.
 
 
 
 
 
 
 
 
 Yahoo! Groups Links
 
 
 
 
 
 
 
 
 
 
 
 
 Yahoo! Groups Links
 
 
 
 



 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Re: help with setInterval...

2005-04-22 Thread dave buhler

Hi Abdul,

I ran into a similar issue. In short, whether my code was not scoped
in an MXML file or whether it was within a class, I could not pass
over a parameter (a number in my case) and have the function called by
the setInterval reference the parameter passed over  more than 1x.

With Terry's problem, I had experienced something similar using
Cairngorm with Flex. I could not get my textfield (or label) to update
if I called a function that called a setInterval. If I called the
function directly it worked. I fixed this when I stuck the code in a
class and specified the object with view.MyTextfield.text.

However, I'm still unable to do the following:

Call a setInterval within a class. Have the setInterval pass over a
number. And the function called increment that number. Pass this new
number to a textfield object.

If I call:

setInterval(this,somefunction, 1000, 5)

function somefunction ( e : Number) {
 e++
mx.controls.Alert.show(e)
// shows 6
}


My code is at work, but the above is what I remember as having not worked.
It works if I set a default value within the function. But as a
parameter, the value fails.

Best,
Dave


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] About single methd handling mutiple events.

2005-04-22 Thread Jesus Salvador Ramos Cardona










Hey.



Whats the best way to have a single method
respond to both a clic event from a button, and a cellPress event from a
DataGrid?

Both components are inside the mail mxml.



Thanks for your help.



J.











Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












RE: [flexcoders] About single methd handling mutiple events.

2005-04-22 Thread Abdul Qabiz

Hi,
 
you can define a handleEvent(..) function in your application(mail.mxml),
this method would be called whenever an event happen.
 
Look at the Defining the handleEvent() method  section in Flex docs for
more: http://livedocs.macromedia.com/flex/15/flex_docs_en/0503.htm

Hope that helps

-abdul
 
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 3:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] About single methd handling mutiple events.



Hey.

 

What's the best way to have a single method respond to both a clic event
from a button, and a cellPress event from a DataGrid?

Both components are inside the mail mxml.

 

Thanks for your help.

 

J.




Yahoo! Groups Links


*   To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
  
*   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
  
*   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/ . 





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] About single methd handling mutiple events.

2005-04-22 Thread Matt Horn





If you don't want a dependency on the target property of 
the event object, then you could check the classNameinstead (so you can be 
sure it was a _button_ that dispatched the click event versus some other 
component. BTW, you can also use addEventListener to use the same handler for 
multiple events rather than the handleEvent method. Sample 
below.

hth, 
matt horn 
flex docs

--sample
?xml version="1.0"?mx:Application 
xmlns:mx="http://www.macromedia.com/2003/mxml" 
initialize="createListeners()" 
mx:Script![CDATA[function 
createListeners() {button1.addEventListener("click", 
eventListener);cb1.addEventListener("click", 
eventListener);}

function eventListener(event) 
{if (event.target.className == "Button") 
{// Perform search.} else if 
(event.target.className == "CheckBox") {// Modify 
search to include all 
words.}}]]/mx:Scriptmx:Button label="Submit" 
id="button1" /mx:CheckBox label="All Words" id="cb1" 
/mx:TextArea id="ta1" text="Please enter a search term" 
width="200" //mx:Application

  
  
  From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of Jesus Salvador Ramos 
  CardonaSent: Friday, April 22, 2005 6:53 PMTo: 
  flexcoders@yahoogroups.comSubject: RE: [flexcoders] About single 
  methd handling mutiple events.
  
  
  Thanks, 
  Abdul.
  
  Thats what I thought 
  Id do, and it looks like this.
   public function handleEvent(eventObj:Object):Void { var type = eventObj.type; var target = eventObj.target.className;  if (type=="click"  target == button) { // I do not want to be dependant on my components name! showTitleView(myDataGridName.selectedItem);  } else if (type==cellPress  target == myDataGridName) { // Like this, where I do not depend on the components name to call the same  // method. showTitleView(target.selectedItem); } }
  
  But this way I must 
  rely on my components id to call the same method if the event is fired with 
  the buttons click. I wonder if theres a way to avoid this 
  dependency
  
  Any 
  ideas?
  
  J.
  
  
  
  
  
  De: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] En nombre de Abdul QabizEnviado el: Viernes, 22 
  de Abril de 2005 05:29 pmPara: flexcoders@yahoogroups.comAsunto: RE: [flexcoders] About single 
  methd handling mutiple events.Importancia: 
  Alta
  
  Hi,you can define a handleEvent(..) function in your 
  application(mail.mxml),this 
  method would be called whenever an event happen.Look at the "Defining the handleEvent() method" 
  section in Flex docs formore: http://livedocs.macromedia.com/flex/15/flex_docs_en/0503.htmHope that helps-abdulFrom: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 
  Sent: Saturday, April 23, 2005 
  3:38 AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] About single methd handling mutiple 
  events.Hey.What's the best way to have a single method respond to both 
  a clic eventfrom a button, and a 
  cellPress event from a DataGrid?Both components are inside the mail 
  mxml.Thanks for your 
  help.J.Yahoo! Groups Links* To visit your group on the 
  web, go to: http://groups.yahoo.com/group/flexcoders/  
  * 
  To unsubscribe from this group, send an email to: 
  [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] 
   
   * Your use of Yahoo! Groups 
  is subject to the Yahoo! Terms of Servicehttp://docs.yahoo.com/info/terms/ 
  . 







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










Re: [flexcoders] Re: help with setInterval...

2005-04-22 Thread dave buhler

Does not work.

On 4/12/05, michael keirnan [EMAIL PROTECTED] wrote:
 
 it would be good to go through the Flex UG sections on scoping and event
 listeners. in the long run understanding scope is invaluable. in your
 test case the following might work:
 
   setInterval(mx.utils.Delegate.create(this, upCount, 1000);
 
/mgk
 
 terry_hrtn wrote:
 
 Matt...now I'm getting the message below in the debug file...any
 suggestions.
 
 Warning: [type Function] is not a function
at ()
 
 --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:
 
 
 You're having scope issues.  setInterval(this, upCount, 1000);
 
 
 
 More info here:
 http://livedocs.macromedia.com/flex/15/flex_docs_en/1662.htm
 http://livedocs.macromedia.com/flex/15/flex_docs_en/1662.htm
 
 
 
 Matt
 
 
 
   _
 
 From: terry_hrtn [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 11, 2005 10:03 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] help with setInterval...
 
 
 
 
 Needing some help with setInterval...
 Can someone tell me why setInterval calls the upCount function
 but does not update label on screen?
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml
 http://www.macromedia.com/2003/mxml  
   mx:Script
   ![CDATA[
 
 var nCnt : Number = 0;
 var lClock : Number = -1;
 
 function startClock()
 {
   btStart.enabled = false;
   btStop.enabled = true;
 
   upCount();
   lClock = setInterval(upCount,1000);
 
   lbClockStat.text = 'Started! (' + lClock
 + ')';
 }
 
 function upCount()
 {
   nCnt += 1;
   lbShow.text = 'Count: ' + nCnt;
 }
 
 function stopClock()
 {
   lbClockStat.text = Stopped at  + nCnt;
   nCnt = 0;
   btStop.enabled = false;
   btStart.enabled = true;
   clearInterval(lClock);
 }
 
 
   ]]
   /mx:Script
   mx:Panel width=304 height=121 
 mx:Label id=lbShow text=start /
 mx:HBox
   mx:Button id=btStart label=Start Clock
 click=startClock() /
   mx:Button id=btStop label=Stop Clock
 click=stopClock() enabled=false /
 /mx:HBox
 mx:Label id=lbClockStat /
   /mx:Panel
 /mx:Application
 
 
 
 
 
 
   _
 
 Yahoo! Groups Links
 
 * To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 http://groups.yahoo.com/group/flexcoders/
 
 * To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 
 * Your use of Yahoo! Groups is subject to the Yahoo!
 http://docs.yahoo.com/info/terms/  Terms of Service.
 
 
 
 
 
 
 
 
 Yahoo! Groups Links
 
 
 
 
 
 
 
 
 
 
 
 
 Yahoo! Groups Links
 
 
 
 



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] About single methd handling mutiple events.

2005-04-22 Thread Jesus Salvador Ramos Cardona










Thanks, Abdul.



Thats what I
thought Id do, and it looks like this.



 public function handleEvent(eventObj:Object):Void { var type = eventObj.type; var target = eventObj.target.className;  if (type==click  target == button) { // I do not want to be dependant on my components name! showTitleView(myDataGridName.selectedItem);  } else if (type==cellPress  target == myDataGridName) { // Like this, where I do not depend on the components name to call the same  // method. showTitleView(target.selectedItem); } }



But this way I must rely
on my components id to call the same method if the event is fired with
the buttons click. I wonder if theres a way to avoid this
dependency



Any ideas?



J.











De:
flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] En nombre de Abdul Qabiz
Enviado el: Viernes, 22 de
Abril de 2005 05:29 pm
Para: flexcoders@yahoogroups.com
Asunto: RE: [flexcoders] About
single methd handling mutiple events.
Importancia: Alta





Hi,

you can define a handleEvent(..) function in your
application(mail.mxml),
this method would be called whenever an event
happen.

Look at the Defining the handleEvent()
method section in Flex docs for
more: http://livedocs.macromedia.com/flex/15/flex_docs_en/0503.htm

Hope that helps

-abdul





From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com] 
Sent: Saturday, April 23, 2005 3:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] About single methd handling
mutiple events.



Hey.



What's the best way to have a single method
respond to both a clic event
from a button, and a cellPress event from a
DataGrid?

Both components are inside the mail mxml.



Thanks for your help.



J.




Yahoo! Groups Links


* To visit your
group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
  
* To unsubscribe
from this group, send an email to:

[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]

  
* Your use of Yahoo!
Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/
. 















Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












RE: [flexcoders] CSS - Application Width

2005-04-22 Thread Abdul Qabiz

Hi,

Width and height are properties not css styles. You can achieve the same by
setting in Application tag. I have a feeling that these two properties are
used by compiler while creating html wrapper for flex app.

What do you want to achieve by keeping width/height in CSS?

-abdul

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 22, 2005 9:22 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] CSS - Application Width



I am using an external CSS for my Flex app to control it's appearance.

I want to set the width and height of the Application equal to 100%


Application {
theme-color:#99CCFF;
width: 100%;
height: 100%; }

I get the following errors:

2 Errors, 1 Exception found. 
 
Error /Stylesheets/style1.css:13 
CSS Value for width not supported.



Error /Stylesheets/style1.css:13 
CSS Value for height not supported.



Exception java.lang.IllegalStateException 
CSS Value for width not supported. 



Is there a way to set the width of the Application from an external 
CSS at all?

Thanks,
Alex







 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] About single methd handling mutiple events.

2005-04-22 Thread Abdul Qabiz

Hi,
 

 I wonder if there's a way to avoid this dependency 

May be,  what exactly is your requirement?

 

-abdul 




From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 4:23 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] About single methd handling mutiple events.



Thanks, Abdul.

 

That's what I thought I'd do, and it looks like this.

 

public function handleEvent(eventObj:Object):Void {
   var type = eventObj.type;
   var target = eventObj.target.className; 
   if (type==click  target == button) {
   // I do not want to be dependant on my component's
name!
   showTitleView(myDataGridName.selectedItem); 
   }
   else if (type==cellPress  target == myDataGridName) {
   // Like this, where I do not depend on the
component's name to call the same 
   // method.
   showTitleView(target.selectedItem);
   }
}

 

But this way I must rely on my component's id to call the same method if the
event is fired with the button's click. I wonder if there's a way to avoid
this dependency

 

Any ideas?

 

J.

 



De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre
de Abdul Qabiz
Enviado el: Viernes, 22 de Abril de 2005 05:29 pm
Para: flexcoders@yahoogroups.com
Asunto: RE: [flexcoders] About single methd handling mutiple events.
Importancia: Alta

 

Hi,

you can define a handleEvent(..) function in your application(mail.mxml),
this method would be called whenever an event happen.

Look at the Defining the handleEvent() method  section in Flex docs for
more: http://livedocs.macromedia.com/flex/15/flex_docs_en/0503.htm

Hope that helps

-abdul





From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 3:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] About single methd handling mutiple events.



Hey.



What's the best way to have a single method respond to both a clic event
from a button, and a cellPress event from a DataGrid?

Both components are inside the mail mxml.



Thanks for your help.



J.




Yahoo! Groups Links


*  To visit your group on the web, go to:
  http://groups.yahoo.com/group/flexcoders/

*  To unsubscribe from this group, send an email to:
  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 

*  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/ . 









Yahoo! Groups Links


*   To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
  
*   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
  
*   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/ . 





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] How to load the XML data in to mxml components w ith Sorting ......

2005-04-22 Thread Venkat Pathy

Hi Abdul,

Everything is working fine,
 
If i select the country in the first combo box its working fine 

same way,  if i select the contactname(for the selected country) in
the second combo box that contact name's related data's only should
come in the dataGrid component.

i am trying to do this .just guide me please...

Thanks  Regards
Pathy

On 4/19/05, Abdul Qabiz [EMAIL PROTECTED] wrote:
 Hi Pathy,
 
 I made it working example, see the code below or find the attached files.
 Let me know, if something is not clear...
 
 ##contactListSample.mxml##
 
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml;
 verticalGap=0 horizontalGap=0
 creationComplete=buildCountryMap(contactListData.contact)
 mx:Script
![CDATA[
 
var countryMap : Object;
var countryList : Array;
 
function buildCountryMap(contactList : Array) : Void
 
{
 
  countryMap = new Object();
 
  countryList = new Array();
 
  for (var i = 0; i  contactList.length; i++)
 
  {
 
var country : String = contactList[i].country;
 
var countryContacts : Array = countryMap[country];
 
if (countryContacts == null)
 
{
 
  countryContacts = new Array();
 
  countryMap[country] = countryContacts;
 
  countryList.push(country);
 
}
 
countryContacts.push(contactList[i]);
 
  }
  country_cb.selectedIndex = 0;
 
}
 
]]
 /mx:Script
 
 mx:Model id=contactListData source=contactList.xml/
 
 mx:VBox
  mx:Label text=TestPage styleName=appTitle /
 mx:HBox horizontalGap=2 height=100% width=100%
 mx:Canvas width=700 height=300
  mx:Panel title=Details id=main height=300 width=700
  mx:Form id=details marginLeft=30 defaultButton=clearButton
 visible={details.height0} width=670 height=200
mx:FormItem label=Country
   mx:ComboBox id=country_cb width=200 labelField=country
 dataProvider={countryList} selectedIndex=0 /
/mx:FormItem
mx:Spacer height=25/mx:Spacer
mx:FormItem label=Contact Name
mx:ComboBox labelField=contactname width=200
 dataProvider={countryMap[country_cb.selectedItem]} /
/mx:FormItem
/mx:Form
 /mx:Panel
 /mx:Canvas
 /mx:HBox
 mx:HBox horizontalGap=4 height=100% width=100%
  mx:Panel title=Data Grid id=mainWin height=100% width=100%
   mx:DataGrid id=content height=100% width=100%
 dataProvider={countryMap[country_cb.selectedItem]} 
mx:columns
  mx:Array
mx:DataGridColumn headerText=Country columnName=country
 /
mx:DataGridColumn headerText=Contact Name
 columnName=contactname /
  /mx:Array
/mx:columns
  /mx:DataGrid
   /mx:Panel
 /mx:HBox
 /mx:VBox
 /mx:Application
 
 ##contactList.xml##
 
 ?xml version=1.0 encoding=UTF-8?
 contactlist
contact id=1
countryArgentina/country
contactnameRobert/contactname
/contact
contact id=2
countryArgentina/country
contactnameAlex/contactname
/contact
contact id=3
   countryBolivia/country
   contactnameAlex/contactname
/contact
contact id=4
   countryArgentina/country
   contactnameRose/contactname
/contact
contact id=5
countryArgentina/country
contactnameRobert/contactname
/contact
contact id=6
   countryKorea/country
   contactnameRose/contactname
/contact
 /contactlist
 
 I hope that's what you were looking for...
 
 -abdul
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 19, 2005 8:03 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] How to load the XML data in to mxml components w
 ith Sorting ..
 
 Hi matt,
 
 Thank you very much for immediate reply.
 
 i applied that code. but i think i did some mistakes. please correct that
 
 how should i call thaty functions
 
 mx:Script source=testObject.as/
 
 1st Combo
 
 mx:ComboBox  labelField=contryN width=200  /
 
 2nd Combo
 
 mx:ComboBox labelField=Cname width=200
 dataProvider=countryMap[countryCombo.selectedItem] /
 
 please explain me how do i pass cantactList.
 
 Thanks  Regards
 pathy
 
 On 4/16/05, Matt Chotin [EMAIL PROTECTED] wrote:
 
 
  I think you're going to need two data structures to help you out.  The
 first
  one can be a Map (represented in AS by an object) of countries and the
  contacts that are in them.  The second is an Array of the countries
  themselves.
 
 
 
  Var countryMap : Object;
 
  Var countryList : Array;
 
 
 
  Function buildCountryMap(contactList : Array) : Void
 
  {
 
countryMap = new Object();
 
countryList = new Array();
 
for (var i = 0; I  contactList.length; i++)
 
{
 
  var country : String = contactList[i].country;
 
  var countryContacts : Array = countryMap[country];
 
  if (countryContacts == null)
 
  {
 
countryContacts = new Array();
 
  

[flexcoders] General / Performance questions

2005-04-22 Thread viraf_bankwalla


Hi,

I have an application that is primarily two data grids (summary and 
detailed) that is suffering from performance problems (takes approx 
20 seconds to render a page).  I am just about to start profiling 
and examining our application for performance, and have a host of 
introductory questions 

1.  Is there a performance difference between accessing 
properties as object.property and object[property].
2.  Is there a performance difference between calling methods 
and static methods?  
3.  What is the overhead for the dispatcher and dispatching 
events vs. calling methods directly?
4.  What is the difference between instantiating classes using 
new vs createClassObject.  What are the best practices between their 
usage?
5.  The Flex Application Performance… paper on
Macromedia's 
site suggests using absolute positioning and sizing.  What is the 
difference between setting width/height and calling setSize.  What 
is the difference between setting x,y vs move.  What is the the 
preferred mechanism for setting the above.
6.  What documents are available to help me better understand 
how the UI component work so that I can apply appropriate mechanisms 
to improve rendering of the application.
7.  What have been other peoples experience and how have they 
improved the performance of the application?






 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Re: any ideas about flex client side caching?

2005-04-22 Thread Matt Horn





I am not sure why the technique described in [3] doesn't 
give the easy answer: use the clear() method; for example:

myLSO.clear();

This 
deletes the local file.

matt 
horn
flex 
doc


  
  
  From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of Johan 
  LopesSent: Friday, April 22, 2005 9:54 AMTo: 
  flexcoders@yahoogroups.comSubject: Re: [flexcoders] Re: any ideas 
  about flex client side caching?
  Hi,Zhu FengCan I delete files by using action script 
  APIs? When I use the shared object, I don't want the .sol files stay in disk 
  persistently, although we can clear the context of the file.You 
  could use onUnload() see example code below [1] or use onBeforeUnload() events 
  in IE (not sure about the other browsers FireFox/Mozilla/Opera/Safari etc) to 
  trap the event triggered when the browser is closing down and then call Flash 
  [2]. When the close event is detected in Flash you could "physically" delete 
  the SharedObjects from disk using the solution described in 
  [3].codefunction onUnloadHandler(){ 
  if(self.VBArray){ var e = self.event, s = 
  self.screen; if(e.clientX + s.width  0  
  e.clientY + s.height  0 typeof(window.onclose) == 
  "function") { 
  window.onclose(); }; 
  };};>function onclose(){ alert("The window 
  has left the desktop");};/codeZhu Feng3. 
  When I close the browser, I want to capture this event and clear the context 
  of shared object (or remove the file if action script can do this). Could AS 
  capture this kind of event?Basically: "Macromedia's docs don't 
  show us how to remove the physical file from a user's drive, (although they 
  say it's possible), but we can combine two things we know already to figure it 
  out. Firstly, when we write a SO with no properties in its data child, no file 
  is written. Secondly when we delete a property from the data child and 
  re-write the SO the property is removed from the file on the disk also. So in 
  order to delete the actual file, one need only delete all the properties of 
  the data child. This is probably best done with a for...in loop." 
  [3]Source:[1] http://chattyfig.figleaf.com/mailman/htdig/flashcoders/2002-May/033799.html[2] 
  http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_15683#jt[3] 
  http://www.actionscript.org/tutorials/intermediate/SharedObjects/index3.shtml 
  HTH,/Johan
  On 4/22/05, Feng 
  Zhu [EMAIL PROTECTED] 
  wrote:
  

Thank you very much. 
This will be helpful.
And, What about the 
2, 3, 4 questions, any ideas?


Best Regards!
Zhu Feng
-Original 
Message-From: 
flexcoders@yahoogroups.com 
[mailto: 
flexcoders@yahoogroups.com] On Behalf Of Johan LopesSent: 2005 
421  
20:57To: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] Re: any ideas 
about flex client side caching?


Zhu Feng 1. The 
shared object stored in local disk is plain; we can see the .sol file 
context easily by text editorIf you're saving sensitive data then 
use an encryption scheme to scramble your data before saving them as 
SharedObjects.There are many implementations being ported to AS2, 
just google it and you'll see.Try this one: http://www.meychi.com/archive/31.phpHTH,Johan

On 4/21/05, Feng 
Zhu  [EMAIL PROTECTED] 
wrote:
Hi,Sorry to 
disturb you again.The following things for shared object/client side 
caching puzzle me:1. The shared object stored in local disk is plain; we 
can see the .sol file context easily by text editor. Is there anything 
security for shared object or is there any method to cache data shared by 
several applications in memory not in hard disk?2. Can I delete 
files by using action script APIs? When I use the shared object, I don't 
want the .sol files stay in disk persistently, although we can clear the 
context of the file.3. When I close the browser, I want to capture 
this event and clear the context of shared object (or remove the file if 
action script can do this). Could AS capture this kind of event?Best 
Regards!Zhu FengBest Regards!Zhu Feng-Original 
Message-From: flexcoders@yahoogroups.com [mailto: 
flexcoders@yahoogroups.com] On Behalf Of Abdul QabizSent: 2005415 
19:36To: flexcoders@yahoogroups.comSubject: RE: [flexcoders] 
Re: any ideas about flex client side caching? Hi,You can 
allow all swfs from a domain to read/write to same 
SharedObject,There is second parameter to 
SharedObject.getLocal(..,..) method. Read aboutin docs.var so = 
SharedObject.getLocal ('myCookie', "/");This way all swfs in same 
domain have access to myCookie SO...But rememberthere name collision 
issues, so read the docs 

RE: [flexcoders] AnimationPackage

2005-04-22 Thread Alex Uhlmann

Yes. Currently, it's indended to use AnimationPackage only in ActionScript 2.0 
classes or the MXML Script tag. Here's a quick example for a Script tag.

mx:Script
![CDATA[  
   
import de.alex_uhlmann.animationpackage.*;
import de.alex_uhlmann.animationpackage.animation.*;
import de.alex_uhlmann.animationpackage.drawing.*;
import de.alex_uhlmann.animationpackage.utility.*;
import com.robertpenner.easing.*;  
   
function runAnimation() {
APCore.initialize();   
   
var myStar:Star = new Star(275,200,100,25,6);
myStar.lineStyle(2,0xff,100);
myStar.fillStyle(0xff,100);
myStar.draw(); 
   
var mc:MovieClip = myStar.movieclip;
   
var myMoveOnQuadCurve:MoveOnQuadCurve = new 
MoveOnQuadCurve(mc,100,100,300,300,500,100);
var myScale:Scale = new Scale(mc,25,25);
var myRotation:Rotation = new Rotation(mc,360);
var myColorTransform:ColorTransform = new 
ColorTransform(mc,0xff,50);
   
var myAnimation:Animation = new Animation();
myAnimation.addChild(myMoveOnQuadCurve);
myAnimation.addChild(myColorTransform);
myAnimation.addChild(myScale,0,1000);
myAnimation.addChild(myRotation,1000,1500);

myAnimation.animationStyle(2000,Circ.easeInOut,onCallback);
myAnimation.animate(0,100);
}  
]]
/mx:Script

i.e. a creationComplete event handler could call the method runAnimation. 
Basically all the supplied examples of the HTML documentation stay the same.

Best,
Alex


-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Behalf Of Duccio
Sent: 22 April 2005 18:36
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AnimationPackage


Has anyone tested 
AnimationPackage(http://www.alex-uhlmann.de/flash/animationpackage/index.htm) 
or similar in Flex? Any example?
Best regards
Duccio Del Ministro





Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
 
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] How to load the XML data in to mxml components w ith Sorting ......

2005-04-22 Thread Abdul Qabiz

Hi Pathy,

Why would want to do that? Each contact has a data that would fit in a
single row. And DataGrid is not for such usage.

Anyways, what you asking for is easy to do, you need to come up with right
kind of binding

You might want to reset the datagrid's dataProvider to contact details on
second combobox's change event.

Hope that helps..

-abdul 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 22, 2005 8:50 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to load the XML data in to mxml components w
ith Sorting ..


Hi Abdul,

Everything is working fine,
 
If i select the country in the first combo box its working fine 

same way,  if i select the contactname(for the selected country) in
the second combo box that contact name's related data's only should
come in the dataGrid component.

i am trying to do this .just guide me please...

Thanks  Regards
Pathy

On 4/19/05, Abdul Qabiz [EMAIL PROTECTED] wrote:
 Hi Pathy,
 
 I made it working example, see the code below or find the attached files.
 Let me know, if something is not clear...
 
 ##contactListSample.mxml##
 
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml;
 verticalGap=0 horizontalGap=0
 creationComplete=buildCountryMap(contactListData.contact)
 mx:Script
![CDATA[
 
var countryMap : Object;
var countryList : Array;
 
function buildCountryMap(contactList : Array) : Void
 
{
 
  countryMap = new Object();
 
  countryList = new Array();
 
  for (var i = 0; i  contactList.length; i++)
 
  {
 
var country : String = contactList[i].country;
 
var countryContacts : Array = countryMap[country];
 
if (countryContacts == null)
 
{
 
  countryContacts = new Array();
 
  countryMap[country] = countryContacts;
 
  countryList.push(country);
 
}
 
countryContacts.push(contactList[i]);
 
  }
  country_cb.selectedIndex = 0;
 
}
 
]]
 /mx:Script
 
 mx:Model id=contactListData source=contactList.xml/
 
 mx:VBox
  mx:Label text=TestPage styleName=appTitle /
 mx:HBox horizontalGap=2 height=100% width=100%
 mx:Canvas width=700 height=300
  mx:Panel title=Details id=main height=300 width=700
  mx:Form id=details marginLeft=30 defaultButton=clearButton
 visible={details.height0} width=670 height=200
mx:FormItem label=Country
   mx:ComboBox id=country_cb width=200 labelField=country
 dataProvider={countryList} selectedIndex=0 /
/mx:FormItem
mx:Spacer height=25/mx:Spacer
mx:FormItem label=Contact Name
mx:ComboBox labelField=contactname width=200
 dataProvider={countryMap[country_cb.selectedItem]} /
/mx:FormItem
/mx:Form
 /mx:Panel
 /mx:Canvas
 /mx:HBox
 mx:HBox horizontalGap=4 height=100% width=100%
  mx:Panel title=Data Grid id=mainWin height=100% width=100%
   mx:DataGrid id=content height=100% width=100%
 dataProvider={countryMap[country_cb.selectedItem]} 
mx:columns
  mx:Array
mx:DataGridColumn headerText=Country
columnName=country
 /
mx:DataGridColumn headerText=Contact Name
 columnName=contactname /
  /mx:Array
/mx:columns
  /mx:DataGrid
   /mx:Panel
 /mx:HBox
 /mx:VBox
 /mx:Application
 
 ##contactList.xml##
 
 ?xml version=1.0 encoding=UTF-8?
 contactlist
contact id=1
countryArgentina/country
contactnameRobert/contactname
/contact
contact id=2
countryArgentina/country
contactnameAlex/contactname
/contact
contact id=3
   countryBolivia/country
   contactnameAlex/contactname
/contact
contact id=4
   countryArgentina/country
   contactnameRose/contactname
/contact
contact id=5
countryArgentina/country
contactnameRobert/contactname
/contact
contact id=6
   countryKorea/country
   contactnameRose/contactname
/contact
 /contactlist
 
 I hope that's what you were looking for...
 
 -abdul
 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 19, 2005 8:03 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] How to load the XML data in to mxml components w
 ith Sorting ..
 
 Hi matt,
 
 Thank you very much for immediate reply.
 
 i applied that code. but i think i did some mistakes. please correct that
 
 how should i call thaty functions
 
 mx:Script source=testObject.as/
 
 1st Combo
 
 mx:ComboBox  labelField=contryN width=200  /
 
 2nd Combo
 
 mx:ComboBox labelField=Cname width=200
 dataProvider=countryMap[countryCombo.selectedItem] /
 
 please explain me how do i pass cantactList.
 
 Thanks  Regards
 pathy
 
 On 4/16/05, Matt Chotin [EMAIL PROTECTED] wrote:
 
 
  I think you're going to need two data structures to help you out.  The
 first
  

[flexcoders] drag drop

2005-04-22 Thread Robert Brueckmann









Is there any way to get the id of the
component which is the source from which youre dragging items from?



Im trying to do 2 things on a
page. I have a list of indices and a blank listthe user first can drag
indices over to the blank list and then once theyve dragged them over,
they can then drag and drop within the list to order them accordinglyso
I have the initial drag  drop done without a hitchbut I can figure
out the intra-list drag  dropping for ordering purposesI thought
one way would be in the the doDragOver function, I would simply check the id of
the source and against the id of the destination and if theyre equal
make it a move action, otherwise its a copy actionI can get the
id of the destination without a hitch but I cant figure out how to
retrieve the id of the source the item is being dragged from.



Possible? Should I just add an up and
down arrow next to the list and make them select the items and call the
setChildIndex method on the item in the list instead of doing the whole drag
 drop thing?





Robert L. Brueckmann

Senior Web Developer

Merlin Securities, LLC

595 Madison Avenue

New York, NY 10022

p: 212.822.4821
f: 212.822.4820










This message contains information fromMerlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.


Merlin Securities, LLC is a registered broker-dealer. Services offered throughMerlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed byMerlin Securities, LLCand may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Re: help with setInterval...

2005-04-22 Thread Abdul Qabiz
Hi,

However, I'm still unable to do the following:
Call a setInterval within a class. Have the setInterval pass over a
number. And the function called increment that number. Pass this new
number to a textfield object.
If I call:
setInterval(this,somefunction, 1000, 5)
function somefunction ( e : Number) {
 e++
mx.controls.Alert.show(e)
// shows 6
}

I think, it would trace 6 repeatedly over the interval. And I feel that
there is no reason it won't work.

I just created a sample to verify if my feelings are right :)

This sample is demonstrating setInterval(..) inside a class. Look at the
attached files or code later in this mail.

Hope that helps...

-abdul


1) ##Counter.as##

import mx.core.UIObject;

[Event(start)]
[Event(increment)]
[Event(stop)]

class Counter extends UIObject
{

var counterIntervalId:Number;
var __delay:Number = 50;
var __min:Number = 0;
var __max:Number = 100;
var __count:Number = 0;
var running:Boolean = false;

function Counter(delay:Number, min:Number, max:Number)
{

__min = min ? min : 0;
__max = max ? max : 100;
__delay = delay ? delay : 50;
}

function startCounter():Void
{

__count = 0;
running = true;
dispatchEvent({type:start});
counterIntervalId = setInterval(this,incrementCount, __delay,
__min);

//you can also do this:
//counterIntervalId =
setInterval(mx.utils.Delegate.create(this,incrementCount), __delay, __min);

}

function incrementCount(num):Void
{
  if(__count  __max) 
  {

//un-comment the following to see setInterval(..) passes same
number agian and again
   // mx.controls.Alert.show(num.toString());
__count++;
dispatchEvent({type:increment});  
  }
  else
  {
  stopCounter();
  }
  
}

function stopCounter():Void
{
clearInterval(counterIntervalId);
__count = 0;
running = false
dispatchEvent({type:stop});
}

function get min():Number
{
return __min;
}
function set min(newValue:Number):Void
{
__min = newValue;
}

function get max():Number
{
return __max;
}
function set max(newValue:Number):Void
{
__max = newValue;
}
function get value():Number
{
return __count;
}

}



2) ##setIntervalExample.mxml##

?xml version=1.0 encoding=iso-8859-1?
mx:Application width=800 height=600
xmlns:mx=http://www.macromedia.com/2003/mxml;  initialize=onAppInit()

mx:Script
![CDATA[

import Counter;
import mx.utils.Delegate;

var counter:Counter;

function onAppInit()
{
counter = new Counter();
changeLimit();

counter.addEventListener(start, Delegate.create(this,
onCounterStart));
counter.addEventListener(increment, Delegate.create(this,
onCounterIncrement));
counter.addEventListener(stop, Delegate.create(this,
onCounterStop));
}

function onCounterStart(event)
{
_ta.text +=Counter started..\n;
}
function onCounterIncrement(event)
{
_ta.text += event.target.value + \n;
}
function onCounterStop(event)
{
_ta.text += Counter stopped...\n;
}

function changeLimit()
{
counter.min = slider.values[0];
counter.max = slider.values[1];
}


]]
/mx:Script
mx:HBox
mx:Label text=Count:/mx:TextArea id=_ta width=300
height=150 /
/mx:HBox
mx:HBox

mx:Button label=Start Counter click=counter.startCounter();
enabled={!counter.running}/
mx:Button label=Stop Counter click=counter.stopCounter();
enabled={counter.running}/

/mx:HBox
mx:HSlider id=slider
   toolTipPlacement=top

   thumbCount=2
   labels=['min', 'max']
   values=[0, 100]
   snapInterval=1
   change=changeLimit();
   allowTrackClick=true
   maximum=1000
   minimum=0/
/mx:Application





-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 7:22 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: help with setInterval...


Hi Abdul,

I ran into a similar issue. In short, whether my code was not scoped
in an MXML file or whether it was within a class, I could not pass
over a parameter (a number in my case) and have the function 

RE: [flexcoders] drag drop

2005-04-22 Thread Ashish Goyal





You can get the dragging source byusing 
-event.dragSource.dataForFormat("source").

Thanks
-Ashish

  
  
  From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] Sent: Friday, April 22, 2005 
  9:03 AMTo: flexcoders@yahoogroups.comSubject: 
  [flexcoders] drag drop
  
  
  
  Is there any way to 
  get the id of the component which is the source from which you're dragging 
  items from?
  
  I'm trying to do 2 
  things on a page. I have a list of indices and a blank list...the user 
  first can drag indices over to the blank list and then once they've dragged 
  them over, they can then drag and drop within the list to order them 
  accordingly...so I have the initial drag  drop done without a hitch...but I 
  can figure out the intra-list drag  dropping for ordering purposes...I 
  thought one way would be in the the doDragOver function, I would simply check 
  the id of the source and against the id of the destination and if they're 
  equal make it a move action, otherwise it's a copy action...I can get the id of 
  the destination without a hitch but I can't figure out how to retrieve the id 
  of the source the item is being dragged from.
  
  Possible? 
  Should I just add an up and down arrow next to the list and make them select 
  the items and call the setChildIndex method on the item in the list instead of 
  doing the whole drag  drop thing?
  
  
  Robert L. 
  Brueckmann
  Senior Web 
  Developer
  Merlin Securities, 
  LLC
  595 Madison 
  Avenue
  New 
  York, NY 10022
  p: 
  212.822.4821f: 212.822.4820
  
  
  
  
  This message contains information fromMerlin Securities, LLC, 
  or from one of its affiliates, that may be confidential and privileged. If you 
  are not an intended recipient, please refrain from any disclosure, copying, 
  distribution or use of this information and note that such actions are 
  prohibited. If you have received this transmission in error, please notify the 
  sender immediately by telephone or by replying to this 
  transmission.
   
  Merlin Securities, LLC is a registered broker-dealer. Services 
  offered throughMerlin Securities, LLC are not insured by the FDIC or any 
  other Federal Government Agency, are not deposits of or guaranteed 
  byMerlin Securities, LLCand may lose value. Nothing in this 
  communication shall constitute a solicitation or recommendation to buy or sell 
  a particular security.







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] EventListener for canvas

2005-04-22 Thread Abdul Qabiz

Hi,

Since you are listening to a container's mouseDownSomewhere or mouseDown
event, this would protect all children inside the container from receiving
mouse down event. That's why button's click event is not broadcast.

Well there are always way, eitehr you can redesign your app or do something
else. Following is one of the ways, I have modified your code to allow:

- having different way of event handling - by using handleEvent(..) function
- allowing turning off mouseDownSomewhere event - by doing bound checks and
dispatching button's click event.

I know, this is quite hacky, but I feel you can design your application in
someother way to avoid this.

##ModifiedCode##

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; 
width=100% height=100% creationComplete=onAppInit() 
mx:Script
![CDATA[
//import mx.events.EventDispatcher;

var xDef:Number;
var yDef:Number;
var i:Number=0;
var eventListenerObject:Object;

function onAppInit()
{
eventListenerObject = new Object();
eventListenerObject.handleEvent =
mx.utils.Delegate.create(this, handleSubscribedEvents);
createListener();
}

function createListener()
{
myCanvas.addEventListener(mouseOver,
eventListenerObject);

myCanvas.addEventListener(mouseDownSomewhere,eventListenerObject);
}

function handleSubscribedEvents(event)
{
var eventName:String = event.type;

switch(eventName)
{
case mouseOver:
handleMouseOver(event);
break;
case mouseDownSomewhere:
handleMouseDown(event);

}
}

function handleMouseDown(event:Object) {
var xLoc=event.target.mouseX;
var yLoc=event.target.mouseY;
var point = {x:xLoc, y:yLoc};

myCanvas.localToGlobal(point);

xDef=xLoc;
yDef=yLoc;

var l = remove_btn.x;
var r = remove_btn.x + remove_btn.width;
var t = remove_btn.y;
var b = remove_btn.y + remove_btn.height;



if(point.x = l  point.x = r  point.y = t 
point.y = b)
{

remove_btn.dispatchEvent({type:click});
return;
}



myCanvas.createChild(mx.controls.TextArea,
newTxtFld+i)
myCanvas[newTxtFld+i].x=xLoc;
myCanvas[newTxtFld+i].y=yLoc;
myCanvas[newTxtFld+i].visible=true;
myCanvas[newTxtFld+i].width=700-xLoc;
Selection.setFocus(myCanvas[newTxtFld+i]);

myCanvas.removeEventListener(mouseDownSomewhere,
handleMouseDown);
i++;
}
function handleMouseOver(event:Object){
var xLoc=event.target.mouseX;
var yLoc=event.target.mouseY;
var idx=event.target.index;
myCanvas[idx].x=xLoc;
myCanvas[idx].y=yLoc;
myCanvas[idx].width=700-xLoc;
}

function buttonPressed() {
myCanvas.addEventListener(mouseDownSomewhere,
eventListenerObject);

}
function turnOffListener() {

myCanvas.removeEventListener(mouseDownSomewhere,
eventListenerObject);
}

]]
/mx:Script
mx:Text width=100% text=To start adding text, just click 
anywhere.  A new text area will be created to type into. /
mx:Button label=Add More Text click=buttonPressed() /
mx:Button label=Turn on Listener click=createListener() /
mx:Button id=remove_btn label=Turn Off Listener
click=turnOffListener() /
mx:Canvas id=myCanvas 
width=800 height=600

/mx:Canvas
/mx:Application


[flexcoders] Re: MenuBar : How do I snag the Root Field of the Me nu?

2005-04-22 Thread heybluez


Hey,

it works perfectly!!

For everyone else...

mx:MenuBar menuShow=showMe(event) /

function showMe(event) {
  trace(event.menuItem.attributes.label);
}

Thanks,
Michael


--- In flexcoders@yahoogroups.com, Deepa Subramaniam [EMAIL PROTECTED]
wrote:
 You can use the 'menuShow' event to find out when someone has moused
down on
 the childless top-level menuitem. 
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 15, 2005 11:07 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] MenuBar : How do I snag the Root Field of the
Menu?
 
 
 
 Hello.
 
 I have a menubar that has a number of items in it.  These work nicely
 and I can successfully get the child nodes values (i.e.
 event.menuItem.attributes.label).  In the root node I have one
 menuitem that is Logout.  It has no children.  How do I get to this?
 
 I tried mouseDown with the event.menuItem.attributes.label and have no
 luck.  Any ideas?
 
 Thanks,
 Michael
 
 
 
 
 
  
 Yahoo! Groups Links





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] drag drop

2005-04-22 Thread Robert Brueckmann









Thanks Ashish! I couldnt find
anything like that in the documentation anywhere! Thanks a lot.





Robert L. Brueckmann

Senior Web Developer

Merlin Securities, LLC

595 Madison Avenue

New York, NY 10022

p: 212.822.4821
f: 212.822.4820











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Ashish Goyal
Sent: Friday, April 22, 2005 12:36
PM
To: 'flexcoders@yahoogroups.com'
Subject: RE: [flexcoders] drag
drop





You can get the dragging source
byusing -event.dragSource.dataForFormat(source).



Thanks

-Ashish











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 
Sent: Friday, April 22, 2005 9:03
AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] drag drop



Is there any way to get the id of the
component which is the source from which you're dragging items from?

I'm trying to do 2 things on a
page. I have a list of indices and a blank list...the user first can drag
indices over to the blank list and then once they've dragged them over, they
can then drag and drop within the list to order them accordingly...so I have
the initial drag  drop done without a hitch...but I can figure out the
intra-list drag  dropping for ordering purposes...I thought one way would
be in the the doDragOver function, I would simply check the id of the source
and against the id of the destination and if they're equal make it a move
action, otherwise it's a copy action...I can get the id of the destination
without a hitch but I can't figure out how to retrieve the id of the source the
item is being dragged from.

Possible? Should I just
add an up and down arrow next to the list and make them select the items and
call the setChildIndex method on the item in the list instead of doing the
whole drag  drop thing?



Robert L.
Brueckmann



Senior Web Developer



Merlin Securities, LLC



595 Madison Avenue



New York, NY
 10022



p: 212.822.4821
f: 212.822.4820



















This message contains information
fromMerlin Securities, LLC, or from one of its affiliates, that may be
confidential and privileged. If you are not an intended recipient, please
refrain from any disclosure, copying, distribution or use of this information
and note that such actions are prohibited. If you have received this
transmission in error, please notify the sender immediately by telephone or by
replying to this transmission.





Merlin Securities, LLC is a registered
broker-dealer. Services offered throughMerlin Securities, LLC are not
insured by the FDIC or any other Federal Government Agency, are not deposits of
or guaranteed byMerlin Securities, LLCand may lose value. Nothing
in this communication shall constitute a solicitation or recommendation to buy
or sell a particular security.









This message contains information fromMerlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.


Merlin Securities, LLC is a registered broker-dealer. Services offered throughMerlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed byMerlin Securities, LLCand may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










Re: [flexcoders] AnimationPackage

2005-04-22 Thread Duccio





Thanks Alex,
many thanks for your great work!!!
Regards
Duccio Del Ministro

  - Original Message - 
  From: 
  Alex Uhlmann 
  To: flexcoders@yahoogroups.com 
  Sent: Friday, April 22, 2005 9:34 
PM
  Subject: RE: [flexcoders] 
  AnimationPackage
  Yes. Currently, it's indended to use AnimationPackage only 
  in ActionScript 2.0 classes or the MXML Script tag. Here's a quick example for 
  a Script tag. 
  mx:Script 
  ![CDATA[ 
   
   
  import 
  de.alex_uhlmann.animationpackage.*; 
  import 
  de.alex_uhlmann.animationpackage.animation.*; 
  import 
  de.alex_uhlmann.animationpackage.drawing.*; 
  import 
  de.alex_uhlmann.animationpackage.utility.*; 
  import 
  com.robertpenner.easing.*; 
   
   
  function runAnimation() 
  { 
  APCore.initialize(); 
   
   
  var myStar:Star = new 
  Star(275,200,100,25,6); 
  myStar.lineStyle(2,0xff,100); 
  myStar.fillStyle(0xff,100); 
  myStar.draw(); 
   
   
  var mc:MovieClip = 
  myStar.movieclip; 
   
  var myMoveOnQuadCurve:MoveOnQuadCurve = new 
  MoveOnQuadCurve(mc,100,100,300,300,500,100); 
  var myScale:Scale = new 
  Scale(mc,25,25); 
  var myRotation:Rotation = new 
  Rotation(mc,360); 
  var myColorTransform:ColorTransform = new 
  ColorTransform(mc,0xff,50); 
   
  var myAnimation:Animation = new 
  Animation(); 
  myAnimation.addChild(myMoveOnQuadCurve); 
  myAnimation.addChild(myColorTransform); 
  myAnimation.addChild(myScale,0,1000); 
  myAnimation.addChild(myRotation,1000,1500); 
  myAnimation.animationStyle(2000,Circ.easeInOut,"onCallback"); 
  myAnimation.animate(0,100); 
  } 
   
  ]] 
  /mx:Scripti.e. a creationComplete event handler could call the 
  method runAnimation. Basically all the supplied examples of the HTML 
  documentation stay the same.Best,Alex-Original 
  Message-From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] Behalf Of DuccioSent: 22 April 2005 
  18:36To: flexcoders@yahoogroups.comSubject: [flexcoders] 
  AnimationPackageHas anyone tested AnimationPackage(http://www.alex-uhlmann.de/flash/animationpackage/index.htm) 
  or similar in Flex? Any example?Best regardsDuccio Del 
  MinistroYahoo! Groups LinksTo visit your group 
  on the web, go to:http://groups.yahoo.com/group/flexcoders/To 
  unsubscribe from this group, send an email 
  to:[EMAIL PROTECTED]Your use of Yahoo! Groups 
  is subject to the Yahoo! Terms of Service. 
  
  

  No virus found in this incoming message.Checked by AVG 
  Anti-Virus.Version: 7.0.308 / Virus Database: 266.10.0 - Release Date: 
  20/04/2005







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.








No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.0 - Release Date: 20/04/2005


[flexcoders] EventListener for canvas

2005-04-22 Thread kredding.geo


I have successfully set up some code that contains an event listener 
if I mouse down anywhere on a canvas.  From the handler, I can modify 
a text area and move it.  The code for this is shown below.  But what 
I would like to do is access the xy coordinates of the mouse and move 
the text area to those coordinates.  I am trying to access 
event.target.mouseX and event.target.mouseY.  Earlier I had some code 
that would do that successfully using mx:canvas 
mouseDownSomewhere=runfunction() /, but now that I have the event 
listener function set up for the mouseDownSomewhere, it won't work.

Any ideas on how to get the text area to move to where I want it to 
go?

Here is the code with the event Listener:


?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; 
initialize=createListener();
mx:Script
![CDATA[
function createListener() {
myCanvas.addEventListener
(mouseDownSomewhere, handleClickEvent);
}

function handleClickEvent(event:Object) {
myText.text=pressed;
myTA.text=;
myTA.x=100;
myTA.y=100;
myTA.visible=true;
}

function buttonPressed() {
var newTA=myCanvas.createChild
(mx.controls.TextArea, , {text:newtext,x:100,y:100});
Selection.setFocus(newTA);  
}
]]
/mx:Script

mx:Button label=Add More Text click=buttonPressed() /

mx:Canvas id=myCanvas
mx:Text id=myText text=Text /
mx:TextArea id=myTA visible=false 
text=textarea width=200/
/mx:Canvas
/mx:Application







Here is some code that uses the mouseX and mouseY successfully, but 
doesn't include a way for me to turn off the event Listener.  
Essentially, what I want is for this code here to work while adding a 
way to turn the mousedown listener on and off via a button.
'


?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; 
width=100% height=100% 
mx:Script
![CDATA[
//import mx.events.EventDispatcher;

var xDef:Number;
var yDef:Number;
var i:Number=0;

//private var dispatchEvent:Function;
public var addEventListener:Function;
public var removeEventListener:Function;

//function myInit() {
//mx.events.EventDispatcher.initialize(this);
//}

function handleMouseDown(event:Object) {
var xLoc=event.target.mouseX;
var yLoc=event.target.mouseY;
xDef=xLoc;
yDef=yLoc;

myCanvas.createChild
(mx.controls.TextArea, newTxtFld+i)
myCanvas[newTxtFld+i].x=xLoc;
myCanvas[newTxtFld+i].y=yLoc;
myCanvas[newTxtFld+i].visible=true;
myCanvas[newTxtFld+i].width=700-xLoc;
Selection.setFocus(myCanvas[newTxtFld+i]);

myCanvas.removeEventListener
(mouseDownSomewhere, handleMouseDown);
i++;
}
function handleMouseOver(event:Object){
var xLoc=event.target.mouseX;
var yLoc=event.target.mouseY;
var idx=event.target.index;
myCanvas[idx].x=xLoc;
myCanvas[idx].y=yLoc;
myCanvas[idx].width=700-xLoc;
}

function buttonPressed() {
myCanvas.addEventListener
(mouseDownSomewhere, handleMouseDown);

}
function turnOffListener() {
myCanvas.removeEventListener
(mouseDownSomewhere, handleMouseDown);
}
]]
/mx:Script
mx:Text width=100% text=To start adding text, just click 
anywhere.  A new text area will be created to type into. /
mx:Button label=Add More Text click=buttonPressed() /
mx:Button label=Turn Off Listener click=turnOffListener
() /
mx:Canvas id=myCanvas 
mouseOver=handleMouseOver(event) 
width=800 height=600
!--mouseDownSomewhere=handleMouseDown(event)--
/mx:Canvas
/mx:Application


Thank you for you help!!!





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL