[flexcoders] automationName in Components

2007-09-11 Thread Michael Herron
Hi,

I was wondering if it is possible to dynamically set the automationName 
property of a control at runtime? 

For example, if I have a component that contains a label:

MyComponent.mxml
mx:HBox
mx:Label
  id=label
 automationName=componentLabel /
/mx:HBox

And I want to include more than one instance of this component in a single 
application:

mx:Application
MyComponent /
MyComponent /
/mx:Application

How can I write MyComponent such that each instance of label has a unique 
automationName? Is it possible to dynamically provide a automationName for the 
label? So my component would then look like:

mx:HBox
mx:Script
public var labelAutomationName : String ;
/mx:Script
mx:Label
  id=label
 automationName={ labelAutomationName } /
/mx:HBox

And I would use the components like so:

mx:Application
MyComponent labelAutomationName=label1  /
MyComponent labelAutomationName=label2 /
/mx:Application

Is this possible?

Thanks
Mike


  ___ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  
http://uk.promotions.yahoo.com/forgood/environment.html

RE: [flexcoders] RemoteClass

2007-05-29 Thread Michael Herron
Have you strongly reference the com.beans.Sale class in your Application? Your 
RemoteClass meta-data looks fine, but if you've not got a hard reference to the 
class inside your flex app, it won't be compiled in to the SWF and won't be 
mapped correctly at runtime. You can get round this by just adding an unused 
variable somewhere of type com.beans.Sale. (there maybe a more elegant way to 
get round this).

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of André 
Rodrigues Pena
Sent: 28 May 2007 12:48
To: flexcoders@yahoogroups.com
Subject: [flexcoders] RemoteClass

 

Hi all,

I have a Java service that returns an ArrayList of type Sale.
At the Flex application I also have the type Sale, the simplifyed
version is this:

package beans
{
[Managed]
[RemoteClass(alias=com.beans.Sale)]
public class Sale {
public var id:int;
public var customer:Customer;
public var product:Product;
}
}

Although, when I trigger the RemoteObject to retrieve the ArrayList of
Sales (ICollectionView at client), Flex seems to be treating it as a
collection of Object, not Sale.

Is this conversion (Object - Sale) to be done automatically? What's wrong?
thanks

-- 
André Rodrigues Pena

LOCUS
www.locus.com.br

 



[flexcoders] createChild with dynamically loaded classes

2006-08-08 Thread Michael Herron










Hi all,



Im having a very specific problem with createChild
calls that I will try to sum-up as briefly as possible:



A.SWF
loads B.SWF through a Loader component, both are originally flex
applications. A invokes a particular
method on B, passing down an instance
of Panel. In this method, B tries to perform a createChild call on
the passed panel, using a class definition contained
only in B and not in A. This results in a HTTP request being made (http://localhost:/WebApp/[type%20Function])
 looking at the Flex source, this seems to be the result of an attachMovie call returning undefined,
causing a call to loadExternal
from within the createClassObjectWithStyles method
in the View class.



The documentation for MovieClip.attachMovie (http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004file=1487.html#3998340)

 seems
to suggest that what Im trying simply cannot be done (without including a reference to the class
to be created within A.SWF, which
defeats the purpose of this slightly). From the documentation comments:





chi chi latté said on Feb
16, 2005 at 2:52 PM : 

I was having problems attaching
symbols into mcs loaded dynamically using loadMovie().

Somebody's written above that it's not too easy...

 No screen name said on Oct 6, 2004 at 1:42 AM :

 Anyone know if the movieclip used in the attachmovie call must belong
 in the current clip's library? (and not the library of an external
swf)
 It doesn't seem to attach them if this is the case. 

JohnGrden said on Nov 5, 2004 at 7:44 AM :
 Yes, the linked clip MUST be in the library of the clip calling
attachMovie.

Well you can do it without too much bother. 

If you are using loadMovie(), and you're attaching clips into it and out of it, just make sure the symbol is in both libraries
(being exported in one swf, and imported in the other), and
place the imported symbol onto the stage of the swf which does not have the
symbol native to its library. That make sense? 
Note: you _have_ to place it on the non-native stage. Setting it as
imported in the library is not enough. I put them hidden for one
frame.

This is really useful if you've got a big project of several swfs, and you want
to attach some common mcs into the loaded swfs.

Hope that helps+is not too garbled 





mspres said on Mar 10,
2005 at 12:57 PM : 

Note: attachMovie() WILL work with
shared asset symbols unless the movie is loaded into another movie. For
example, consider that assetsUser.swf uses attachMovie() on shared asset symbols
imported from assets.swf. This works fine until a third movie,
assetsUserLoader.swf is used to load assetsUser.swf. Preloading the assets.swf
with assetsUserLoader.swf does not solve the problem. The only solution is to include design-time instances
of the shared asset symbols on assetsUser.swf stage; which, defeats the
reasoning for using attachMovie.

The root of this bug and its various symptoms span across many topics. 







Can anyone confirm this definitely cannot be done,
and there is no work-around? (Note that debug statements show everything else
up as being ok, the method on B is invoked, the class definition is visible,
the parents panel reference is fine, Im 99% sure its the attachMovie
call that is returning undefined). 



Any advice, suggestions etc greatly appreciated.
Thanks in advance!



(Code samples can be provided if it would help).



Cheers

Mike




__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  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: Question about Enable / Disable Validator

2005-11-16 Thread Michael Herron










From a cairngorm View Helper you should usually use syntax
like:



mx.validators.Validator.disable(view,
modelName.elementName);



There isnt really a current
document in flex, the first argument you need to provide is just a
reference to the document that the mx:Model you are validating against
was declared on. So from a view helper, the view property does
this.



-Mike









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Libby
Sent: Tuesday, November 15, 2005
6:25 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Question
about Enable / Disable Validator





Ok, further testing makes me
think that my pointer to the current
document is not always good. I am getting it by
using
mx.application.application.objectName.objectName...
Is this the
wrong way to do this, is there a better way to get
to the current
document? I apologize if this is a dumb question
as I am pretty new to
Flex development.

Thanks,
Libby

--- In flexcoders@yahoogroups.com,
Libby libby[EMAIL PROTECTED]
wrote:

 I am disabling the right one, but that's all
I am doing. It seems to
 me I need to do something to tell flex to
repaint the screen, which
 would then remove the red border since the
validator is not being
 invoked. Is this wrong?
 
 --- In flexcoders@yahoogroups.com,
Matt Chotin [EMAIL PROTECTED] wrote:
 
  Hmm, disabling the validator usually
does clear any borders, you sure
  you disabled the right one? 
  
  
  
  
  
  From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On
  Behalf Of Libby
  Sent: Monday, November 14, 2005 5:52 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Question about Enable
/ Disable Validator
  
  
  
  If you have a validator enabled and an
error has been thrown (the
  field is red border), then you disable
the validator, the border stays
  red. How can you force the red border to
go away after you disable the
  validator? Somehow you need to repaint
the screen...?
  
  Thanks,
  Libby
  
  
  
  
  
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.com

  
  
  
  
  SPONSORED LINKS 
  
  Web site design development
 
http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+
 
site+design+developmentw2=Computer+software+developmentw3=Software+des
 
ign+and+developmentw4=Macromedia+flexw5=Software+development+best+prac
 
ticec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ 
  
  Computer software development
 
http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=We
 
b+site+design+developmentw2=Computer+software+developmentw3=Software+d
 
esign+and+developmentw4=Macromedia+flexw5=Software+development+best+pr
  acticec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw

  
  Software design and development
 
http://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=
 
Web+site+design+developmentw2=Computer+software+developmentw3=Software
 
+design+and+developmentw4=Macromedia+flexw5=Software+development+best+
 
practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ 
  
  Macromedia flex
 
http://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+
 
developmentw2=Computer+software+developmentw3=Software+design+and+deve
 
lopmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=1
 
66.sig=OO6nPIrz7_EpZI36cYzBjw 
  
  Software development best practice
 
http://groups.yahoo.com/gads?t=msk=Software+development+best+practice
 
w1=Web+site+design+developmentw2=Computer+software+developmentw3=Softw
 
are+design+and+developmentw4=Macromedia+flexw5=Software+development+be
 
st+practicec=5s=166.sig=f89quyyulIDsnABLD6IXIw 
  
  
  
  
  
  
  
  YAHOO! GROUPS LINKS 
  
  
  
  * Visit
your group flexcoders
  http://groups.yahoo.com/group/flexcoders
 on the web.

  * 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/
. 
  
  
  
  
 














--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of 

RE: [flexcoders] Accessing the root of a custom component

2005-10-10 Thread Michael Herron










You dont need an ID as the
properties from the super class are within the this scope of the
custom component..so if you extended the TextInput and wanted to set the text
property:



mx:TextInput creationComplete=setDefault()



 public
function setDefault(){

 //Sets
the text property to a default value

 text=default

}



/mx:TextInput



-Mike









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alban Soupper
Sent: 10 October 2005 09:12
To: Flexcoders (E-mail)
Subject: [flexcoders] Accessing
the root of a custom component





Hi all,

is there a workaround to the fact that id is
not allowed on root node?
How can I access the root node of a custom
component to change its property?

Best regards,
Alban.


***

This email and any files transmitted with it are
confidential and
intended solely for the use of the individual or
entity to whom they
are addressed. If you have received this email in
error please notify
the system manager to [EMAIL PROTECTED]

***









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  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] Cairgorn Bug?

2005-09-16 Thread Michael Herron










There are only so many things it can be:




Have you
registered the event correctly with the controller?


Has the
controller been instantiated?


Has the
controller been instantiated BEFORE the event is broadcast? 

o
When is
the event broadcast?


Are you instantiating
a delegate from within your command?


Are all
services required by the delegates available when they are constructed?



-Mike









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Omar Ramos
Sent: 16 September 2005 15:40
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Cairgorn
Bug?







Nope, This is the call
EventBroadcaster.getInstance().broadcastEvent(ScrapblogController.EVENT_SELECT_OBJECT,
eventObj); The command only implements the Command interface and only has a if
and a switch statement on execute thats it. 



















On 9/16/05, Mercer,
Dustin [EMAIL PROTECTED]
wrote: 



Just curious, do you use any viewhelpers within your command?











From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On Behalf Of Omar Ramos
Sent: Friday, September 16, 2005
5:54 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Cairgorn
Bug?







I have set traces all over the place. No errors are
occurring and the command gets executed. Any Idea what could be the problem? 



On
9/14/05, Omar Ramos  [EMAIL PROTECTED]
wrote: 

Thanks
alot for your reply ali, If in fact there was an error why the piece of code
beneth that line doesn't get executed? I am checking the command it is
executing just fine. Gona check on it again. 







On
9/14/05, Alistair
 McLeod 
[EMAIL PROTECTED]  wrote: 

Hi Omar,



An exception is probably getting thrown somewhere, either in
the EventBroadcaster because the event hasn't been registered with a command,
or within your command itself. 



Have you checked flashlog.txt (ensure you have debug player,
mm.cfg etc).



Ali







--

Alistair McLeod 
Development
Director 
iteration::two



[EMAIL PROTECTED]

Office:
+44 (0)131 338 6108 


This
e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately. 


Please also note that while software systems have been used to try to
ensure that this e-mail has been swept for viruses, iteration::two do not
accept responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out before
any attachments are opened. 















From: flexcoders@yahoogroups.com
[mailto:
flexcoders@yahoogroups.com] On Behalf Of Omar
Ramos
Sent: 14 September 2005 00:43
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairgorn
Bug?







Hi there,











There is
something strange going with cairngorm in the application am currently
developting. It seams that when I do a broadcast the lines of code beneth if
doesn't execute. 





I do
this.











EventBroadcaster.getInstance().broadcastEvent(ScrapblogController.EVENT_SELECT_OBJECT,
eventObj);
trace(TEST); 

















and the
trace never apears or the code beneth it never gets executed. Any ideas?























Omar
Ramos





System
Developer







--
Flexcoders Mailing List 
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt

Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com






SPONSORED LINKS 




 
  
  Web site design development 
  
  
  Software design and development 
  
  
  Macromedia flex 
  
 
 
  
  Software development best practice 
  
  
  
  
  
  
  
 














YAHOO! GROUPS
LINKS 




 Visit your group
 flexcoders
  on the web.
  
 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 Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 















YAHOO!
GROUPS LINKS





 Visit your group
 flexcoders
 on the web.
 
 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 Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  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: Dynamic Tree and VO's

2005-08-05 Thread Michael Herron










How about 



event.selectedItem.attributes.postcode?



I guess label works as its kind of native to the tree..



Mike.









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bhaq1972
Sent: 05 August 2005 13:09
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Dynamic
Tree and VO's





try

event.selectedItem.postcode
or
event.selectedItem.POSTCODE
or
event.selectedItem['postcode']


--- In flexcoders@yahoogroups.com,
digital_eyezed 
[EMAIL PROTECTED] wrote:
 Sorry, that didn't work either.
 
 Any other ideas??
 
 --- In flexcoders@yahoogroups.com, João
Fernandes 
 [EMAIL PROTECTED] wrote:
  Hi Iain,
  
  
  
  Try with selectedNode instead
selectedItem.
  
  
  
  João Fernandes
  
  Secção de Desenvolvimento
  
  Departamento de Informática
  
  
  
  From: flexcoders@yahoogroups.com 
 [mailto:[EMAIL PROTECTED] On Behalf
Of digital_eyezed
  Sent: sexta-feira, 5 de Agosto de 2005
12:03
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Dynamic Tree and
VO's
  
  
  
  Hi,
  
  I have a tree which is populated
(through the dataProvider) from 
a 
  returned array of VO's from a
RemoteObject Call. Within the VO 
is 
 a 
  number of attributes, two of the
attributes are called data and 
 label. 
  The tree shows ok. I want to be able to
extract the other 
 attributes 
  that are associated with this
selectedItem and can't seem to get 
 the 
  data out. How do I do this? For example,
another attribute is 
  call 'postcode' so I tried to use
change=myVariable = 
 
event.selectedItem.getProperty('postcode') but this did not 
work, 
  although if I change the 'postcode' to
'label' then I get the 
 label.
  
  Can you help?
  
  Regards,
  
  Iain
  
  
  
  
  --
  Flexcoders Mailing List
  FAQ: 
 http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Search Archives: http://www.mail-archive.com/flexcoders%
 40yahoogroups.com 
  
  
  
  
  
  
  YAHOO! GROUPS LINKS 
  
  
  
  * Visit
your group flexcoders 
 http://groups.yahoo.com/group/flexcoders
 on the web.

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

[EMAIL PROTECTED] 

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











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  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] date.getUTCMonth / date.getUTCDate with a leading zero

2005-08-01 Thread Michael Herron










Look up the dateFormatter class (mx.formatters.DateFormatter). In your
format function, create an instance of it and supply it with the format string DD\MM\
and that should give you what you want.



Ta.













From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Reto M. Kiefer
Sent: 01 August 2005 09:22
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
date.getUTCMonth / date.getUTCDate with a leading zero





Dear all,

maybe I am simply do not see the crucial point but
I have a small 
problem. In a form the users can enter some dates
via

 mx:DateField
id=compBop dateFormatter=formatDate /

The corresponding formatDate() looks like this
one:

function formatDate(date:Date):String
{
return (date.getUTCDate() + 1) + - + (
date.getUTCMonth() + 1 ) + - 
+ date.getUTCFullYear();
}

This works quite good, but I want have a leading 0
if the Day or the 
month conists of only on digit, e.g. 02 instead of
2 for february.

I searched all the variants of date.UTC() but
did not saw an option 
for this. I assume there is one because you can
have the year displayes 
with 4 or 2 digits...

Maybe some is so helpful and can provide me with
the proper function 
call or a workaround if there is no such a call.

Thanks in advance and best regards

Reto








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  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] Creation events and view stack children

2005-06-30 Thread Michael Herron










Hi all, a quick question
about view stack instantiation:



If I have a view stack,
creation policy auto, with two children:

 

 mx:ViewStack
creationPolicy=auto

 components:ChildOne
/

components:ChildTwo /

 /mx:ViewStack



 ChildOne.mxml:

 mx:HBox

creationComplete=trace(child one created)



 !--
stuff in here --

 /mx:HBox



 ChildTwo.mxml:

 mx:HBox

creationComplete=trace(child two created)



 !--
stuff in here --

 /mx:HBox



In what order are the creationComplete events fired for the
children? I seem to be witnessing behaviour where the creation complete events
are being fired immediately, when the view stack is instantiated, but the
actual components within the children are not being instantiated until the selected
index of the view is changed (as you would expect from creationPolicy=all).
Does this sound reasonable? Has anyone experienced this kind of behaviour? I
was under the impression that the creationComplete event for the top-level components
themselves would not fire until the view stack index changed.



(Apologies for the lack of
a complete code sample (spread across several files Im afraid), but
hopefully what Ive said is enough to explain the problem)



Cheers,

Mike.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



  
  





  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  








--**STATEMENT OF CONFIDENTIALITY** 
This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.
We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.--



[flexcoders] Event Listeners

2005-05-19 Thread Michael Herron










All,



I am having a problem with removing event listeners on a
panel.



I am adding the event listener like so:



 pane.addEventListener(contentCreated, Delegate.create(this, handleEvent) );



But trying to remove the event listener
using removeEventListener does not seem to work. I have tried several variants:

 

 pane.removeEventListener(contentCreated, Delegate.create(this, handleEvent) );

 pane.removeEventListener(contentCreated, Delegate.create(this) );

 pane.removeEventListener(contentCreated, this.handleEvent );

 pane.removeEventListener(contentCreated, this );



and none seem to work. Ive been struggling
with this for a good few hours and its driving me crazy, any help would be appreciated.



Ta

Mike Herron











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] Event Listeners

2005-05-19 Thread Michael Herron










Hi Alistair,



That worked perfectly, cheers!











From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alistair McLeod
Sent: 19 May 2005 12:31
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Event
Listeners





Hi Michael,



I imagine its because your event listener is an anonymous
function, so the removeEventListener must be passed a reference to the same
function. Try this (untested)



myHandler : Function = Delegate.create( this,
handleEvent ); 

pane.addEventListener(contentCreated,myHandler );









...











pane.removeEventListener(contentCreated,myHandler );











myHandler may have to be stored asan
instance variable if (as I suspect) the add and remove are in different scope.











Please let us know if that works.











Ali











--

Alistair McLeod
DevelopmentDirector



iteration::two
[EMAIL PROTECTED]











Office: +44 (0)131 338 6108











This e-mail and any associated attachments
transmitted with it may contain confidential information and must not be
copied, or disclosed, or used by anyone other than the intended recipient(s).
If you are not the intended recipient(s) please destroy this e-mail, and any
copies of it, immediately.

Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out before
any attachments are opened.

























From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Herron
Sent: 19 May 2005 12:18
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Event
Listeners

All,



I am having a problem with removing event listeners on a
panel.



I am adding the event listener like so:




pane.addEventListener(contentCreated, Delegate.create(this, handleEvent) );



But trying to remove the event listener
using removeEventListener does not seem to work. I have tried several variants:





pane.removeEventListener(contentCreated, Delegate.create(this, handleEvent) );


pane.removeEventListener(contentCreated, Delegate.create(this) );


pane.removeEventListener(contentCreated, this.handleEvent );


pane.removeEventListener(contentCreated, this );



and none seem to work. Ive
been struggling with this for a good few hours and its driving me crazy, any
help would be appreciated.



Ta

Mike Herron












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.












Help with a custom component

2005-03-11 Thread Michael Herron
Hi all.

 

I'm looking for some help with custom components. Basically, I have done
a bit of a hack and managed to get something that appears to the user as
an editable date field, by placing a TextInput over top of a DateField
control and capturing the required events (see attached for the code).
Its ugly, but it seems to work to a certain extent. The problems start
when I try to incorporate validation in to the test page. Placing a form
item with required set to true around the component along with a
validator tag doesn't seem to perform the necessary validation.
Sometimes typing the date directly will run the validator, but the
hidden DateField seems to be the component that changes color.
Basically, what im asking is:

 

* Can this approach be adapted to include validation from the
parent application that uses the component?

* Or, is there an easier, more elegant way to provide an
editable date field? (The docs indicate editable property inherited
from ComboBase will be ignored)

 

Cheers,

Mike


--_=_NextPart_002_01C52620.4339BDD6
Content-Type: text/html;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable

html xmlns:o=urn:schemas-microsoft-com:office:office 
xmlns:w=urn:schemas-microsoft-com:office:word 
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=us-ascii
meta name=Generator content=Microsoft Word 11 (filtered medium)
style
!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:Times New Roman;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1295646861;
mso-list-type:hybrid;
mso-list-template-ids:1436176978 -1107641160 67698691 67698693 67698689 
67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:54.0pt;
mso-level-number-position:left;
margin-left:54.0pt;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Times New Roman;
mso-bidi-font-family:Arial;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--
/style

/head

body lang=EN-US link=blue vlink=purple

div class=Section1

p class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;
font-family:Arial'Hi all.o:p/o:p/span/font/p

p class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;
font-family:Arial'o:pnbsp;/o:p/span/font/p

p class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;
font-family:Arial'I#8217;m looking for some help with custom components. 
Basically,
I have done a bit of a hack and managed to get something that appears to the
user as an editable date field, by placing a TextInput over top of a DateField
control and capturing the required events (see attached for the code). Its
ugly, but it seems to work to a certain extent. The problems start when I try
to incorporate validation in to the test page. Placing a form item with
required set to true around the component along with a validator tag 
doesn#8217;t
seem to perform the necessary validation. Sometimes typing the date directly
will run the validator, but the #8220;hidden#8221; DateField seems to be the
component that changes color. Basically, what im asking 
is:o:p/o:p/span/font/p

p class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;
font-family:Arial'o:pnbsp;/o:p/span/font/p

p class=MsoNormal style='margin-left:54.0pt;text-indent:-18.0pt;mso-list:l0 
level1 lfo1'![if !supportLists]font
size=2 face=Symbolspan style='font-size:10.0pt;font-family:Symbol'span
style='mso-list:Ignore'middot;font size=1 face=Times New Romanspan
style='font:7.0pt Times New 
Roman'nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
/span/font/span/span/font![endif]font size=2 face=Arialspan
style='font-size:10.0pt;font-family:Arial'Can this approach be adapted to 
include
validation from the #8220;parent#8221; application that uses the 
component?o:p/o:p/span/font/p

p class=MsoNormal style='margin-left:54.0pt;text-indent:-18.0pt;mso-list:l0 
level1 lfo1'![if !supportLists]font
size=2 face=Symbolspan style='font-size:10.0pt;font-family:Symbol'span
style='mso-list:Ignore'middot;font size=1 face=Times New Romanspan
style='font:7.0pt Times New 
Roman'nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
/span/font/span/span/font![endif]font size=2 face=Arialspan
style='font-size:10.0pt;font-family:Arial'Or, is there an easier, more elegant
way to provide an editable date field? (The docs indicate #8220;editable#8221;
property nbsp;inherited from ComboBase will be 

RE: [flexcoders] Cairngorm view helpers and dynamic loading of content

2005-03-08 Thread Michael Herron








Hi Jimmy,



I wasnt actually aware of the unregisterView
method on the view helper! After adding this, the problem seems to be solved
(cheers Steven). 









From: Dimitrios
Gianninas [mailto:[EMAIL PROTECTED] 
Sent: 07 March 2005 13:55
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders]
Cairngorm view helpers and dynamic loading of content





Hi
Michael,



I think
the answer to your question is as simple as calling the unregisterView()
method on the correct ViewHelper when you are destroying that view all
together. Give that a try and let us know.







Jimmy
Gianninas

Software
Developer - Optimal Payments Inc.















From:Michael
Herron [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 07, 20058:40
AM
To: [EMAIL PROTECTED]
Subject: [flexcoders] Cairngorm
view helpers and dynamic loading of content

Hi all



Currently, I have a framework where separate
modules are loaded in to a central panel using the createChild
method. The reason for using this method as opposed to a view stack for example
is the amount of these modules that I could potentially have is
huge and it seems easier/cleaner to load the modules when required. And also,
correct me if im wrong, but if a view stack was used, would each module notbe
loaded upon first navigating to it and then be retained in memory?



When the user first selects a menu option and the required
module is loaded, all works fine. The user may then navigate to another
module, whereupon the initial module is destroyed using the destroyAllChildren
method and the new module loaded. The problem occurs if the user then triesto
return to the original module. The module will attempt to register its view
helper which will in turn cause the view locator to throw an error, as the view
name has already been registered in the array of view helpers - even thoughthe
view and view helper where destroyed when the new module was loaded. This is
also problem for reusable components that are being made use of inside the
modules.



To confirm that this was the problem, I commented out the
view locators error checking and all worked fine. The way I see it, the only
solutions are:




Cairngorm view helpers and dynamic loading of content

2005-03-07 Thread Michael Herron








Hi all



Currently, I have a framework where separate modules
are loaded in to a central panel using the createChild method. The reason for
using this method as opposed to a view stack for example is the amount of these
modules that I could potentially have is huge and it seems easier/cleaner
to load the modules when required. And also, correct me if im wrong, but ifa
view stack was used, would each module not be loaded upon first navigating to
it and then be retained in memory?



When the user first selects a menu option and the required
module is loaded, all works fine. The user may then navigate to another
module, whereupon the initial module is destroyed using the destroyAllChildren method
and the new module loaded. The problem occurs if the user then tries to return
to the original module. The module will attempt to register its view helper
which will in turn cause the view locator to throw an error, as the view name
has already been registered in the array of view helpers - even though the view
and view helper where destroyed when the new module was loaded. This is also problem
for reusable components that are being made use of inside the modules.



To confirm that this was the problem, I commented out the
view locators error checking and all worked fine. The way I see it, the only
solutions are:




Use a view stack and switch the selectedIndex
rather than using createChild/destroyChild  perhaps this should have
been the correct design choice used in the first place? Using this method the components
problem is also solved as the view can be registered through action script with
the view already exists error being caught, and just reassigning the
view attribute of the existing view helper to point to the existing instance of
the component.




Add a forceRegister method to the
view locator that will not perform the check for an existing view, write myown
view helper class that will override the set name method and call this method.
This method is obviously not ideal. Cairngorm is a solid framework and things
like existing view helper checking exist for a reason.



Any thoughts/suggestions?

Cheers,

Mike Herron










RE: [flexcoders] newbie

2005-03-03 Thread Michael Herron








Hi,



This is an issue that I have also had to
deal with recently.



I had limited success using code similar
to that which you have outlined below. The major problem is that pressing CTRL
+ the majority of keys causes the browser to intercept these key presses and
perform its own actions. Trying ctrl + almost every key on the keyboard
resulted in only getting about 6 or so CTRL + key combinations being made available
to me. Trying ALT + key was even less successful as the flash player just
seemed to loose focus entirely, with the browser menu then being given focus.



Has anybody else had any success with key
board shortcuts? At first glance, it doesnt seem to be possible to
provide logical keyboard navigation on forms with more than a handful of
controls. Of course, tab navigation is still possible.











From: Abdul Qabiz
[mailto:[EMAIL PROTECTED] 
Sent: 03 March 2005 16:19
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] newbie





Hi,

1) Yeah, you can trap the keyboard events using
ActionScript. You can use
keyDown event with Key object tofind
about pressed keys.. See example
code later in the mail.

2) you can use the combination of mouseDown,
mouseMove  mouseUp event to
make dragging happen. Look at Manish's Google map
example, see how he is
dragging...

http://manish.revise.org/archives/2005/02/12/no-more-xml-from-google-maps/





##ShortCutKeyExample.mxml###

?xml version=1.0?
!-- Simple example to demonstrate the
TabNavigator layout --
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml
width=100%
height=100%
backgroundColor=#FF initialize=onAppInit();
mx:Script
 ![CDATA[
 var shortcutManager;
 
 function onAppInit()
 {

shortcutManager = new Object();

shortcutManager.owner = this;

shortcutManager.>
handleKeyEvent);

Key.addListener(shortcutManager);
 
 }
 
 function handleKeyEvent(event)
 {
 
 
 var
bCTRLDown = Key.isDown(17); //17 is keycode of CTRL key
 
 

if(bCTRLDown) {

if(Key.getCode() == 84) {

tb.selectedIndex = 1;

}else if(Key.getCode() == 69) {

tb.selectedIndex = 0;

}

}

 }
 
 
 
 
 
 ]]
/mx:Script

 mx:Panel title=Tab
Navigator Panel width=100% height=100%


mx:TabNavigator id=tb borderStyle=solid
width=100%
height=100%


mx:Canvas label=Canvas 1 (CTRL + E) width=100%
height=100%
backgroundColor=#CC

mx:Label text=Add components here fontSize=20
fontStyle=italic

fontWeight=bold fontFamily=Times New Roman/


/mx:Canvas


mx:Canvas label=Canvas 2 (CTRL + T) width=100%
height=100%
backgroundColor=#99CCFF

mx:Label text=Add components here fontSize=20
fontStyle=italic

fontWeight=bold fontFamily=Times New Roman/

/mx:Canvas


/mx:TabNavigator

 /mx:Panel

/mx:Application


-abdul




-Original Message-
From: Doodi, Hari - BLS CTR [mailto:[EMAIL PROTECTED]

Sent: Thursday, March 03, 2005 8:29 PM
To: 'flexcoders@yahoogroups.com'
Subject: [flexcoders] newbie

Hi members,
 
 I am new to Flex
coding. I did learn a lot from coenraets web site
and also from richinternetapps.com. I do really
appreciate them for letting
others to see their code and learn from it. 

I do have couple of issues to resolve. I didtry
search on Livedocs and
other websites for solutions but didn't findany.

1) Can any one
programmed hotkeys(keyboard shotcuts) in flex ? for
example, instead of using mouse to click on tab of
TabNavigator container
users can use keyboard shortcuts say Ctrl+T or
Alt+T something like this.
There will be a problem using Alt as accesskey
because Alt key has been used
for windows hotkeys. Please help.

2) My user requires
that they should be able to zoom a scanned image
and then move/drag that image. I did accomplished
zooming part but unable to
drag the image. Here is the mxml file for your
ref.


manageSchedule_3.mxml
Thanks in advance.

Thanks!
Hari




Yahoo! Groups Links














RE: [flexcoders] Cairngorm and deferred instantiation

2005-02-18 Thread Michael Herron








Steven,



Take your point, just wanted to see if
there was anybody else that had come across this

or found any different solutions. 



Not wanting to get the view helper on
demand was just a small point of style, it just 

made sense to get the view helper in the
constructor. Like you said though, 

clarity before brevity.



Cheers,

Mike











From: Steven Webster
[mailto:[EMAIL PROTECTED] 
Sent: 18 February 2005 13:21
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders]
Cairngorm and deferred instantiation





Michael,



There's really no harm in the strategyof
locating the view helpers on demand where you need them, in the

execute(), onResult() or onFault()
methods; is your motive for creating them in the constructors simply to

save on typing out the
ViewLocator.getInstance.getViewHelper( ... ) ? 



I'd go for clarity over brevity every time









Steven











From:Michael
Herron [mailto:[EMAIL PROTECTED] 
Sent: 18 February 2005 11:12
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] Cairngorm
and deferred instantiation

Steven,



The problem is that the front controller
for the entire application will still be instantiating all the required command
classes at start up.

The command classes in turn will use the
view locator in their constructors to get the view helpers they need. So
even though the 

command hasnt been called and
doesnt actually need to use the view; it is still trying to get an
instance of the required view helper.



Sorry if im not making this totally clear!
Like I said, the other solution is to only get the view helper instance when
the view is required,

i.e. in execute(), onResult() and
onFault(). 



The perfect solution? Cairngorm components
with completely self contained services, controller and view locators wouldbe
fantastic ;) Seriously 

though, I do see your point, it is an
architectural problem that needs more thought.



Sorry for the lack of details, I can write
up a fuller description if required.



Cheers,















[no subject]

2005-02-17 Thread Michael Herron










A

Sd 










RE: [flexcoders] Cairngorm and deferred instantiation

2005-02-17 Thread Michael Herron








Thats certainly a workable
strategy, but from a design point of view the separate tabs (in
reality a view stack but works on same principles) are really applications
within their own right and I would like to be able include them just by passing
their root mxml name. Also, children will be added at run time to the view
stack using the create child method so I dont want to have to defineall
the required view helpers for applications that may not be loaded.



Looks like I will have to use the view
locator 3 separate times in the execute, onResult and onFault methods











From: Dimitrios
Gianninas [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2005 16:00
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders]
Cairngorm and deferred instantiation





Hi,



Put the
ViewHelper(s) at a higher level, I use TabNavigators and ViewStacks in several
places in my UI, but I do not have a ViewHelper per tab/stack. Just one forthe
whole bunch.







Jimmy
Gianninas

Software
Developer - Optimal Payments Inc.















From:Michael
Herron [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 17,2005
10:47 AM
To: [EMAIL PROTECTED]
Subject: [flexcoders] Cairngorm
and deferred instantiation

Hi All



Apologies for the blank post. 



My problem is this: When using a tab
navigator/view stack or any other component that uses deferred instantiation,
the required view helpers are not created at start up. That is, they are
children of tab navigator and not loaded until required, i.e. until the user
opens the required tab. When my commands are instantiated, they try to use the
view locator to get the required view helpers. Of course, this causes problems.
The only solutions I can see are:




Cairngorm Event to Command

2005-02-04 Thread Michael Herron
Hi all


Just a quick question about using cairngorm:

In my application when a product has been added, I wish to broadcast a
product added event and have it picked up by two separate command classes
that will update two separate views. Unfortunately, when the event is
broadcast, it only seems to be picked up by the command class that was
registered last in the controller. 

To get round this I am having to broadcast two separate events specific to
the two views once a product has been added. Obviously, this doesn't provide
as high a level of de-coupling as I would like.

Has anyone else come across this problem? Am I doing something wrong or is
this a know quirk?


Cheers,
Mike





RE: [flexcoders] Cairngorm Event to Command

2005-02-04 Thread Michael Herron
The command classes already exists and work in their own right for their
respective views. I will not always want to update both the views at the
same time. 

You seem to be getting confused with the purpose of the event. The event is
broadcast once the product has been added, not when the product is required
to be added. I then want to be able to specify in my front controller:

addCommand(productAdded, new CommandToUpdateViewOne());


-Original Message-
From: Alex [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 04 February 2005 12:47
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm Event to Command


Not sure why it requires to create a new command class. 
onResult function in your command class that is assigned with add product
event would be something like 

public function onResult( event : Object ) : Void
{
var view1ViewHelper =
ViewLocator.getInstance().getViewHelper( view1 );
var view2ViewHelper =
ViewLocator.getInstance().getViewHelper( view2 );
view1ViewHelper.doSomethingInView1();
view2ViewHelper.doSomethingInView2();
}

Alex.

-Original Message-
From: Michael Herron [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 04, 2005 3:39 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Cairngorm Event to Command


Yes that would certainly work, but that would involve creating a new command
class. I was wanting to re-use the command classes that are currently being
used, but just fire them both for the same event.

Although your solution does seem more elegant that broadcasting multiple
events.

-Mike

-Original Message-
From: Alex [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 04 February 2005 12:11
To: flexcoders@yahoogroups.com
Subject: FW: [flexcoders] Cairngorm Event to Command


Hi Mike, 

I presume nothing prevents you from accessing two different views via
ViewLocator singleton within one command.

Regards,
Alex.

-Original Message-
From: Michael Herron [mailto:[EMAIL PROTECTED]
Sent: Friday, February 04, 2005 2:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm Event to Command


Hi all


Just a quick question about using cairngorm:

In my application when a product has been added, I wish to broadcast a
product added event and have it picked up by two separate command classes
that will update two separate views. Unfortunately, when the event is
broadcast, it only seems to be picked up by the command class that was
registered last in the controller. 

To get round this I am having to broadcast two separate events specific to
the two views once a product has been added. Obviously, this doesn't provide
as high a level of de-coupling as I would like.

Has anyone else come across this problem? Am I doing something wrong or is
this a know quirk?


Cheers,
Mike




Yahoo! Groups Links










Yahoo! Groups Links










Yahoo! Groups Links










Yahoo! Groups Links