Re: [flexcoders] Re: Getting Its Function Name...

2008-12-02 Thread Ralf Bokelberg
If you want to call the current function recursively, you can use
arguments.callee

function something( count : int )
{
trace( count );
if( count  0 ) arguments.callee( count-- );
}

Cheers
Ralf.

On Tue, Dec 2, 2008 at 1:02 AM, Josh McDonald [EMAIL PROTECTED] wrote:
 That'll only work in AS2 or dynamic AS3 objects, I think. But it's easy
 enough to cook up the same thing using DesrcibeTypeCache.

 -Josh

 On Tue, Dec 2, 2008 at 9:36 AM, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, flexawesome [EMAIL PROTECTED]
 wrote:
 
  Awesome Alex!
 
  It's a bit buggy , but helpful :)

 Not sure this is any less buggy, but here's a slightly different
 approach:
 http://www.actionscript.org/forums/showthread.php3?t=86924


 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links






 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk
 


[flexcoders] How to set variableRowHeight = true in MenuBar

2008-12-02 Thread nathanleewei
I want make the same effect as following url:

http://blog.flexexamples.com/2008/10/02/adding-a-horizontal-separator-
to-a-flex-popupbutton-controls-pop-up-menu-redux/


I haved tried 2 methods to solve the problem,

//method 1
private function onMenuBarInitialize():void {   
var menu:Menu;
for (var i:int = 0; i  menuBar.menus.length; i++) {
menu = menuBar.menus[i];
menu.variableRowHeight = true;
}
}

//method 2
private function onMenuShow(event:MenuEvent):void {
var t:MenuBar = event.currentTarget as MenuBar;
event.menu.variableRowHeight = true;
}


mx:MenuBar id=menuBar width=100% labelField=@label 
initialize=onMenuBarInitialize iconField=@icon styleName=menuBar 
itemClick=onMenuBar(event) menuShow=//onMenuShow(event)
mx:XMLList
menuitem label=File
menuitem label=New icon=documentIcon /
menuitem label=Open... 
icon=documentIcon/
menuitem type=separator /
menuitem label=Close /
menuitem type=separator /
menuitem label=Save /
menuitem label=Save as... /
menuitem type=separator /
menuitem label=Import... /
menuitem label=Export... /
menuitem type=separator /
menuitem label=Exit /
/menuitem
menuitem label=Edit
menuitem label=Cut /
menuitem label=Copy /
menuitem label=Paste /
menuitem type=separator /
menuitem label=Select All /
menuitem type=separator /
menuitem label=Find /
/menuitem
 /mx:XMLList  
/mx:MenuBar


But, child menu of MenuBar still presents some space at feet when it 
shown(click on MenuBar) for the FIRST time, and It presents normally when it 
shown for the second time.


Maybe it's a BUG of FLEX?! 







Re: [flexcoders] Detect a databinding

2008-12-02 Thread Jules Suggate
Hi Marco, first up you have to ask yourself why you want this feature?
There may be another way to solve the problem. However, here's what I
know of your specific question...

Last time I checked (Flex 3 beta 2) there was no *official* way to
inspect the bindings on a component at runtime. However, if you create
a component with bindings and load it up at runtime, you will find
there are undocumented properties that enable you to do this. Look for
a _watchers array -- you will also find it helpful to keep the
generated actionscript that the Flex compiler normally throws away so
you can read how databinding is implemented.

The properties above are not part of the public API, so could change
at any time. In fact, IIRC some of the very binding properties I just
mentioned may even have been deprecated in the final Flex 3 release...
proceed with caution.

Which is why I ask what the actual problem is you are trying to solve
-- perhaps the list can help you come up with other ideas :-)

For example, your idea of overriding addEventListener is cunning --
perhaps that solution can be explored further.

Cheers,
Jules

On Tue, Dec 2, 2008 at 23:05, Marco Catunda [EMAIL PROTECTED] wrote:
 Hi,

 I have a singleton class with model data provider (like cairngorm model).

 Some user interface components binding this model in data provider property.

 I didn't find out any way to detect if there is binding in this model
 or not, and
 how many bindings.

 The binding model works with events, so my idea was override
 addEventListener
 in singleton model to detect binding. But it don't work because the
 removeEventListener
 isn't call when component go away.

 Does anyone has any tips?

 Regards
 --
 Marco Catunda

 


RES: [flexcoders] Re: Game Architecture

2008-12-02 Thread Luciano Manerich Junior
Hi!

In case of Remote Objects, thats correct, you'll need to query the server time 
to time to get the result of a turn.

About the security of the RO's, its a open connection to your database for 
everyone, i.e, you have a method increaseXP(player, amount), if you dont apply 
the certain security for that, you'll get a lot of max level players in 2min.

In your case, ild go for Consumer/Producer messaging, but, you need to create a 
lot of them for each lobby/room/game, discarding the unwanted messages on the 
server, not consuming bandwith. If you use just one consumer and switch every 
message on Client side you'll have a high use of unnecessary bandwith.

Hope it helps

-Mensagem original-
De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome de someguy7_7
Enviada em: terça-feira, 2 de dezembro de 2008 10:36
Para: flexcoders@yahoogroups.com
Assunto: [flexcoders] Re: Game Architecture

Any thoughts on this?

Thanks
--- In flexcoders@yahoogroups.com, someguy7_7 [EMAIL PROTECTED] wrote:

 Can you give me some more details on the security issues relating to 
 remote objects?
 
 How do you notify the other client when one client has taken a turn 
 with remote objects? Have it poll the server constantly for updates?
 
 Any thoughts on if using a consumer/producer messaging will be good or 
 not scaleable enough for the amount of calls?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com, Samuel Colak sam.colak@ wrote:
 
  Depends on the number of simultaneous clients and the time-impact.
  
  One note to take into account is security of the game - using
sockets  
  does
  not scale in direct user to user communications unless limited to
one  
  or two.
  
  Remote Objects work well but introduce security issues.
  
  Quite often i use remoteobjects for informing of changes to the
state  
  of the system
  and webservices to deal with secure stuff (rewards, purchasing and
so  
  on).
  
  On Dec 1, 2008, at 8:35 AM, someguy7_7 wrote:
  
   I am going to mess around and try to create a multi player
online game
   with flex. Any thoughts on the best way to communicate the users 
   actions back to the server? Remote Objects? Producer/Consumer 
   Messaging? Morse Code?
  
   Thanks
  
  
  
 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links





[flexcoders] Zoom effect absolute positioning

2008-12-02 Thread Ward Loockx
Hello,

I have a canvas within my application that contains polaroid images (own 
flex component). When I click on a polaroid I wan't it to zoom all over 
my application. When I do this now it stays within the canvas and I get 
scrollbars (on that canvas). Is there a way to keep the pictures on the 
canvas and still be able to zoom over my whole application (When zooming 
- go to absolute layout)? Somebody that knows if this is possible ?

Thanks,
Ward


[flexcoders] Re: How to embed icons in MenuBar?

2008-12-02 Thread nathanleewei
It must be 
public var documentIcon:Class;


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

 no shown :(






[flexcoders] Re: How to make a Docking Window Framework/component like Eclipse/InfoDock/JDock

2008-12-02 Thread nathanleewei
http://flexrock.googlecode.com

--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 Somebody on this list has created exactly what you're looking for, 
and it's
 pretty reasonably priced, google the archives.
 
 -Josh
 





[flexcoders] Re: objects bound to datagrid not gc'd when dataprovider set to null

2008-12-02 Thread lmurphy
Could anyone point me in the right direction?

I've removed -

* data binding references
* remote object call references - clearResult

However, after setting the dataprovider for my grid to null - the grid
shows no items, in the debugger the dataprovider has a length of 0 -
there are still references to the objects.

All of the references seem to be coming from datagriditemrenderers (I
do not use any special item renderer, simply the default).  The
reference list/tree is large with and incomprehensible to me - but
they all seem to be coming from classes I don't control.

Any thoughts?



[flexcoders] data serialization

2008-12-02 Thread cooleman_99
Hello,
Im having problem getting the data from java to flex and im totally
new to flex and cairngorm... here is my code snippet:

im my java end:

 ListUsers getAll() {  // from hibernate dao then return result
which llist of users }

in AS files:

public class ListDelegate extends EventDispatcher
{
private var userService:RemoteObject;
private var responder:IResponder;
   
public function ListDelegate(responder:IResponder)
{
this.userService = new 
RemoteObject(userService);
   
this.responder = responder;
}
   
public function getUserList():void
{
   
var call : Object = userService.getAll();
   
call.addResponder( responder );
   
}
}


public class ListUserCommand extends BaseCommand
{
   
   
override protected function callDelegate():void
{
var listdelegate:ListDelegate = new
ListDelegate(this);
listdelegate.getUserList();
}
   
override public function result( event : Object ) : void
{
this.modelHelper.onResultUser(event);
   
}
   
override public function fault( event : Object ) : void
{
var faultevt:FaultEvent = event as FaultEvent;
Alert.show(faultevt.fault.rootCause.toString());
}

}

public class ModelHelper
{
[Bindable]
public var userlist: UserList;
   
public function ModelHelper(userlist: UserList)
{
this.userlist = userlist;
}
   
public function getUserList():void
{
new ListUserEvent(this).dispatch();
}
   
public function onResultUser(event:Object):void
{
this.userlist.listusers = event.result as
ArrayCollection;
}

}

..and i use DataGrid to display datas:

?xml version=1.0 encoding=utf-8?
mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml;
initialize=init()
creationComplete=loadAll() 
   
mx:Script
  ![CDATA[
  import com.test.flex.util.UserList;
  import mx.rpc.events.ResultEvent;
  import com.test.flex.model.ViewModelLocator;
  import com.test.flex.events.ListUserEvent;
  import com.test.flex.model.ModelHelper;
 
  [Bindable]
  private var modelLocator:ViewModelLocator =
ViewModelLocator.getInstance();
 
  [Bindable]
  public var modelHelper:ModelHelper;
  [Bindable]
  public var users:UserList;
 
  public function init():void
  {
this.users = new UserList();
this.modelHelper = new ModelHelper(users);
   
  }
 
  public function loadAll():void
  {
  this.modelHelper.getUserList();
  }
 
 
 
  ]]
 /mx:Script
 
 !-- mx:Label text={modelLocator.test}/ --
 
 mx:DataGrid id=userlist
dataProvider={modelHelper.userlist.listusers}
  mx:columns
  mx:DataGridColumn headerText=ID dataField=id/
  mx:DataGridColumn headerText=Username dataField=username/
  mx:DataGridColumn headerText=Password dataField=password/
  /mx:columns
 /mx:DataGrid
 
   
mx:Button id=logout label=LogOut
click={modelLocator.modelWorkflowState =
ViewModelLocator.LOGIN_SCREEN}/
/mx:VBox

..and the rest are straigthforward code. When I change the return
value to String it works fine nut when put it back to List it display
nothing or error i get but when i debug it i gets the results:

11:20:14,459 INFO  [STDOUT] Hibernate: select this_.ID as ID1_0_,
this_.USERNAME as USERNAME1_0_, this_.PASSWORD as PASSWORD1_0_ from
user this_
11:20:14,464 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG]
[Service.Remoting] Adapter 'java-object' called
'userService.getAll(java.util.Arrays$ArrayList (Collection size:0)
)'
11:20:14,465 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG]
[Service.Remoting] Result: 'java.util.ArrayList (Collection size:2)
  [0] = com.test.flex.model.User
id = 1
username = eman
password = password

  [1] = com.test.flex.model.User
id = 2
username = test
password = password

'
11:20:14,465 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG] [Message.RPC]
After invoke service: remoting-service
  reply: java.util.ArrayList (Collection size:2)
  [0] = com.test.flex.model.User
id = 1
username = eman
password = password

  [1] = com.test.flex.model.User
id = 2
username = test
password = password
11:20:14,467 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG] 

[flexcoders] OpenAMF for returning files?

2008-12-02 Thread buzz_tarun
Hi there,

I am using openamf for integrating flex ui with a J2EE backend. The
integration works fine as far as strongly typed data types are
concerned. Has anyone attempted to return files (say PDFs or Excels)
from the backend via openamf? Any comments/suggestions would be very
helpful.

Thanks,
Tarun



Re: [flexcoders] how to de-serialize objects

2008-12-02 Thread freak182

Hello,
I have similar problem and im totally new to flex and cairngorm... here is
my code snippet:

im my java end:

 ListUsers getAll() {  // from hibernate dao then return result which
llist of users }

in AS files:

public class ListDelegate extends EventDispatcher
{
private var userService:RemoteObject;
private var responder:IResponder;

public function ListDelegate(responder:IResponder)
{
this.userService = new  RemoteObject(userService);

this.responder = responder;
}

public function getUserList():void
{

var call : Object = userService.getAll();

call.addResponder( responder );

}
}


public class ListUserCommand extends BaseCommand
{


override protected function callDelegate():void
{
var listdelegate:ListDelegate = new ListDelegate(this);
listdelegate.getUserList();
}

override public function result( event : Object ) : void
{   
this.modelHelper.onResultUser(event);   

}   

override public function fault( event : Object ) : void
{
var faultevt:FaultEvent = event as FaultEvent;
Alert.show(faultevt.fault.rootCause.toString());
}

}

public class ModelHelper
{
[Bindable]
public var userlist: UserList;

public function ModelHelper(userlist: UserList)
{
this.userlist = userlist;
}

public function getUserList():void
{
new ListUserEvent(this).dispatch();
}

public function onResultUser(event:Object):void
{
this.userlist.listusers = event.result as 
ArrayCollection;
}

}

..and i use DataGrid to display datas:

?xml version=1.0 encoding=utf-8?
mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; 
initialize=init()
creationComplete=loadAll() 

mx:Script
![CDATA[
import com.test.flex.util.UserList;
import mx.rpc.events.ResultEvent;
import com.test.flex.model.ViewModelLocator;
import com.test.flex.events.ListUserEvent;
import com.test.flex.model.ModelHelper;

[Bindable]
private var modelLocator:ViewModelLocator =
ViewModelLocator.getInstance();

[Bindable]
public var modelHelper:ModelHelper;
[Bindable]
public var users:UserList;

public function init():void
{
this.users = new UserList();
this.modelHelper = new ModelHelper(users);  

}

public function loadAll():void
{
this.modelHelper.getUserList(); 
}



]]
 /mx:Script
 
 !-- mx:Label text={modelLocator.test}/ --
 
 mx:DataGrid id=userlist dataProvider={modelHelper.userlist.listusers}
mx:columns
mx:DataGridColumn headerText=ID dataField=id/
mx:DataGridColumn headerText=Username dataField=username/
mx:DataGridColumn headerText=Password dataField=password/
/mx:columns
 /mx:DataGrid
 

mx:Button id=logout label=LogOut
click={modelLocator.modelWorkflowState = ViewModelLocator.LOGIN_SCREEN}/
/mx:VBox

..and the rest are straigthforward code. When I change the return value to
String it works fine nut when put it back to List it display nothing or
error i get but when i debug it i gets the results:

11:20:14,459 INFO  [STDOUT] Hibernate: select this_.ID as ID1_0_,
this_.USERNAME as USERNAME1_0_, this_.PASSWORD as PASSWORD1_0_ from user
this_
11:20:14,464 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG] [Service.Remoting]
Adapter 'java-object' called 'userService.getAll(java.util.Arrays$ArrayList
(Collection size:0)
)'
11:20:14,465 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG] [Service.Remoting]
Result: 'java.util.ArrayList (Collection size:2)
  [0] = com.test.flex.model.User
id = 1
username = eman

Re: [flexcoders] OpenAMF for returning files?

2008-12-02 Thread Johannes Nel
build the file on the server, download via get. use blazeDS or red5 instead
of openAMF

On Tue, Dec 2, 2008 at 1:23 AM, buzz_tarun [EMAIL PROTECTED] wrote:

   Hi there,

 I am using openamf for integrating flex ui with a J2EE backend. The
 integration works fine as far as strongly typed data types are
 concerned. Has anyone attempted to return files (say PDFs or Excels)
 from the backend via openamf? Any comments/suggestions would be very
 helpful.

 Thanks,
 Tarun

  




-- 
j:pn
\\no comment


[flexcoders] ItemRenderer, mislabels scrolling

2008-12-02 Thread Robert
When scrolling, the labels on the grid turn into those that the 
recycled item renderer used.  I tried using this.data to overwrite 
the values every time.  The new listData object has the correct 
label and so I thought it was working, but there is a url I need in 
the current rows' XML for the button click to work and accessing the 
this.data gave me the old results.  I then thought I could use the 
row index in listData but quickly found that the row index is always 
the same when scrolling down or up, the end or the begining of the 
grid.  So it's not really the row index of the XML but the grid.  
Seems overwritting the values wasn't quite the answer.

There is a variable in listData called item.  I see it in the 
debugger but the compiler won't let me access it.  This is the XML 
for the row.  So, in short, how can I access this 'listData.item' or 
find out the actual XML row I am on.  Actually, any suggestion would 
be great.  Banging my head on this one all day.

And thanks.

Here's some code:

public function get listData():BaseListData{
  return _listData;
}

public function set listData(blData:BaseListData):void{
  _listData = DataGridListData(blData);
  renderData();
}   

private function renderData():void {
  var columnIndex:int;  
  var xmlRow:XML;

  columnIndex = this.listData.columnIndex;
  xmlRow = XML(this.data);
/*
 * I added this to get at the item.
  try{
if(this.listData.item != null){
  xmlRow = XML(this.listData.item);
}
else{
  xmlRow = XML(this.data);
}
  }
  catch(e:Error){
xmlRow = XML(this.data);
  }
*/

  this.value = this.listData.label;
  if ( value == [multiple] ){
this.creativeLinkButton.enabled = false;
this.creativeLinkButton.useHandCursor = false;
this.creativeLinkButton.setStyle(textDecoration, none);
  }
  else{
this.creativeLinkButton.enabled = true;
this.creativeLinkButton.useHandCursor = true;
this.creativeLinkButton.setStyle(textDecoration, underline);
  }

  // get toolTip = @u(columnIndex)
  // get url = @u(columnIndex)
  var urlName:String = @u + columnIndex.toString();
  this.url = xmlRow[urlName];
  this.description = xmlRow[urlName];
}

override protected function setMXMLViewBindings():void{
  super.setMXMLViewBindings();
  this.logger.debug(setMXMLViewBindings);

  // Set creativeLink link button's label
  BindingUtils.bindProperty(this.creativeLinkButton, label, this, 
[value]);

  // Set creativeLink link button's toolTip
  BindingUtils.bindProperty(this.creativeLinkButton, toolTip, 
this, [description]);
}




[flexcoders] Using XSL in Flex?

2008-12-02 Thread oneworld95
Can XSL be used to tell Flex how to display XML data? I've got an XML
help file that I'd like to display in a popup window in Flex without
having to fetch each element; I'd like to just dump the contents into
a Flex control and have it automatically apply styles to it. Thanks.



[flexcoders] getting what fired a change sliderEvent -- is it possible?

2008-12-02 Thread Matyas Forian Szabo
-- Forwarded message --
From: Matyas Forian Szabo [EMAIL PROTECTED]
Date: 2008/12/2
Subject: getting what fired a change sliderEvent -- is it possible?
To: flexcoders@yahoogroups.com


Hi

im in a making of a flex application that will display a zoomed in part of
an image.

Above the image is a scrollbar (a HSlider) which has 2 thumbs.

If i drag the image, the scrollbar moves according to the x coordinate of
the image im viewing.

If i drag the thumbs on the scrollbar flex should display that part of the
image which im

setting with the slider tumbs.

My problem is:

If i drag the image i can alter the slider's thumb positions with
setThumbValueAt().

Then i add a change event to the HSlider to be able to pan the image with
the

slider's thumbs.

BUT this change event gets fired if im dragging the image too.

(So it modifies the image position, altough i want to only modify the thumb
position)

So what i'd need (i guess) is a way to determine what fired the change
event:

the clicking/dragging of my slider object of the dragging of my image.

Any ideas?

thank in advance!


[flexcoders] JSP taglib FLEX 3

2008-12-02 Thread virchete
I am trying to use the jsp tag library into a very simple jsp:

%@ taglib uri=FlexTagLib prefix=mm %
htmlbody
h3Introduction/h3
pThis is an example of writing MXML in a JSP./p
h3My App/h3
mm:mxml  
   mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  mx:Accordion width=500 height=300
 mx:VBox label=panel1 width=500 height=200 /
  /mx:Accordion
   /mx:Application
/mm:mxml
/body/html

I have a Java project that uses STRUTS to redirect. Well the problem
is that, although I have included the flex-bootstrap.jar,
flex-bootstrap-jsp.jar,  flex-webtier.jar and flex-webtier-jsp.jar I
always receive the same exception in the explorer or mozilla navigator:

java.lang.NullPointerException
flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24)
flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14)
flex.webtier.server.j2ee.jsp.MxmlTagImpl.init(MxmlTagImpl.java:2)


I am using Tomcat 6 server and I receive always the following trace:

EVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to read TLD
META-INF/taglib.tld from JAR file
file:/C:/google2/MapasOpodo/build/web/WEB-INF/lib/flex-bootstrap.jar: 
java.lang.NullPointerException
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:181)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:182)
at
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
...
...
...

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24)
at
flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14)

Well If you need something more (the source code) don't doubt to ask
me. I am so sorry for having to find help, but I have lost all the day
of work today, and if you could help me...

Many Thanks
David Virgil.



[flexcoders] Re: How to make a Docking Window Framework/component like Eclipse/InfoDock/JDock

2008-12-02 Thread nathanleewei

--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

 Yeah, I forgot about that.
 There are probably 20 different ways you could implement something
like
 this. From my experience you want to start out thinking abstraction
and not
 program to much into your views.

 Mike

 On Thu, Oct 9, 2008 at 7:16 AM, nathanleewei [EMAIL PROTECTED] wrote:

maybe I should get some idea from
  SuperTabNavigator(flexlib/dougmccune)
 
 
 



 --
 Teoti Graphix, LLC
 http://www.teotigraphix.com

 Teoti Graphix Blog
 http://www.blog.teotigraphix.com

 You can find more by solving the problem then by 'asking the
question'.





[flexcoders] Re: How to embed icons in MenuBar?

2008-12-02 Thread nathanleewei
Thanks, it works!

[Embed(source=/assets/document.png)]
public var documentIcon:Class;


mx:MenuBar id=menuBar width=100% labelField=@label 
iconField=@icon styleName=menuBar itemClick=onMenuBar(event)
mx:XMLList
menuitem label=File
menuitem label=New icon=documentIcon /
menuitem label=Open... 
icon=documentIcon/



--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 Try public instead of private
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
On Behalf Of nathanleewei
 Sent: Thursday, November 27, 2008 3:31 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How to embed icons in MenuBar?
 
 
 [Embed(source=/assets/document.png)]
 private static const document_icon:Class;
 
 mx:MenuBar id=menuBar width=100% labelField=@label
 iconField=@icon styleName=menuBar itemClick=onMenuBar(event)
 mx:XMLList
 menuitem label=File
 menuitem label=New icon=document_icon /
 
 it has no effect?!






[flexcoders] Re: Game Architecture

2008-12-02 Thread someguy7_7
Any thoughts on this?

Thanks
--- In flexcoders@yahoogroups.com, someguy7_7 [EMAIL PROTECTED] wrote:

 Can you give me some more details on the security issues relating to
 remote objects?
 
 How do you notify the other client when one client has taken a turn
 with remote objects? Have it poll the server constantly for updates?
 
 Any thoughts on if using a consumer/producer messaging will be good or
 not scaleable enough for the amount of calls?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com, Samuel Colak sam.colak@ wrote:
 
  Depends on the number of simultaneous clients and the time-impact.
  
  One note to take into account is security of the game - using
sockets  
  does
  not scale in direct user to user communications unless limited to
one  
  or two.
  
  Remote Objects work well but introduce security issues.
  
  Quite often i use remoteobjects for informing of changes to the
state  
  of the system
  and webservices to deal with secure stuff (rewards, purchasing and
so  
  on).
  
  On Dec 1, 2008, at 8:35 AM, someguy7_7 wrote:
  
   I am going to mess around and try to create a multi player
online game
   with flex. Any thoughts on the best way to communicate the users
   actions back to the server? Remote Objects? Producer/Consumer
   Messaging? Morse Code?
  
   Thanks
  
  
  
 





[flexcoders] application structure

2008-12-02 Thread tom s
Hi,

I'm writing my first flex app.
So far it all works, but I'm getting to the point where I need to start
structuring it, for ease of further development.
Right now I simply have many functions defined within the script tag
within the application.
I'm now thinking through my options for structuring this better. I'm not
asking for *specific* structuring recomendations, as I know that would be
imposisble w/o you knowing the specifics of what I'm doing.

What I'm looking for is a good place to read about the different options, so
I can learn about them.
Preferable free online, or in Safari Books Online.

To be clear: when I say structural options I mean things like:
a) having all the code in the script
b) putting the code in a seperate .as and point script source= at it (I
know this is very similar to (a) )
c) using static methods in a 'static' class
d) creating classes to fully OOize the code
e) something else I dont yet know about...

I'm reading 'Advanced Action Script 3 with Design Patterns', which I hope
will help, but I would like to have some flex specific knowledge also, so
that I can see examples of how to allow objects outside the application to
access those defined by mxml within the application (like buttons). I'm
concerned that will end up with a lot of Application.application.foo type
code - is that 'normal'?

I'm hoping this makes enough sense...

thanks

tom


[flexcoders] Filter won't render...what is the cause?

2008-12-02 Thread Guy Morton
Warning: Filter will not render.  The DisplayObject's filtered  
dimensions (107374955, 525) are too large to be drawn.

Anyone know what causes this? The implication is that I'm trying to  
apply a filter to an enormous object, but as far as i know, there is  
no huge object in my app. Anyone got a clue for me as to how to find  
the offending item?

Guy


RE: [flexcoders] Re: objects bound to datagrid not gc'd when dataprovider set to null

2008-12-02 Thread Yves Riel
I had a similar problem with lists. I found out that the itemRenderer
does not release its reference to the data member. While digging into
the code, I've found out that Adobe has access to the list through the
mx_internal namespace. So, I cooked up a small helper function to
release the itemRenderer. Try to adapt it to the grid.
 
BEGIN CODE
import mx.core.mx_internal;

use namespace mx_internal;

/**
* Helper function that cleans up a list's item renderers.
* 
* PThe item renderers contain a data member that holds a reference to
the data the list was
* trying to display. The list doesn't clean up the item renderers data
member when the list provider is set
* to null. So, this reference prevents elements from being garbage
collected and needs to be manually cleaned up/P.
* 
* @param list The list for wich the Item Renderers need to be cleaned
up.
* 
*/
 
public static function cleanItemRenderersData(list:ListBase):void {
 
var renderers:Array = list.rendererArray; // two dimensional array
var renderer:IDataRenderer = null;
for (var row:int = 0 ; row  renderers.length ; row++) {
for (var col:int = 0 ; col  renderers[row].length ; col ++) {
renderer = renderers[row][col] as IDataRenderer;
renderer.data = null;
}
}
}



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of lmurphy
Sent: Monday, December 01, 2008 8:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: objects bound to datagrid not gc'd when
dataprovider set to null



Could anyone point me in the right direction?

I've removed -

* data binding references
* remote object call references - clearResult

However, after setting the dataprovider for my grid to null - the grid
shows no items, in the debugger the dataprovider has a length of 0 -
there are still references to the objects.

All of the references seem to be coming from datagriditemrenderers (I
do not use any special item renderer, simply the default). The
reference list/tree is large with and incomprehensible to me - but
they all seem to be coming from classes I don't control.

Any thoughts?



 


[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-02 Thread stinasius
please guys any help am desperate.



Re: [flexcoders] application structure

2008-12-02 Thread Jules Suggate
Hi Tom,

You've hit on one of the classic anti-patterns of Flex programming:
Application.application.blah type stuff.

While this is regrettably somewhat 'normal', that doesn't mean it's ok
:) As you probably have guessed, it leads to code that is really hard
to change later on as it is all tangled up with itself.

The solution is to use one of the application patterns that have been
studied by the GUI programming community in general (not just Flex
programmers) ... such as MVC (Model-View-Controller).

Martin Fowler is one of the canonical sources on this stuff:
http://martinfowler.com/eaaDev/uiArchs.html

Mate, Parsley or Cairngorm are open-source Flex frameworks that
implement the shell of one or more GUI patterns to save us all
re-inventing the wheel. Realistically, most people learn the patterns
by using one of these frameworks or their cousins (there are more, I'm
just giving a few that are currently flavour of the month).

Cairngorm has been getting a bad rap lately due to testability of the
resulting application (or lack thereof), but it's deeply embedded in
the Flash community (for better or worse).

Martin Fowler et al will give you an academic understanding, introduce
you to some code (Martin Fowler uses C# WinForms), explain the finer
points and describe several variations that you may or may not find
interesting.

You've bitten off quite a large topic with that innocuous question ;-)

Jules

On Tue, Dec 2, 2008 at 23:56, tom s [EMAIL PROTECTED] wrote:
 Hi,

 I'm writing my first flex app.
 So far it all works, but I'm getting to the point where I need to start
 structuring it, for ease of further development.
 Right now I simply have many functions defined within the script tag
 within the application.
 I'm now thinking through my options for structuring this better. I'm not
 asking for *specific* structuring recomendations, as I know that would be
 imposisble w/o you knowing the specifics of what I'm doing.

 What I'm looking for is a good place to read about the different options, so
 I can learn about them.
 Preferable free online, or in Safari Books Online.

 To be clear: when I say structural options I mean things like:
 a) having all the code in the script
 b) putting the code in a seperate .as and point script source= at it (I
 know this is very similar to (a) )
 c) using static methods in a 'static' class
 d) creating classes to fully OOize the code
 e) something else I dont yet know about...

 I'm reading 'Advanced Action Script 3 with Design Patterns', which I hope
 will help, but I would like to have some flex specific knowledge also, so
 that I can see examples of how to allow objects outside the application to
 access those defined by mxml within the application (like buttons). I'm
 concerned that will end up with a lot of Application.application.foo type
 code - is that 'normal'?

 I'm hoping this makes enough sense...

 thanks

 tom

 


Re: [flexcoders] Re: How to make a Docking Window Framework/component like Eclipse/InfoDock/JDock

2008-12-02 Thread Josh McDonald
Somebody on this list has created exactly what you're looking for, and it's
pretty reasonably priced, google the archives.

-Josh

On Tue, Dec 2, 2008 at 7:46 PM, nathanleewei [EMAIL PROTECTED] wrote:


 --- In flexcoders@yahoogroups.com, Michael Schmalle
 [EMAIL PROTECTED] wrote:
 
  Yeah, I forgot about that.
  There are probably 20 different ways you could implement something
 like
  this. From my experience you want to start out thinking abstraction
 and not
  program to much into your views.
 
  Mike
 
  On Thu, Oct 9, 2008 at 7:16 AM, nathanleewei [EMAIL PROTECTED] wrote:
 
 maybe I should get some idea from
   SuperTabNavigator(flexlib/dougmccune)
  
  
  
 
 
 
  --
  Teoti Graphix, LLC
  http://www.teotigraphix.com
 
  Teoti Graphix Blog
  http://www.blog.teotigraphix.com
 
  You can find more by solving the problem then by 'asking the
 question'.
 



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links






-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


[flexcoders] Re: How to embed icons in MenuBar?

2008-12-02 Thread nathanleewei
no shown :(



[flexcoders] Re: How to make a Docking Window Framework/component like Eclipse/InfoDock/JDock

2008-12-02 Thread nathanleewei
What I am looking for is different from DockAreaFX.

Pls see my project: http://flexrock.googlecode.com


--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 Somebody on this list has created exactly what you're looking for, 
and it's
 pretty reasonably priced, google the archives.
 
 -Josh






[flexcoders] Detect a databinding

2008-12-02 Thread Marco Catunda
Hi,

I have a singleton class with model data provider (like cairngorm model).

Some user interface components binding this model in data provider property.

I didn't find out any way to detect if there is binding in this model
or not, and
how many bindings.

The binding model works with events, so my idea was override addEventListener
in singleton model to detect binding. But it don't work because the
removeEventListener
isn't call when component go away.

Does anyone has any tips?

Regards
-- 
Marco Catunda


RE: [flexcoders] Zoom effect absolute positioning

2008-12-02 Thread Chet Haase
Hi Ward,

I don't think that switching to an absolute layout would have the desired 
effect. For one thing, your thumbnails probably have no explicit location and 
are just being positioned by the Canvas layout manager, so if you switch to 
absolute, they might just decide to go put themselves at (0,0).

You could turn off autoLayout for the duration of the effect, but that's 
usually a temporary thing done during and effect and not a long-term situation 
you want to be in.

One solution might be for your Canvas to be wrapped in a custom component, 
subclassing UIComponent. When you click on a thumbnail, put a copy of the image 
into the wrapping container and zoom in on that. It will then cover everything 
below it. When you zoom back out, remove it from the wrapping component, and 
you'll see everything behind it again.

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ward 
Loockx
Sent: Tuesday, December 02, 2008 5:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Zoom effect absolute positioning


Hello,

I have a canvas within my application that contains polaroid images (own
flex component). When I click on a polaroid I wan't it to zoom all over
my application. When I do this now it stays within the canvas and I get
scrollbars (on that canvas). Is there a way to keep the pictures on the
canvas and still be able to zoom over my whole application (When zooming
- go to absolute layout)? Somebody that knows if this is possible ?

Thanks,
Ward



[flexcoders] Re: AIR - Including an Image in mx:html using htmlText

2008-12-02 Thread langdonjared
Thanks for your help in this.  I reinstalled Flex Builder and tried 
again.  Now it works.  Thanks again.



[flexcoders] Re: Flex nested tree get data from mysql and php

2008-12-02 Thread timgerr
So I am trying to build a MPTT (nested tree) object in php, I have a
few questions for this group because I am not sure how the data should
be returned.  I have been using static data and have a few questions
on what is contained within the data.  Here is my arraycollection:
private var myDataProvider:ArrayCollection = new ArrayCollection([
  Region:Southwest,ID:1,Territory_Rep:Tom Jones, children: [
{Region:Arizona,ID:2, children: [ 
{Territory_Rep:Barbara Jennings, ID:3}, 
{Territory_Rep:Dana Binn,ID:4}]},  
{Region:Central California,ID:5, children: [ 
{Territory_Rep:Joe Smith, ID:6}]},  
{Region:Nevada, ID:7, children: [ 
   {Territory_Rep:Bethany Pittman,ID:8}]},  
{Region:Northern California, ID:9, children: [ 
   {Territory_Rep:Lauren Ipsum,ID:10}, 
   {Territory_Rep:T.R. Smith,ID:11}]},  
{Region:Southern California,ID:'12', children: [ 
   {Territory_Rep:Alice Treu, ID:'13'}, 
   {Territory_Rep:Jane Grove,ID:14}]}
   ]}
]);

I am in need of some guidance, so bear with me :). I think that this
is an object {Territory_Rep:Joe Smith, ID:6}, is this an array
with an object {Region:Central California,ID:5, children: [ 
{Territory_Rep:Joe Smith, ID:6}]} ?

Here is my problem, I am creating some php data returns to flex with
arrays, object, assoc arrays.  I am not sure what a flex
arraycollection is so I am running some tests.  Here are some tests
that I have done,
Example #1
PHP CODE
$o1-name = 'Tom';
$o1-status = 'Dad';

$o2-name = 'Wendy';
$o2-status = 'Daughter';
$b[] = $o2;
$o1-child = $b;
$arr[] = $o1;
return $arr;

Charles Proxy Sees This:
com.mptt.MPTT.GetTree
Parameters
Results
[0]
name
status
child
[0]
name
status

Example #2
$o1-name = 'Tom';
$o1-status = 'Dad';

$o2-name = 'Wendy';
$o2-status = 'Daughter';
$o1-child = $o2;
$arr[] = $o1;
return $arr;


com.mptt.MPTT.GetTree
Parameters
Results
[0]
name
status
child
name
status


Example #3
$o1-name = 'Tom';
$o1-status = 'Dad';

$o2-name = 'Wendy';
$o2-status = 'Daughter';
$o1-child = $o2;
return $o1;

com.mptt.MPTT.GetTree
Parameters
Results
name
status
child
name
status

So when I return the 3 examples int an arraycollection:
var ac:ArrayCollection = new ArrayCollection(result.result as Array);
and use that array collection as a dataprovider for a combobox 

mx:ComboBox x=204 y=107 id=cmbox dataProvider={ac}
labelField=name/mx:ComboBox

Only example 1 and 2 return anything and that is only the first name,
none of the child names propagate the Combobox.  

So my question with all of this, how (what format) should I return my
data from php to flex so I can add it (the data) to an arraycollection.

Thanks for all the help, this group rocks,
timgerr

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

 Hello all, 
 I am working with nested arrayobjects and I cannot construct the
 needed data from my php/mysql backend.  
 
 I am using nested sets
 (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html),
 with left and right keys.  I need to construct the data (in php) and
 pass it to flex (using a remote call). I need/want to get the data to
 flex and put it into an arraycollection.  Has any one done this?  If
 so, can you post some code?  I have been banging my head on this for a
 long time and cannot get the data into the right format for an array
 collection.
 
 Thanks for the help,
 timgerr





[flexcoders] Mouse off stage and ajax bridge

2008-12-02 Thread flexaustin
Is there a way to stop all mouse event listeners from the stage?  Or
will I need to do it the hard way and track down all mouse event
listeners.

My issue is that I have a Hslider that controls a component. When a
user stops scrolling for a certain amount of time, pausing, I update
the component.  Updating also sends out some new information to the
html page via the ajax bridge. This causes the html page to popup up
js run loading popup. Well, when the loading js popup comes up flash
somehow loses focus of the mouse and still thinks the mouse button is
pressed so when flash gets focus again the slider follows the mouse
around even if the mouse isn't on the slider anymore.

I really don't want to have to rework this old project. Wasn't an
issue with flash player 9.  I guess Adobe made flash player to fast,
thus my js file is getting notification immediately.





[flexcoders] AIR

2008-12-02 Thread GYANPRAKASH PANDEY
Hi,
 
I'm new to AIR.
I've installed Flex builder 3 and AIR set up provided by Adobe. I know flex, 
but i dont kno how to interact with AIR for developing desktop ria. I've to 
develop desktop RIA for billing. Kindly guide me to same.
 
thnx in advance
 
regards,
gyanprakash pandey


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Re: [flexcoders] AIR

2008-12-02 Thread Barry Gee
Hear is a good starting point.

http://www.adobe.com/devnet/air/flex/

Barry.


GYANPRAKASH PANDEY wrote:

 Hi,
  
 I'm new to AIR.
 I've installed Flex builder 3 and AIR set up provided by Adobe. I know 
 flex, but i dont kno how to interact with AIR for developing desktop 
 ria. I've to develop desktop RIA for billing. Kindly guide me to same.
  
 thnx in advance
  
 regards,
 gyanprakash pandey


 
 Add more friends to your messenger and enjoy! Invite them now. 
 http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/
  

  




[flexcoders] move effect Flex live doc example does not work

2008-12-02 Thread hworke

   Hello all,

   the example in this link does not work.
http://livedocs.adobe.com/flex/3/langref/mx/effects/Move.html

   The exact error message is:

Severity and DescriptionPathResourceLocation
Creation Time   Id

Type was not found or was not a compile-time constant: move.
[Generated code (use -keep to save): Path: move-generated.as, Line:
187, Column: 14]moveUnknown 1101999455125   884


Any idea why it is not working in my Flex builder?

Regards...



[flexcoders] Padding/spacing before the first line in a TextArea

2008-12-02 Thread bjorn
There is some padding before the first line in a TextArea. Have a look at
this image to see what I mean:

http://i34.tinypic.com/4uz8s0.jpg

I need to remove this, and the first solution that comes to mind is to find
that value and position the TextArea.y = TextArea.y - [that value]. The
padding before the first line seems to be equal (in most cases) to the
font's descent, which I can get from getTextLineMetrics().descent.

However, this is not true in all cases. In some cases, the padding is more.

Anyone have suggestions?

Bjørn
-- 

http://www.juicability.com - flex blog
http://www.nospoiler.com - link to youtube videos without the spoilers


[flexcoders] Re: Using XSL in Flex?

2008-12-02 Thread Paul Fischer
--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 Can XSL be used to tell Flex how to display XML data? I've got an XML
 help file that I'd like to display in a popup window in Flex without
 having to fetch each element; I'd like to just dump the contents into
 a Flex control and have it automatically apply styles to it. Thanks.


Yes, you can use XSL, but it is external to Flex. I created a custom
TextArea component for displaying help text. It has a URL parameter
that loads the text. The URL can be for a file that contains the text
and html tags. Or it can be to a servlet which transforms the help xml
using a xsl stylesheet and returns the final help text in a consistent
format.

/Paul



Re: [flexcoders] AIR

2008-12-02 Thread Tom Chiverton
On Tuesday 02 Dec 2008, Barry Gee wrote:
 Hear is a good starting point.
 http://www.adobe.com/devnet/air/flex/

And more practically, it's an option in Builder's 'File, new, Flex project' 
menu to choose AIR.

-- 
Tom Chiverton
Helping to biannually harvest methodologies





This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office together with a 
list of those non members who are referred to as partners.  We use the word 
“partner” to refer to a member of the LLP, or an employee or consultant with 
equivalent standing and qualifications. Regulated by the Solicitors Regulation 
Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

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

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* 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] move effect Flex live doc example does not work

2008-12-02 Thread Chet Haase

I think the problem is that you named your application move. 'move' is a word 
that's already used in Flex (such as the move() function), so it runs into 
problems when it tries to use that word as a type as well.

name your application differently and it should work fine (it did for me, but I 
was able to reproduce your error by naming the application 'move' instead)

Chet.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hworke
Sent: Tuesday, December 02, 2008 8:05 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] move effect Flex live doc example does not work


Hello all,

the example in this link does not work.
http://livedocs.adobe.com/flex/3/langref/mx/effects/Move.html

The exact error message is:

Severity and Description Path Resource Location Creation Time Id

Type was not found or was not a compile-time constant: move.
[Generated code (use -keep to save): Path: move-generated.as, Line:
187, Column: 14] move Unknown 1101999455125 884

Any idea why it is not working in my Flex builder?

Regards...



Re: [flexcoders] AIR

2008-12-02 Thread GYANPRAKASH PANDEY
Hi,
Thnx alot.
i got it.
 
regards,
gyanprakash pandey

--- On Tue, 2/12/08, Tom Chiverton [EMAIL PROTECTED] wrote:

From: Tom Chiverton [EMAIL PROTECTED]
Subject: Re: [flexcoders] AIR
To: flexcoders@yahoogroups.com
Date: Tuesday, 2 December, 2008, 9:57 PM

On Tuesday 02 Dec 2008, Barry Gee wrote:
 Hear is a good starting point.
 http://www.adobe.com/devnet/air/flex/

And more practically, it's an option in Builder's 'File, new, Flex
project' 
menu to choose AIR.

-- 
Tom Chiverton
Helping to biannually harvest methodologies





This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and
Wales under registered number OC307980 whose registered office address is at
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list of
members is available for inspection at the registered office together with a
list of those non members who are referred to as partners.  We use the word
partner to refer to a member of the LLP, or an employee or consultant with
equivalent standing and qualifications. Regulated by the Solicitors Regulation
Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be
confidential or legally privileged.  If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform any
person other than Halliwells LLP or the addressee of its existence or contents. 
If you have received this email in error please delete it and notify Halliwells
LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
Groups Links






  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Re: [flexcoders] Re: Using XSL in Flex?

2008-12-02 Thread Sefi Ninio
Hey Paul,

Would you be willing to share that component?

On Tue, Dec 2, 2008 at 6:21 PM, Paul Fischer [EMAIL PROTECTED]wrote:

   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 oneworld95 [EMAIL PROTECTED] wrote:
 
  Can XSL be used to tell Flex how to display XML data? I've got an XML
  help file that I'd like to display in a popup window in Flex without
  having to fetch each element; I'd like to just dump the contents into
  a Flex control and have it automatically apply styles to it. Thanks.
 

 Yes, you can use XSL, but it is external to Flex. I created a custom
 TextArea component for displaying help text. It has a URL parameter
 that loads the text. The URL can be for a file that contains the text
 and html tags. Or it can be to a servlet which transforms the help xml
 using a xsl stylesheet and returns the final help text in a consistent
 format.

 /Paul

  



[flexcoders] datagrid cell focus

2008-12-02 Thread Dimitrios Gianninas
I know I've done this before, but it escapes me now how do I 
programmatically put focus on a cell in a datagrid ?
 
Dimitrios Gianninas
RIA Developer Team Lead
Optimal Payments Inc.
 

-- 
WARNING
---
This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the use of 
the intended recipient.  No privilege or other rights are waived by any 
unintended transmission or unauthorized retransmission of this message.  If you 
are not the intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete it and all 
attachments from your system.  The reading, distribution, copying or other use 
of this message or its attachments by unintended recipients is unauthorized and 
may be unlawful.  If you have received this e-mail in error, please notify the 
sender.

AVIS IMPORTANT
--
Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés destinés au 
seul usage du destinataire visé.  L’expéditeur original ne renonce à aucun 
privilège ou à aucun autre droit si le présent message a été transmis 
involontairement ou s’il est retransmis sans son autorisation.  Si vous n’êtes 
pas le destinataire visé du présent message ou si vous l’avez reçu par erreur, 
veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système.  La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des personnes 
autres que le destinataire visé ne sont pas autorisés et pourraient être 
illégaux.  Si vous avez reçu ce courrier électronique par erreur, veuillez en 
aviser l’expéditeur.



[flexcoders] Re: datagrid cell focus

2008-12-02 Thread oneworld95
Check this out:
http://www.vaishalimistry.com/2005/12/15/set-focus-on-a-cell-in-datagrid-in-flex-20/

-Alex

--- In flexcoders@yahoogroups.com, Dimitrios Gianninas
[EMAIL PROTECTED] wrote:

 I know I've done this before, but it escapes me now how do I
programmatically put focus on a cell in a datagrid ?
  
 Dimitrios Gianninas
 RIA Developer Team Lead
 Optimal Payments Inc.
  
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient.  No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message.  If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system.  The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful.  If you have received this e-mail
in error, please notify the sender.
 
 AVIS IMPORTANT
 --
 Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé.  L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation.  Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système.  La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux.  Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.





Re: [flexcoders] move effect Flex live doc example does not work

2008-12-02 Thread Vivian Richard
Excellent! Thanks a lot



On Tue, Dec 2, 2008 at 8:30 AM, Chet Haase [EMAIL PROTECTED] wrote:


 I think the problem is that you named your application move. 'move' is a
 word that's already used in Flex (such as the move() function), so it runs
 into problems when it tries to use that word as a type as well.



 name your application differently and it should work fine (it did for me,
 but I was able to reproduce your error by naming the application 'move'
 instead)



 Chet.





 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of hworke
 Sent: Tuesday, December 02, 2008 8:05 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] move effect Flex live doc example does not work



 Hello all,

 the example in this link does not work.
 http://livedocs.adobe.com/flex/3/langref/mx/effects/Move.html

 The exact error message is:

 Severity and Description Path Resource Location Creation Time Id

 Type was not found or was not a compile-time constant: move.
 [Generated code (use -keep to save): Path: move-generated.as, Line:
 187, Column: 14] move Unknown 1101999455125 884

 Any idea why it is not working in my Flex builder?

 Regards...

 


RE: [flexcoders] Re: datagrid cell focus

2008-12-02 Thread Dimitrios Gianninas
perfect thx!
 
Dimitrios Gianninas
RIA Developer Team Lead
Optimal Payments Inc.
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
oneworld95
Sent: Tuesday, December 02, 2008 12:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: datagrid cell focus



Check this out:
http://www.vaishalimistry.com/2005/12/15/set-focus-on-a-cell-in-datagrid-in-flex-20/
 
http://www.vaishalimistry.com/2005/12/15/set-focus-on-a-cell-in-datagrid-in-flex-20/
 

-Alex

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
Dimitrios Gianninas
[EMAIL PROTECTED] wrote:

 I know I've done this before, but it escapes me now how do I
programmatically put focus on a cell in a datagrid ?
 
 Dimitrios Gianninas
 RIA Developer Team Lead
 Optimal Payments Inc.
 
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient. No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message. If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful. If you have received this e-mail
in error, please notify the sender.
 
 AVIS IMPORTANT
 --
 Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.




 


[flexcoders] Flash being cached

2008-12-02 Thread flexaustin
Is there a way to prevent your swf file from being cached? I would
like to prevent this in production and when using the template files
(in bin-debug and bin-release).  When using these two html files my
browser seems to cache the swf requiring me to do a couple of
cntrl-r's and sometimes a clear cache in Firefoxs options.

Anyone else have this issue? 




RE: [flexcoders] Flash being cached

2008-12-02 Thread Battershall, Jeff
By adding on a unique string to the path to the .swf file, you can force
a download of the new swf.  I use SWFObject to make this easier rather
than using the normal auto-generated wrapper files for embedding the
swf.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexaustin
Sent: Tuesday, December 02, 2008 11:28 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flash being cached


Is there a way to prevent your swf file from being cached? I would like
to prevent this in production and when using the template files (in
bin-debug and bin-release).  When using these two html files my browser
seems to cache the swf requiring me to do a couple of cntrl-r's and
sometimes a clear cache in Firefoxs options.

Anyone else have this issue? 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-
1e62079f6847
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
Links





RE: [flexcoders] Padding/spacing before the first line in a TextArea

2008-12-02 Thread Alex Harui
Are you talking about the white pixels top and right of the selection 
rectangle?  I think that's always 2 pixels.  You might be able to alter the 
position of the TextArea's internal TextField to get rid of that.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bjorn
Sent: Tuesday, December 02, 2008 8:09 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Padding/spacing before the first line in a TextArea

There is some padding before the first line in a TextArea. Have a look at this 
image to see what I mean:

http://i34.tinypic.com/4uz8s0.jpg

I need to remove this, and the first solution that comes to mind is to find 
that value and position the TextArea.y = TextArea.y - [that value]. The padding 
before the first line seems to be equal (in most cases) to the font's descent, 
which I can get from getTextLineMetrics().descent.

However, this is not true in all cases. In some cases, the padding is more.

Anyone have suggestions?

Bjørn
--

http://www.juicability.com - flex blog
http://www.nospoiler.com - link to youtube videos without the spoilers



RE: [flexcoders] ItemRenderer, mislabels scrolling

2008-12-02 Thread Alex Harui
itemRenderer.data should always be the data for the row.  It should never be 
the old data unless you overrode the setter.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert
Sent: Monday, December 01, 2008 3:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ItemRenderer, mislabels  scrolling


When scrolling, the labels on the grid turn into those that the
recycled item renderer used. I tried using this.data to overwrite
the values every time. The new listData object has the correct
label and so I thought it was working, but there is a url I need in
the current rows' XML for the button click to work and accessing the
this.data gave me the old results. I then thought I could use the
row index in listData but quickly found that the row index is always
the same when scrolling down or up, the end or the begining of the
grid. So it's not really the row index of the XML but the grid.
Seems overwritting the values wasn't quite the answer.

There is a variable in listData called item. I see it in the
debugger but the compiler won't let me access it. This is the XML
for the row. So, in short, how can I access this 'listData.item' or
find out the actual XML row I am on. Actually, any suggestion would
be great. Banging my head on this one all day.

And thanks.

Here's some code:

public function get listData():BaseListData{
return _listData;
}

public function set listData(blData:BaseListData):void{
_listData = DataGridListData(blData);
renderData();
}

private function renderData():void {
var columnIndex:int;
var xmlRow:XML;

columnIndex = this.listData.columnIndex;
xmlRow = XML(this.data);
/*
* I added this to get at the item.
try{
if(this.listData.item != null){
xmlRow = XML(this.listData.item);
}
else{
xmlRow = XML(this.data);
}
}
catch(e:Error){
xmlRow = XML(this.data);
}
*/

this.value = this.listData.label;
if ( value == [multiple] ){
this.creativeLinkButton.enabled = false;
this.creativeLinkButton.useHandCursor = false;
this.creativeLinkButton.setStyle(textDecoration, none);
}
else{
this.creativeLinkButton.enabled = true;
this.creativeLinkButton.useHandCursor = true;
this.creativeLinkButton.setStyle(textDecoration, underline);
}

// get toolTip = @u(columnIndex)
// get url = @u(columnIndex)
var urlName:String = @u + columnIndex.toString();
this.url = xmlRow[urlName];
this.description = xmlRow[urlName];
}

override protected function setMXMLViewBindings():void{
super.setMXMLViewBindings();
this.logger.debug(setMXMLViewBindings);

// Set creativeLink link button's label
BindingUtils.bindProperty(this.creativeLinkButton, label, this,
[value]);

// Set creativeLink link button's toolTip
BindingUtils.bindProperty(this.creativeLinkButton, toolTip,
this, [description]);
}



RE: [flexcoders] Mouse off stage and ajax bridge

2008-12-02 Thread Alex Harui
Fake a MOUSE_UP event

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
flexaustin
Sent: Tuesday, December 02, 2008 7:51 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Mouse off stage and ajax bridge


Is there a way to stop all mouse event listeners from the stage? Or
will I need to do it the hard way and track down all mouse event
listeners.

My issue is that I have a Hslider that controls a component. When a
user stops scrolling for a certain amount of time, pausing, I update
the component. Updating also sends out some new information to the
html page via the ajax bridge. This causes the html page to popup up
js run loading popup. Well, when the loading js popup comes up flash
somehow loses focus of the mouse and still thinks the mouse button is
pressed so when flash gets focus again the slider follows the mouse
around even if the mouse isn't on the slider anymore.

I really don't want to have to rework this old project. Wasn't an
issue with flash player 9. I guess Adobe made flash player to fast,
thus my js file is getting notification immediately.



RE: [flexcoders] Filter won't render...what is the cause?

2008-12-02 Thread Alex Harui
Did you get out past 8000 pixels?  That causes all sorts of math issues.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Guy 
Morton
Sent: Tuesday, December 02, 2008 2:32 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Filter won't render...what is the cause?


Warning: Filter will not render. The DisplayObject's filtered
dimensions (107374955, 525) are too large to be drawn.

Anyone know what causes this? The implication is that I'm trying to
apply a filter to an enormous object, but as far as i know, there is
no huge object in my app. Anyone got a clue for me as to how to find
the offending item?

Guy



Re: [flexcoders] Zoom effect absolute positioning

2008-12-02 Thread Fotis Chatzinikos
You could add a transparent full screen canvas overlay, on click add the
'polaroid' on the correct overlay location
(via localToGlobal, or content to global) and then zoom it...

On Tue, Dec 2, 2008 at 5:39 PM, Chet Haase [EMAIL PROTECTED] wrote:

Hi Ward,



 I don't think that switching to an absolute layout would have the desired
 effect. For one thing, your thumbnails probably have no explicit location
 and are just being positioned by the Canvas layout manager, so if you switch
 to absolute, they might just decide to go put themselves at (0,0).



 You could turn off autoLayout for the duration of the effect, but that's
 usually a temporary thing done during and effect and not a long-term
 situation you want to be in.



 One solution might be for your Canvas to be wrapped in a custom component,
 subclassing UIComponent. When you click on a thumbnail, put a copy of the
 image into the wrapping container and zoom in on that. It will then cover
 everything below it. When you zoom back out, remove it from the wrapping
 component, and you'll see everything behind it again.



 Chet.





 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Ward Loockx
 *Sent:* Tuesday, December 02, 2008 5:42 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Zoom effect absolute positioning



 Hello,

 I have a canvas within my application that contains polaroid images (own
 flex component). When I click on a polaroid I wan't it to zoom all over
 my application. When I do this now it stays within the canvas and I get
 scrollbars (on that canvas). Is there a way to keep the pictures on the
 canvas and still be able to zoom over my whole application (When zooming
 - go to absolute layout)? Somebody that knows if this is possible ?

 Thanks,
 Ward






-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


Re: [flexcoders] Zoom effect absolute positioning

2008-12-02 Thread Fotis Chatzinikos
something else i have done is to add components similar to this to the
parent component's rawchildren but i am not really sure if this is a
recommended way to go...

On Tue, Dec 2, 2008 at 9:12 PM, Fotis Chatzinikos 
[EMAIL PROTECTED] wrote:

 You could add a transparent full screen canvas overlay, on click add the
 'polaroid' on the correct overlay location
 (via localToGlobal, or content to global) and then zoom it...


 On Tue, Dec 2, 2008 at 5:39 PM, Chet Haase [EMAIL PROTECTED] wrote:

Hi Ward,



 I don't think that switching to an absolute layout would have the desired
 effect. For one thing, your thumbnails probably have no explicit location
 and are just being positioned by the Canvas layout manager, so if you switch
 to absolute, they might just decide to go put themselves at (0,0).



 You could turn off autoLayout for the duration of the effect, but that's
 usually a temporary thing done during and effect and not a long-term
 situation you want to be in.



 One solution might be for your Canvas to be wrapped in a custom component,
 subclassing UIComponent. When you click on a thumbnail, put a copy of the
 image into the wrapping container and zoom in on that. It will then cover
 everything below it. When you zoom back out, remove it from the wrapping
 component, and you'll see everything behind it again.



 Chet.





 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Ward Loockx
 *Sent:* Tuesday, December 02, 2008 5:42 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Zoom effect absolute positioning



 Hello,

 I have a canvas within my application that contains polaroid images (own
 flex component). When I click on a polaroid I wan't it to zoom all over
 my application. When I do this now it stays within the canvas and I get
 scrollbars (on that canvas). Is there a way to keep the pictures on the
 canvas and still be able to zoom over my whole application (When zooming
 - go to absolute layout)? Somebody that knows if this is possible ?

 Thanks,
 Ward






 --
 Fotis Chatzinikos, Ph.D.
 Founder,
 Phinnovation
 [EMAIL PROTECTED],




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


[flexcoders] Re: JSP taglib FLEX 3

2008-12-02 Thread jim.abbott45
virchete: I don't have a lot of expertise with the Flex web-tier
compiler. However, If you are trying to compile a Flex application
using the web-tier compiler, then you should normally be loading a
.mxml (and not .jsp) file to the server, and then having your browser
request that file. 

For more information, see: 
http://livedocs.adobe.com/flex/3/html/help.html?content=apache_4.html

--Jim


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

 I am trying to use the jsp tag library into a very simple jsp:
 
 %@ taglib uri=FlexTagLib prefix=mm %
 htmlbody
 h3Introduction/h3
 pThis is an example of writing MXML in a JSP./p
 h3My App/h3
 mm:mxml  
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
   mx:Accordion width=500 height=300
  mx:VBox label=panel1 width=500 height=200 /
   /mx:Accordion
/mx:Application
 /mm:mxml
 /body/html
 
 I have a Java project that uses STRUTS to redirect. Well the problem
 is that, although I have included the flex-bootstrap.jar,
 flex-bootstrap-jsp.jar,  flex-webtier.jar and flex-webtier-jsp.jar I
 always receive the same exception in the explorer or mozilla navigator:
 
 java.lang.NullPointerException
   flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24)
   flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14)
   flex.webtier.server.j2ee.jsp.MxmlTagImpl.init(MxmlTagImpl.java:2)
 
 
 I am using Tomcat 6 server and I receive always the following trace:
 
 EVERE: Servlet.service() for servlet jsp threw exception
 org.apache.jasper.JasperException: Unable to read TLD
 META-INF/taglib.tld from JAR file

file:/C:/google2/MapasOpodo/build/web/WEB-INF/lib/flex-bootstrap.jar: 
java.lang.NullPointerException
 at

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
 at

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
 at

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:181)
 at

org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:182)
 at
 org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
 ...
 ...
 ...
 
 SEVERE: Servlet.service() for servlet jsp threw exception
 java.lang.NullPointerException
 at flex.bootstrap.BootstrapTag.init(BootstrapTag.java:24)
 at
 flex.bootstrap.BootstrapBodyTag.init(BootstrapBodyTag.java:14)
 
 Well If you need something more (the source code) don't doubt to ask
 me. I am so sorry for having to find help, but I have lost all the day
 of work today, and if you could help me...
 
 Many Thanks
 David Virgil.





[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-02 Thread valdhor
Well, I don't use ColdFusion; I use Weborb for PHP.

That said, this is how I would do it with WebOrb for PHP (You should be
able to extrapolate for ColdFusion):

Application:
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=showLogin()
 mx:Script
 ![CDATA[
 import mx.managers.PopUpManager;
 import mx.core.IFlexDisplayObject;
 import LoginWindow;

 private function showLogin():void
 {
 // Create a non-modal TitleWindow container.
 var loginWindow:IFlexDisplayObject =
PopUpManager.createPopUp(this, LoginWindow, false);
 PopUpManager.centerPopUp(loginWindow);
 }
 ]]
 /mx:Script
/mx:Application

LoginWindow.mxml:
?xml version=1.0?
!-- containers\layouts\myComponents\MyLoginForm.mxml --
mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;
initialize=init()
 mx:Script
 ![CDATA[
 import mx.managers.PopUpManager;
 import mx.controls.Alert;
 import mx.events.FlexEvent;
 import mx.rpc.events.ResultEvent;
 import mx.rpc.events.FaultEvent;
 import mx.rpc.remoting.RemoteObject;

 private var loginService:RemoteObject;

 private function init():void
 {
 loginService = new
RemoteObject(loginServiceDestination);
 loginService.requestTimeout = 30;

loginService.processLogin.addEventListener(ResultEvent.RESULT,
processLoginHandler);
 loginService.addEventListener(FaultEvent.FAULT,
faultHandler);
 }

 private function processLogin():void
 {
 loginService.processLogin(username.text, password.text);
 }

 private function processLoginHandler(event:ResultEvent):void
 {
 if(event.result as String == Success!)
 {
 PopUpManager.removePopUp(this);
 }
 else
 {
 Alert.show(Login Failed!);
 username.text = ;
 password.text = ;
 }
 }

 private function faultHandler(fault:FaultEvent):void
 {
 switch(fault.fault.faultCode.toString())
 {
 case Client.Error.RequestTimeout:
  Alert.show(The server is not responding.
Please check that you are connected and the server is running., Server
Timeout);
break;
 default:
 Alert.show(fault.fault.faultString,
fault.fault.faultCode.toString());
 break;
 }
 }

 ]]
 /mx:Script
 mx:Form
 mx:FormItem label=User Name
 mx:TextInput id=username width=100%/
 /mx:FormItem
 mx:FormItem label=Password
 mx:TextInput id=password displayAsPassword=true
width=100%/
 /mx:FormItem
 /mx:Form
 mx:HBox
 mx:Button click=processLogin(); label=OK/
 mx:Button label=Cancel
click=PopUpManager.removePopUp(this);/
 /mx:HBox
/mx:TitleWindow


You can return whatever you like from your service. In the example
above, it is just a string - Success! or Failure.


HTH

Steve

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

 please guys any help am desperate.




[flexcoders] Re: help here with an item renderer

2008-12-02 Thread valdhor
You're Welcome.


Steve


--- In flexcoders@yahoogroups.com, Gustavo Duenas [EMAIL PROTECTED] wrote:

 Sorry man, my bad, it works perfectly was something on my xml causing  
 the error, thanks :)
 
 Gustavo
 On Nov 26, 2008, at 2:12 PM, valdhor wrote:
 
  So, simply...
 
  buttons.xml:
  buttons
  button label=Apple url=http://www.apple.com/
  button label=Amazon url=http://www.amazon.com/
  button label=EBay url=http://www.ebay.com/
  button label=Adobe url=http://www.adobe.com/
  /buttons
 
  mycanvas.mxml:
  ?xml version=1.0 encoding=utf-8?
  mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
  mx:Button label={data.label} click={navigateToURL(new  
  URLRequest(data.url), '_self')}/
  /mx:Canvas
 
  Application:
  ?xml version=1.0 encoding=utf-8?
  mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;  
  layout=absolute
  mx:Model id=myButtons source=buttons.xml/
  mx:HorizontalList dataProvider={myButtons.button}  
  itemRenderer=mycanvas
  columnCount=4 columnWidth=100/
  /mx:Application
 
  --- In flexcoders@yahoogroups.com, Gustavo Duenas gduenas@ wrote:
  
   Sorry , sometimes the ideas are faster than words.
  
   1. I have a xml list
  
   2. I have an horizontal list that uses this xml list(model) as
   dataprovider
  
   3. I have a canvas which is the item renderer(mycanvas.mxml),  
  this is
   the place where the button is.
  
   I'd like to know how can I make my button (in the item renderer) to
   click on the url which is in the xml list button1url1.com/ 
  button1
  
   Regards,
  
   Gustavo
  
   P.D: Pfuii! I hope I'm clear now.
 
 
  
 
 
 
 Gustavo A. Duenas
 Creative Director
 LEFT AND RIGHT SOLUTIONS
 904.  265 0330 - 904. 386 7958
 www.leftandrightsolutions.com
 Jacksonville - Florida





RE: [flexcoders] Flash being cached

2008-12-02 Thread Wildbore, Brendon
If you have the developer toolbar plugin installed on firefox, use that to 
disable the browser cache (make sure there is a tick next to disable cache 
under the disable dropdown)... works like a charm for me.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
flexaustin
Sent: Wednesday, 3 December 2008 5:28 a.m.
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flash being cached


Is there a way to prevent your swf file from being cached? I would
like to prevent this in production and when using the template files
(in bin-debug and bin-release). When using these two html files my
browser seems to cache the swf requiring me to do a couple of
cntrl-r's and sometimes a clear cache in Firefoxs options.

Anyone else have this issue?



[flexcoders] Re: Using XSL in Flex?

2008-12-02 Thread jim.abbott45
Or you could just use the ExternalInterface API to call the XSL(T)
engine that most mainstream browsers include these days. That said,
there is (in my opinion) still the question of whether that approach
leads to a robust solution, particularly w.r.t. cross-browser
differences . . .

If you want to pursue that approach, this appears to be a good resource:
http://ajaxpatterns.org/Browser-Side_XSLT


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

 Can XSL be used to tell Flex how to display XML data? I've got an XML
 help file that I'd like to display in a popup window in Flex without
 having to fetch each element; I'd like to just dump the contents into
 a Flex control and have it automatically apply styles to it. Thanks.





[flexcoders] Re: Flex 3 - Export to Microsoft Excel?

2008-12-02 Thread jim.abbott45
I've successfully implemented two different approaches. 

The first approach just puts the data for Excel _on the clipboard_. It
also uses Microsoft's uber-funky XML schemas to control the formatting
of the resulting spread-sheet. This approach works nicely for both FF
and IE, in my experience (and, in theory, it should work in any
browser that supports the Flash VM, including clipboard access).

The second approach uses the ExternalInterface API to call a JS
function which uses ActiveX to invoke the Excel COM object. If the JS
function is able to load the Excel object, it then calls the object's
COM interface directly (via JS functions) in order to create a
Workbook and then to load data into its cells. Unfortunately, this
approach only works with IE, but it is slick if you can use it. But,
having the first approach as a fall-back is a good idea even then, in
my opinion.

Let me know if you have any specific questions about implementing
either of these.

Regards,
Jim



[flexcoders] Re: Flex nested tree get data from mysql and php

2008-12-02 Thread valdhor
The dataProvider of your arrayCollection is an array. This array
contains objects which contain an array of objects.

I do the same sort of thing for my menus - Each menu is an object that
can contain submenus (ie. arrays of menuItem objects). Note: This is all
WebOrb.

So, in PHP:
class Menu
{
 public $ID;
 public $label;
 public $ParentMenuID;
 public $children;

 function __construct()
 {
 $this-label = ;
 $this-ParentMenuID = null;
 $this-children = array();
 }
}

class MenuItem
{
 public $ID;
 public $label;
 public $Link;
 public $ParentMenuID;

 function __construct()
 {
 $this-label = ;
 $this-Link = ;
 $this-ParentMenuID = null;
 }
}

Flex:
package myServices
{
 [RemoteClass(alias=Classes.Menu)]
 [Bindable]
 public class Menu
 {
 //instance variables
 private var _ID:String;
 private var _label:String;
 private var _ParentMenuID:int;
 private var _children:Array = new Array();

 //accessor methods
 public function get ID():String {return _ID;}
 public function get label():String {return _label;}
 public function get ParentMenuID():int {return _ParentMenuID;}
 public function get children():Array {return _children;}

 //mutator methods
 public function set ID(ID:String):void {_ID = ID;}
 public function set label(label:String):void {_label = label;}
 public function set ParentMenuID(ParentMenuID:int):void
{_ParentMenuID = ParentMenuID;}
 public function set children(children:Array):void {_children =
children;}
 } // end class Menu
}//end package

package myServices
{
 [RemoteClass(alias=Classes.MenuItem)]
 [Bindable]
 public class MenuItem
 {
 //instance variables
 private var _ID:String;
 private var _label:String;
 private var _Link:String;
 private var _ParentMenuID:int;

 //accessor methods
 public function get ID():String {return _ID;}
 public function get label():String {return _label;}
 public function get Link():String {return _Link;}
 public function get ParentMenuID():int {return _ParentMenuID;}

 //mutator methods
 public function set ID(ID:String):void {_ID = ID;}
 public function set label(label:String):void {_label = label;}
 public function set Link(Link:String):void {_Link = Link;}
 public function set ParentMenuID(ParentMenuID:int):void
{_ParentMenuID = ParentMenuID;}
 } // end class Menu
}//end package


I parse the records from a MySQL database and create arrays as required.
I then populate the children property with the array of menuItem objects
of the submenu.

When I get the result in Flex I convert it to an ArrayCollection:

menuBarCollection = new
ArrayCollection(ArrayUtil.toArray(event.result));

and then use the data in my menuBar:

mx:MenuBar id=menuBar dataProvider={menuBarCollection}/

HTH


Steve


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

 So I am trying to build a MPTT (nested tree) object in php, I have a
 few questions for this group because I am not sure how the data should
 be returned.  I have been using static data and have a few questions
 on what is contained within the data.  Here is my arraycollection:
 private var myDataProvider:ArrayCollection = new ArrayCollection([
   Region:Southwest,ID:1,Territory_Rep:Tom Jones, children: [
 {Region:Arizona,ID:2, children: [
  {Territory_Rep:Barbara Jennings, ID:3},
  {Territory_Rep:Dana Binn,ID:4}]},
 {Region:Central California,ID:5, children: [
 {Territory_Rep:Joe Smith, ID:6}]},
  {Region:Nevada, ID:7, children: [
 {Territory_Rep:Bethany Pittman,ID:8}]},
  {Region:Northern California, ID:9, children: [
 {Territory_Rep:Lauren Ipsum,ID:10},
 {Territory_Rep:T.R. Smith,ID:11}]},
  {Region:Southern California,ID:'12', children: [
 {Territory_Rep:Alice Treu, ID:'13'},
 {Territory_Rep:Jane Grove,ID:14}]}
]}
 ]);

 I am in need of some guidance, so bear with me :). I think that this
 is an object {Territory_Rep:Joe Smith, ID:6}, is this an array
 with an object {Region:Central California,ID:5, children: [
 {Territory_Rep:Joe Smith, ID:6}]} ?

 Here is my problem, I am creating some php data returns to flex with
 arrays, object, assoc arrays.  I am not sure what a flex
 arraycollection is so I am running some tests.  Here are some tests
 that I have done,
 Example #1
 PHP CODE
 $o1-name = 'Tom';
 $o1-status = 'Dad';

 $o2-name = 'Wendy';
 $o2-status = 'Daughter';
 $b[] = $o2;
 $o1-child = $b;
 $arr[] = $o1;
 return $arr;

 Charles Proxy Sees This:
 com.mptt.MPTT.GetTree
 Parameters
 Results
  [0]
   name
   status
 child
  [0]
   name
   status

 Example #2
 $o1-name = 'Tom';
 $o1-status = 'Dad';

 $o2-name = 'Wendy';
 $o2-status = 'Daughter';
 $o1-child = $o2;
 $arr[] = 

[flexcoders] Re: ItemRenderer, mislabels scrolling

2008-12-02 Thread ross_w_henderson
I've had similar issues.  

One of the things I've found is that it is important to reduce the
steps between this.data, or this.listData, and the property you're
populating. 

If you can rewrite so that you bind directly on this.listData.label,
rather than set the value of 'value' and bind on 'value', I think
you'll probably be okay.


Alex - if you wrote a book on item renderers, I would buy it.  Just so
you know there's a market.


Ross




--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 itemRenderer.data should always be the data for the row.  It should
never be the old data unless you overrode the setter.
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Robert
 Sent: Monday, December 01, 2008 3:58 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] ItemRenderer, mislabels  scrolling
 
 
 When scrolling, the labels on the grid turn into those that the
 recycled item renderer used. I tried using this.data to overwrite
 the values every time. The new listData object has the correct
 label and so I thought it was working, but there is a url I need in
 the current rows' XML for the button click to work and accessing the
 this.data gave me the old results. I then thought I could use the
 row index in listData but quickly found that the row index is always
 the same when scrolling down or up, the end or the begining of the
 grid. So it's not really the row index of the XML but the grid.
 Seems overwritting the values wasn't quite the answer.
 
 There is a variable in listData called item. I see it in the
 debugger but the compiler won't let me access it. This is the XML
 for the row. So, in short, how can I access this 'listData.item' or
 find out the actual XML row I am on. Actually, any suggestion would
 be great. Banging my head on this one all day.
 
 And thanks.
 
 Here's some code:
 
 public function get listData():BaseListData{
 return _listData;
 }
 
 public function set listData(blData:BaseListData):void{
 _listData = DataGridListData(blData);
 renderData();
 }
 
 private function renderData():void {
 var columnIndex:int;
 var xmlRow:XML;
 
 columnIndex = this.listData.columnIndex;
 xmlRow = XML(this.data);
 /*
 * I added this to get at the item.
 try{
 if(this.listData.item != null){
 xmlRow = XML(this.listData.item);
 }
 else{
 xmlRow = XML(this.data);
 }
 }
 catch(e:Error){
 xmlRow = XML(this.data);
 }
 */
 
 this.value = this.listData.label;
 if ( value == [multiple] ){
 this.creativeLinkButton.enabled = false;
 this.creativeLinkButton.useHandCursor = false;
 this.creativeLinkButton.setStyle(textDecoration, none);
 }
 else{
 this.creativeLinkButton.enabled = true;
 this.creativeLinkButton.useHandCursor = true;
 this.creativeLinkButton.setStyle(textDecoration, underline);
 }
 
 // get toolTip = @u(columnIndex)
 // get url = @u(columnIndex)
 var urlName:String = @u + columnIndex.toString();
 this.url = xmlRow[urlName];
 this.description = xmlRow[urlName];
 }
 
 override protected function setMXMLViewBindings():void{
 super.setMXMLViewBindings();
 this.logger.debug(setMXMLViewBindings);
 
 // Set creativeLink link button's label
 BindingUtils.bindProperty(this.creativeLinkButton, label, this,
 [value]);
 
 // Set creativeLink link button's toolTip
 BindingUtils.bindProperty(this.creativeLinkButton, toolTip,
 this, [description]);
 }





[flexcoders] Replacement Date class?

2008-12-02 Thread Pan Troglodytes
Now that the whole ECMAScript thing has blown over, Adobe is free of being
quite so bound to it as a standard.  They've expressed interest in doing
some things that they previously shied away from because of divergence from
the standard.

Is anyone else really interested in ditching the Date class?  That thing
drives me nuts.  The number one problem is that it's an object.  So you get
something like this:

var myDate:Date = new Date(2008, 1, 1);
var myDate2:Date = myDate;
...
myDate2.month++;

It's an easy mistake to miss, especially for beginners, and it can be very
annoying to track done.  It's also a pain that you can assign values to the
time, day, month, etc. properties and it screws up data bindings and
setters/getters.  For example, if I have:

private var myDate:Date;
[Bindable] public function set myDate(value:Date):void
{
  _myDate = value;
  invalidateDisplayList();
}
public function get myDate():Date
{
  return _myDate;
}

It works great until you do something like:
  myDate.time = newDate.time;
or
  myDate.date++;


Simliar difficulties exist when using a date dropdown control.

So is it time to get a new Date class?  Perhaps a new one called DateTime
and make the old one deprecated.

What I'd love is for it to be a new primitive type (like Number, int,
Boolean) that would be stored the same way as the time property of Date and
would be manipulated through static functions of the DateTime class.
Examples:

var myDate:DateTime = DateTime.now();
trace(myDate:, myDate);
 myDate: 1228248636245

myDate = DateTime.incHour(myDate);
myDate = DateTime.incMinute(myDate, 20);
myDate = DateTime.incMonth(myDate, -3);
myDate = DateTime.incHourUTC(myDate);
myDate = DateTime.encode(2008, 1, 1);
var hours:Number = DateTime.getHours(myDate2 - myDate1);

No more date or fullYear - use the much more intuitive day and
year.  I would also like month to be one-based, but that'd probably make
enough people grumble that I'd be willing to live without it.

I dream of seeing all the existing controls and such that use Date updated
to use this code instead.  I would have already created the DateTime class
if it wasn't for how much trouble daylight savings time, leap year and
internationalization would be.

-- 
Jason


[flexcoders] Re: Mouse off stage and ajax bridge

2008-12-02 Thread flexaustin
Thanks Alex!

--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 Fake a MOUSE_UP event
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of flexaustin
 Sent: Tuesday, December 02, 2008 7:51 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Mouse off stage and ajax bridge
 
 
 Is there a way to stop all mouse event listeners from the stage? Or
 will I need to do it the hard way and track down all mouse event
 listeners.
 
 My issue is that I have a Hslider that controls a component. When a
 user stops scrolling for a certain amount of time, pausing, I update
 the component. Updating also sends out some new information to the
 html page via the ajax bridge. This causes the html page to popup up
 js run loading popup. Well, when the loading js popup comes up flash
 somehow loses focus of the mouse and still thinks the mouse button is
 pressed so when flash gets focus again the slider follows the mouse
 around even if the mouse isn't on the slider anymore.
 
 I really don't want to have to rework this old project. Wasn't an
 issue with flash player 9. I guess Adobe made flash player to fast,
 thus my js file is getting notification immediately.





Re: [flexcoders] Replacement Date class?

2008-12-02 Thread Guy Morton
It'd be great to have some date math methods in there as well. Simple  
things like getting the # of days/weeks/months between 2 dates is  
currently much more clunky than it ought to be. It'd be nice if it had  
some of what perl's DateTime module is capable of.



On 03/12/2008, at 7:19 AM, Pan Troglodytes wrote:

Now that the whole ECMAScript thing has blown over, Adobe is free of  
being quite so bound to it as a standard.  They've expressed  
interest in doing some things that they previously shied away from  
because of divergence from the standard.


Is anyone else really interested in ditching the Date class?  That  
thing drives me nuts.  The number one problem is that it's an  
object.  So you get something like this:


var myDate:Date = new Date(2008, 1, 1);
var myDate2:Date = myDate;
...
myDate2.month++;

It's an easy mistake to miss, especially for beginners, and it can  
be very annoying to track done.  It's also a pain that you can  
assign values to the time, day, month, etc. properties and it screws  
up data bindings and setters/getters.  For example, if I have:


private var myDate:Date;
[Bindable] public function set myDate(value:Date):void
{
  _myDate = value;
  invalidateDisplayList();
}
public function get myDate():Date
{
  return _myDate;
}

It works great until you do something like:
  myDate.time = newDate.time;
or
  myDate.date++;


Simliar difficulties exist when using a date dropdown control.

So is it time to get a new Date class?  Perhaps a new one called  
DateTime and make the old one deprecated.


What I'd love is for it to be a new primitive type (like Number,  
int, Boolean) that would be stored the same way as the time property  
of Date and would be manipulated through static functions of the  
DateTime class.  Examples:


var myDate:DateTime = DateTime.now();
trace(myDate:, myDate);
 myDate: 1228248636245

myDate = DateTime.incHour(myDate);
myDate = DateTime.incMinute(myDate, 20);
myDate = DateTime.incMonth(myDate, -3);
myDate = DateTime.incHourUTC(myDate);
myDate = DateTime.encode(2008, 1, 1);
var hours:Number = DateTime.getHours(myDate2 - myDate1);

No more date or fullYear - use the much more intuitive day and  
year.  I would also like month to be one-based, but that'd  
probably make enough people grumble that I'd be willing to live  
without it.


I dream of seeing all the existing controls and such that use Date  
updated to use this code instead.  I would have already created the  
DateTime class if it wasn't for how much trouble daylight savings  
time, leap year and internationalization would be.


--
Jason






Re: [flexcoders] Re: Flex 3 - Export to Microsoft Excel?

2008-12-02 Thread Howard Fore
A third option posts HTML Table formatted data (in a new browser window) to
a server-side script (ColdFusion in my case but ASP/JSP/PHP should work as
well) which then reflects it to the browser with the MIME type set to one of
the myriad Excel versions. Then the browser handles it as needed (save file,
ask user, open in Excel, etc.).

On Tue, Dec 2, 2008 at 3:01 PM, jim.abbott45 [EMAIL PROTECTED] wrote:

 I've successfully implemented two different approaches.

 The first approach just puts the data for Excel _on the clipboard_. It
 also uses Microsoft's uber-funky XML schemas to control the formatting
 of the resulting spread-sheet. This approach works nicely for both FF
 and IE, in my experience (and, in theory, it should work in any
 browser that supports the Flash VM, including clipboard access).

 The second approach uses the ExternalInterface API to call a JS
 function which uses ActiveX to invoke the Excel COM object. If the JS
 function is able to load the Excel object, it then calls the object's
 COM interface directly (via JS functions) in order to create a
 Workbook and then to load data into its cells. Unfortunately, this
 approach only works with IE, but it is slick if you can use it. But,
 having the first approach as a fall-back is a good idea even then, in
 my opinion.

 Let me know if you have any specific questions about implementing
 either of these.

 Regards,
 Jim


 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location:
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives:
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
 Links






-- 
Howard Fore, [EMAIL PROTECTED]
The universe tends toward maximum irony. Don't push it. - Jeff Atwood


[flexcoders] Load time, multiple redundant Embed() calls, etc.

2008-12-02 Thread Eric Cooper
Hi,

I have inherited some code and it seems to build into a fairly large .swf and 
takes a very long 
time to download. Running locally, things go fairly quickly - but not so 
remotely. Part of this 
may be due to slow server and net connection - but I am not able to change 
those any time 
soon.

So, I wonder two things:

1. Are there tools for highlighting cause of slowness of download (e.g., areas 
of bloat in 
code)?

2. If the code is rife with [Embed(source=foo.png)] - where same 'foo' is 
being embedded in 
multiple files - would cause bloat? And would it be better to have one managing 
singleton 
that embedded all images?

Thanks!
-Eric



Re: [flexcoders] Detect a databinding

2008-12-02 Thread Marco Catunda
Hi Jules,

Let me say about my problem. I've developed a class that implements
IList interface for implicit pageable
approach. This class works fine for one data provider of component. If
I use it in two or more components
the list become flicker.

The problem of this flicker is when one component needs to get itens
which is different for other component.
The limit page in memory fill itens for one component, all components
will receive events collection
change, all components will refresh itens so the other component will
get other itens and this loop will work
forever.

My solution was implement 'n' pages for 'n' components, but why could
I detect how many components is
using this object, the first idea was inspect a bindings?

I saw a generated action script for binding, but I couldn't find out
any solution. I didn't figure out how it
works. There is some undocument API that I didn't understand.

The idea of overrinding addEventListener don't work because the system
never calls removeEventListener,
so the pages which was created will never remove from memory. It is a
memory leak problem.

I don't have any idea how Flex remove theses listeners. Maybe it is a
voodoo approach. :)


Regards,

On Tue, Dec 2, 2008 at 11:00 AM, Jules Suggate [EMAIL PROTECTED] wrote:
 Hi Marco, first up you have to ask yourself why you want this feature?
 There may be another way to solve the problem. However, here's what I
 know of your specific question...

 Last time I checked (Flex 3 beta 2) there was no *official* way to
 inspect the bindings on a component at runtime. However, if you create
 a component with bindings and load it up at runtime, you will find
 there are undocumented properties that enable you to do this. Look for
 a _watchers array -- you will also find it helpful to keep the
 generated actionscript that the Flex compiler normally throws away so
 you can read how databinding is implemented.

 The properties above are not part of the public API, so could change
 at any time. In fact, IIRC some of the very binding properties I just
 mentioned may even have been deprecated in the final Flex 3 release...
 proceed with caution.

 Which is why I ask what the actual problem is you are trying to solve
 -- perhaps the list can help you come up with other ideas :-)

 For example, your idea of overriding addEventListener is cunning --
 perhaps that solution can be explored further.

 Cheers,
 Jules

 On Tue, Dec 2, 2008 at 23:05, Marco Catunda [EMAIL PROTECTED] wrote:
 Hi,

 I have a singleton class with model data provider (like cairngorm model).

 Some user interface components binding this model in data provider
 property.

 I didn't find out any way to detect if there is binding in this model
 or not, and
 how many bindings.

 The binding model works with events, so my idea was override
 addEventListener
 in singleton model to detect binding. But it don't work because the
 removeEventListener
 isn't call when component go away.

 Does anyone has any tips?

 Regards
 --
 Marco Catunda



 

-- 
Marco Catunda


[flexcoders] Re: Using XSL in Flex?

2008-12-02 Thread oneworld95
Well, maybe it's more efficient to do this another way. Let me explain
what I'm trying to accomplish and see what you think is the best way
to it: I'd like to grab a text file (XML or HTML) and load it into a
Flex control and have it formatted correctly without having to fetch
individual elements from the XML and putting them into label controls.
Thanks.

-Alex

--- In flexcoders@yahoogroups.com, jim.abbott45 [EMAIL PROTECTED]
wrote:

 Or you could just use the ExternalInterface API to call the XSL(T)
 engine that most mainstream browsers include these days. That said,
 there is (in my opinion) still the question of whether that approach
 leads to a robust solution, particularly w.r.t. cross-browser
 differences . . .
 
 If you want to pursue that approach, this appears to be a good resource:
 http://ajaxpatterns.org/Browser-Side_XSLT
 
 
 --- In flexcoders@yahoogroups.com, oneworld95 oneworld95@ wrote:
 
  Can XSL be used to tell Flex how to display XML data? I've got an XML
  help file that I'd like to display in a popup window in Flex without
  having to fetch each element; I'd like to just dump the contents into
  a Flex control and have it automatically apply styles to it. Thanks.
 





[flexcoders] Using RMTPS channel

2008-12-02 Thread ivhaggi
Hi group, i have a simple question, If i want to use the
SecureRTMPChannel its a must the SecureAMFChannel be enabled?

Thanks in advanced.
Ivan.



Re: [flexcoders] Flash being cached

2008-12-02 Thread Adrian Williams

Hey there...

   We had the same issue and were able to work around it by adding the 
following three lines to the html wrapper...in the head section:


meta http-equiv=Expires content=Mon, 04 Dec 1999 21:29:02 GMT /
meta http-equiv=CACHE-CONTROL content=NO-CACHE /
meta http-equiv=PRAGMA content=NO-CACHE /

HTH,
Adrian

flexaustin wrote:


Is there a way to prevent your swf file from being cached? I would
like to prevent this in production and when using the template files
(in bin-debug and bin-release) . When using these two html files my
browser seems to cache the swf requiring me to do a couple of
cntrl-r's and sometimes a clear cache in Firefoxs options.

Anyone else have this issue?

 


[flexcoders] Re: data serialization

2008-12-02 Thread Anthony DeBonis
You did not post your code for UserList.as

Did you add the meta tag RemoteClass? If not Flex does not know how 
to map the class back...

  [RemoteClass(alias=com.whatever.UserList) 




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

 Hello,
 Im having problem getting the data from java to flex and im totally
 new to flex and cairngorm... here is my code snippet:
 
 im my java end:
 
  ListUsers getAll() {  // from hibernate dao then return result
 which llist of users }
 
 in AS files:
 
 public class ListDelegate extends EventDispatcher
 {
 private var userService:RemoteObject;
 private var responder:IResponder;

 public function ListDelegate(responder:IResponder)
 {
 this.userService = new 
 RemoteObject(userService);

 this.responder = responder;
 }

 public function getUserList():void
 {

 var call : Object = userService.getAll();

 call.addResponder( responder );

 }
 }
 
 
 public class ListUserCommand extends BaseCommand
 {


 override protected function callDelegate():void
 {
 var listdelegate:ListDelegate = new
 ListDelegate(this);
 listdelegate.getUserList();
 }

 override public function result( event : Object ) : 
void
 {
 this.modelHelper.onResultUser(event);

 }

 override public function fault( event : Object ) : 
void
 {
 var faultevt:FaultEvent = event as 
FaultEvent;
 Alert.show(faultevt.fault.rootCause.toString
());
 }
 
 }
 
 public class ModelHelper
 {
 [Bindable]
 public var userlist: UserList;

 public function ModelHelper(userlist: UserList)
 {
 this.userlist = userlist;
 }

 public function getUserList():void
 {
 new ListUserEvent(this).dispatch();
 }

 public function onResultUser(event:Object):void
 {
 this.userlist.listusers = event.result as
 ArrayCollection;
 }
 
 }
 
 ..and i use DataGrid to display datas:
 
 ?xml version=1.0 encoding=utf-8?
 mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml;
 initialize=init()
 creationComplete=loadAll() 

 mx:Script
   ![CDATA[
   import com.test.flex.util.UserList;
   import mx.rpc.events.ResultEvent;
   import com.test.flex.model.ViewModelLocator;
   import com.test.flex.events.ListUserEvent;
   import com.test.flex.model.ModelHelper;
  
   [Bindable]
   private var modelLocator:ViewModelLocator =
 ViewModelLocator.getInstance();
  
   [Bindable]
   public var modelHelper:ModelHelper;
   [Bindable]
   public var users:UserList;
  
   public function init():void
   {
 this.users = new UserList();
 this.modelHelper = new ModelHelper(users);

   }
  
   public function loadAll():void
   {
   this.modelHelper.getUserList();
   }
  
  
  
   ]]
  /mx:Script
  
  !-- mx:Label text={modelLocator.test}/ --
  
  mx:DataGrid id=userlist
 dataProvider={modelHelper.userlist.listusers}
   mx:columns
   mx:DataGridColumn headerText=ID dataField=id/
   mx:DataGridColumn headerText=Username dataField=username/
   mx:DataGridColumn headerText=Password dataField=password/
   /mx:columns
  /mx:DataGrid
  

 mx:Button id=logout label=LogOut
 click={modelLocator.modelWorkflowState =
 ViewModelLocator.LOGIN_SCREEN}/
 /mx:VBox
 
 ..and the rest are straigthforward code. When I change the return
 value to String it works fine nut when put it back to List it 
display
 nothing or error i get but when i debug it i gets the results:
 
 11:20:14,459 INFO  [STDOUT] Hibernate: select this_.ID as ID1_0_,
 this_.USERNAME as USERNAME1_0_, this_.PASSWORD as PASSWORD1_0_ from
 user this_
 11:20:14,464 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG]
 [Service.Remoting] Adapter 'java-object' called
 'userService.getAll(java.util.Arrays$ArrayList (Collection size:0)
 )'
 11:20:14,465 INFO  [STDOUT] [BlazeDS]12/02/2008 [DEBUG]
 [Service.Remoting] Result: 'java.util.ArrayList (Collection size:2)
   [0] = com.test.flex.model.User
 id = 1
 username = eman
 password = password
 
   [1] = com.test.flex.model.User
 id = 2
 

[flexcoders] any overhead for calling simple getters?

2008-12-02 Thread Pan Troglodytes
If I have this:

private var _myvar:int;
public function get myvar():int
{
  return _myvar;
}

should I try to refer to it in other parts of the same class as _myvar, or
is myvar equally efficient?  In Delphi, you can define a property like:

FMyVar: Integer;
property MyVar:Integer read FMyVar;

and all references to MyVar automatically get optimized to FMyVar.  But I'm
wondering if Flex optimizes out the unnecessary function call represented
above.

-- 
Jason


Re: [flexcoders] any overhead for calling simple getters?

2008-12-02 Thread Josh McDonald
There's *some* overhead, but properties are part of the VM, so it's not
going to be much.

Also, keep in mind, anything that's [Bindable] without
[Bindable(eventName)] is going to have a get/set pair generated by MXMLC,
even if you've already written a get/set pair.

Personally, I only ever use the _privateVar reference internally when
there's some voodoo in the getter (like construction logic for first access,
or something) I need to work around in some circumstances.

-Josh

On Wed, Dec 3, 2008 at 7:37 AM, Pan Troglodytes [EMAIL PROTECTED]wrote:

  If I have this:

 private var _myvar:int;
 public function get myvar():int
 {
   return _myvar;
 }

 should I try to refer to it in other parts of the same class as _myvar, or
 is myvar equally efficient?  In Delphi, you can define a property like:

 FMyVar: Integer;
 property MyVar:Integer read FMyVar;

 and all references to MyVar automatically get optimized to FMyVar.  But I'm
 wondering if Flex optimizes out the unnecessary function call represented
 above.

 --
 Jason
 




-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


[flexcoders] Re: how to play partially downloaded local flv file ?

2008-12-02 Thread Anthony DeBonis
Are you using FileStream? 

Are you calling open()  with FileMode.READ ?


On systems that support file locking, a file opened in write 
or update mode (FileMode.WRITE or FileMode.UPDATE) is not readable 
until it is closed.



[flexcoders] Setting a specific row in the ADG to editable vs. the entire grid?

2008-12-02 Thread Adrian Williams

Hi All,

   I have a new question that I haven't seen anyone hit yet. 

   I have my ADG that is not editable...however, I need to be able to 
make a couple of specific rows editable so the user can modify the 
values in the cells of the row. All of the documentation seems to 
identify setting up columns to be editable and not, but I've not seen 
anything on how to setup a specific row as editable. 


   Anyone done this or know the trick?

Thanks!
Adrian


Re: [flexcoders] Re: ItemRenderer, mislabels scrolling

2008-12-02 Thread Robert Byrne
Ross, when I saw your idea I went straight to it thinking this might be it!  
But it wasn't.  Infact, this.listData.label was the old information.  But when 
entering the renderData function, it is the new value.  This only serves to 
confuse me even more.  It's like the binding never happened.
 
I tried both of these:
 
BindingUtils.bindProperty(this.creativeLinkButton, label, this, [listData, 
label]);
BindingUtils.bindProperty(this.creativeLinkButton, label, this.listData, 
[label]);
-
Sorry bout the colors and font, pasted from eclipse.
 
Also, I looked into this.data.  I set a break in my code and mx.core.Container 
to see not only the value passed into the set data function but to see when 
things are kicking off.  Well, the data is not being set until after my code 
runs.  The correct information is passed into the setter, but not at the right 
time.
 
Perhaps I can use the data change event that is dispatched to update my 
values.  Any other ideas?
 
Thanks,
-Robert
 
--- On Tue, 12/2/08, ross_w_henderson [EMAIL PROTECTED] wrote:

From: ross_w_henderson [EMAIL PROTECTED]
Subject: [flexcoders] Re: ItemRenderer, mislabels  scrolling
To: flexcoders@yahoogroups.com
Date: Tuesday, December 2, 2008, 3:19 PM

I've had similar issues.  

One of the things I've found is that it is important to reduce the
steps between this.data, or this.listData, and the property you're
populating. 

If you can rewrite so that you bind directly on this.listData.label,
rather than set the value of 'value' and bind on 'value', I
think
you'll probably be okay.


Alex - if you wrote a book on item renderers, I would buy it.  Just so
you know there's a market.


Ross




--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 itemRenderer.data should always be the data for the row.  It should
never be the old data unless you overrode the setter.
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Robert
 Sent: Monday, December 01, 2008 3:58 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] ItemRenderer, mislabels  scrolling
 
 
 When scrolling, the labels on the grid turn into those that the
 recycled item renderer used. I tried using this.data to overwrite
 the values every time. The new listData object has the correct
 label and so I thought it was working, but there is a url I need in
 the current rows' XML for the button click to work and accessing the
 this.data gave me the old results. I then thought I could use the
 row index in listData but quickly found that the row index is always
 the same when scrolling down or up, the end or the begining of the
 grid. So it's not really the row index of the XML but the grid.
 Seems overwritting the values wasn't quite the answer.
 
 There is a variable in listData called item. I see it in the
 debugger but the compiler won't let me access it. This is the XML
 for the row. So, in short, how can I access this 'listData.item'
or
 find out the actual XML row I am on. Actually, any suggestion would
 be great. Banging my head on this one all day.
 
 And thanks.
 
 Here's some code:
 
 public function get listData():BaseListData{
 return _listData;
 }
 
 public function set listData(blData:BaseListData):void{
 _listData = DataGridListData(blData);
 renderData();
 }
 
 private function renderData():void {
 var columnIndex:int;
 var xmlRow:XML;
 
 columnIndex = this.listData.columnIndex;
 xmlRow = XML(this.data);
 /*
 * I added this to get at the item.
 try{
 if(this.listData.item != null){
 xmlRow = XML(this.listData.item);
 }
 else{
 xmlRow = XML(this.data);
 }
 }
 catch(e:Error){
 xmlRow = XML(this.data);
 }
 */
 
 this.value = this.listData.label;
 if ( value == [multiple] ){
 this.creativeLinkButton.enabled = false;
 this.creativeLinkButton.useHandCursor = false;
 this.creativeLinkButton.setStyle(textDecoration,
none);
 }
 else{
 this.creativeLinkButton.enabled = true;
 this.creativeLinkButton.useHandCursor = true;
 this.creativeLinkButton.setStyle(textDecoration,
underline);
 }
 
 // get toolTip = @u(columnIndex)
 // get url = @u(columnIndex)
 var urlName:String = @u + columnIndex.toString();
 this.url = xmlRow[urlName];
 this.description = xmlRow[urlName];
 }
 
 override protected function setMXMLViewBindings():void{
 super.setMXMLViewBindings();
 this.logger.debug(setMXMLViewBindings);
 
 // Set creativeLink link button's label
 BindingUtils.bindProperty(this.creativeLinkButton, label,
this,
 [value]);
 
 // Set creativeLink link button's toolTip
 BindingUtils.bindProperty(this.creativeLinkButton, toolTip,
 this, [description]);
 }






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
Groups Links






  

Re: [flexcoders] Is there any Name -Value Pair concept for Arrays?

2008-12-02 Thread anuj sharma
Hi Tracy
Finally I would be able to retrieve labels but sorry I used labelFunction
because for some reason labelfield is breaking other programmer's code: I
have no idea why.
So Below is my code. But Now I am doing some logical error. I am getting all
the values in an array but it gives all the entries in all the whole list.
For example if there are 10 values named friendly name I need the list to
show
Value 1
Value 2
Value 3
.
.
.
.

Value10 as 10 entries in the list but with my code it is showing
Value1,Value2Value10 10times in 10 rows with 10 entries in each row 10
times . I guess I am messing up in the logic. Can you please help me to fix
this problem.
Thanks alot for all your help
Anuj

/*CODE*/

public var arrPoolNameText:Array=new Array();
private function assignFriendlyName(item:Object):String
{
var devicesTextFN:XMLList =
devicesCollection.child(attributes).child(attribute);


for each (var attributesInFriendlyPool:* in devicesTextFN)
{
//Checks if the attribute name is pool
if([EMAIL PROTECTED] == 'friendly-name')
{
var poolnameText:String =
attributesInFriendlyPool.toString();
arrPoolNameText.push(poolnameText);
}
}
return arrPoolNameText.toString();
}

mx:List id=nvrsInPoolList labelFunction=assignFriendlyName
horizontalScrollPolicy=on allowMultipleSelection=true
dragMoveEnabled=true dragEnabled=true dropEnabled=true
y=105 x=17 height=462 width=294/
On Mon, Dec 1, 2008 at 6:36 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

Skip the Array entirely.



 Use the devicesCollection directly as the dataProvider:

 nvrsInPoolList.dataProvider = devicesCollection;

  Then do:

 mx:List id=nvrsInPoolList
 labelField=[EMAIL PROTECTED] …/



 labelField tells List what to display.



 Then nvrsInPoolList.selectedItem will contain the *entire xml node* and
 you can access any value from it,



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Monday, December 01, 2008 4:27 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Is there any Name -Value Pair concept for
 Arrays?



 Hi Tracy
 Yes I have attached code to tell you exactly how I am doing this. I am
 assigning an Array to my dataProvider and my array consists of XML Nodes. I
 hope I answer all of your questions. I am putting array of XML Nodes as
 dataProviders in List. I hope the code below will help you. Please let me
 know how to solve the problem of displaying different entities as labels and
 values in the List.
 Thanks for all your help
 Anuj

 //MXML Code
 mx:HTTPService id=devicesXML method=GET resultFormat=e4x
 result=devicesXMLHandler(event) showBusyCursor=true
 /mx:HTTPService

 mx:List id=nvrsInPoolList allowMultipleSelection=true
 dragMoveEnabled=true dragEnabled=true dropEnabled=true
 y=105 x=17 height=462 width=294/

 //Action Script Code

 [Bindable]
 private var devicesInList:Array=new Array();
 [Bindable]
 private var devicesList:XMLList;
 [Bindable]
 private var poolsList:XMLList;
 [Bindable]
 private var devicesCollection:XMLListCollection;


 public function init()
 {
 devicesXML.url=http://121.0.30.6:8182/config/devices;;
 devicesXML.useProxy=false;
 }
 private function devicesXMLHandler(event:ResultEvent):void
 {
 devicesList = event.result.device;
 devicesCollection = new XMLListCollection(devicesList);

//Checks every device
 for each (var devicesInPool:* in devicesList) {
 var deviceName:String = [EMAIL PROTECTED];
 var label:[EMAIL PROTECTED];

 devicesInList.push(deviceName);
 }
 nvrsInPoolList.dataProvider = devicesInList;
 }


 On Mon, Dec 1, 2008 at 1:24 PM, Tracy Spratt [EMAIL PROTECTED]
 wrote:

 dataProviders do not display anything.  But whatever your display
 component, there is a way to specify which property on the item you want to
 display.



 You say your dataProvider is an array.  Are you sure?  How are you sure?
 Are you using the work array in its purely technical sense, or in a more
 generic sense, that includes associative array and arrayCollection?



 If it is an Array, what is it an array of? (dynamic objects, scalar values,
 xml nodes?)



 What is your resultFormat?



 Have you inspected your data in the result handler function?



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj181
 *Sent:* Monday, December 01, 2008 2:48 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Is there any Name -Value Pair concept for 

[flexcoders] Re: Setting a specific row in the ADG to editable vs. the entire grid?

2008-12-02 Thread Tim Hoff

Hi Adrian,

As far as I know, you can't allow editing of specific cells/rows by
default.  You can however add an event listener for the
itemEditBeginning event.  In the event handler function, if the cell/row
meets you're editable criteria, allow the function to set the
editedItemPosition property.  Otherwise, call the preventDefault()
method, to prevent editing.  I haven't tried this for ADG, but maybe
this will help.

-TH

--- In flexcoders@yahoogroups.com, Adrian Williams [EMAIL PROTECTED] wrote:

 Hi All,

 I have a new question that I haven't seen anyone hit yet.

 I have my ADG that is not editable...however, I need to be able to
 make a couple of specific rows editable so the user can modify the
 values in the cells of the row. All of the documentation seems to
 identify setting up columns to be editable and not, but I've not seen
 anything on how to setup a specific row as editable.

 Anyone done this or know the trick?

 Thanks!
 Adrian






[flexcoders] Re: Using XSL in Flex?

2008-12-02 Thread Paul Fischer
--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 Well, maybe it's more efficient to do this another way. Let me explain
 what I'm trying to accomplish and see what you think is the best way
 to it: I'd like to grab a text file (XML or HTML) and load it into a
 Flex control and have it formatted correctly without having to fetch
 individual elements from the XML and putting them into label controls.
 Thanks.
 
 -Alex
 
 --- In flexcoders@yahoogroups.com, jim.abbott45 jim.abbott45@
 wrote:
 
  Or you could just use the ExternalInterface API to call the XSL(T)
  engine that most mainstream browsers include these days. That said,
  there is (in my opinion) still the question of whether that approach
  leads to a robust solution, particularly w.r.t. cross-browser
  differences . . .
  
  If you want to pursue that approach, this appears to be a good
resource:
  http://ajaxpatterns.org/Browser-Side_XSLT
  
  
  --- In flexcoders@yahoogroups.com, oneworld95 oneworld95@ wrote:
  
   Can XSL be used to tell Flex how to display XML data? I've got
an XML
   help file that I'd like to display in a popup window in Flex without
   having to fetch each element; I'd like to just dump the contents
into
   a Flex control and have it automatically apply styles to it. Thanks.
  
 


Alex, with my component, I grab an HTML file which is formatted using
the limited set of tags that the TextArea component supports. Then I
set the htmlText property of the TextArea instance. I can also call a
servlet URL that transforms the help text in XML format and apply the
formatting using an xsl stylesheet. The Flex part only knows it is
calling a URL and getting back formatted text.

/Paul



[flexcoders] clear the cache

2008-12-02 Thread Adolfo Ruiz

When ever I compile a proj/application the SWF I 
saw didn’t reflect any of the changes I’d made.

I need to clear the cache, history, cookies in the browser.

How to over come this.
 


  ¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy.   
http://mx.mujer.yahoo.com/

RE: [flexcoders] BlazeDS - Best practice for determining if server session is invalid.

2008-12-02 Thread Seth Hodgson
Hi Fotis,

The AMFChannel (and its Secure variant) define a 'hidden' method that you could 
override to get access to the jsessionid value that is returned to the client 
at connect time for your current server session.

Here's the method signature: override public function 
AppendToGatewayUrl(value:String):void

You'd want to override in your own custom subclass of AMFChannel, invoke super, 
and then parse and store that value somewhere for use in your file upload 
handler.

The method name dates back to Flex 1, and will likely remain undocumented, but 
go ahead and log an ECR to have the value exposed as a bindable public property 
on the channel: https://bugs.adobe.com/blazeds/

Thanks,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis 
Chatzinikos
Sent: Thursday, November 27, 2008 5:11 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] BlazeDS - Best practice for determining if server 
session is invalid.

Seth, any ideas if there is a way to get the session id of the new session when 
the automatic re-login happens?

Is there an event that is dispatched when this happens?

At the moment i get the jsession id via an rpc call in order to use it in 
various places where it is needed, for example when images are uploaded to the 
server...

On Wed, Nov 26, 2008 at 3:34 AM, Fotis Chatzinikos [EMAIL PROTECTED] wrote:
Hello Seth, I had not bumped across any of this so thanks! I will have a look 
and hopefully -NOT- let you know (ie it will work :-)

Thanks again,
Fotis

On Wed, Nov 26, 2008 at 2:26 AM, Seth Hodgson [EMAIL PROTECTED] wrote:
Hi Fotis,

The client library caches credentials in order to support seamless fallback 
through channels in your ChannelSet that preserves your desired authenticated 
identity both at connect time, as well as for automatic failover across peer 
servers in a cluster at any point after you've initially connected.

However, when you use a simple AMF channel, where we don't know your session 
(connection) has timed out until a remoting call is made but fails due to an 
auth constraint check, we didn't originally handle that scenario seamlessly. 
Now we do, when you turn on the config flag I mentioned below, and it applies 
to remoting calls, producer messages sends, DMS operations, etc. (basically, 
any outbound message that fails in processing due to an auth fault when you 
were previously successfully authenticated).

In order for this to work though, you'd need to be logging in from within the 
Flex app so that it has access to your creds.
We provide server-side LoginCommand impls for supported app servers that plug 
into their various custom authentication layers and that's what Flex login 
requests are processed by, but we don't ship an official AcegiLoginCommand 
currently. I think folks in the community have implemented that though, so try 
Googling for it, or perhaps someone else who's written one will post a link?

There's more detail here: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_2.html

And here: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_security_5.html#348164

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fotis 
Chatzinikos
Sent: Tuesday, November 25, 2008 3:46 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] BlazeDS - Best practice for determining if server 
session is invalid.


Hi Seth,

the following line looks quite promising:

It should handle this case seamlessly, removing the need to re-prompt the 
user with a login dialog.

Can you elaborate a bit?

How is that possible?

In my case I use spring-acegi to login, prior to the flash component, but if 
there is another way - ie via a flash login box and automatic re-authentication 
i would love a pointer on how to do it...

Thanks,
Fotis
On Tue, Nov 25, 2008 at 11:15 PM, Seth Hodgson [EMAIL PROTECTED] wrote:
Hi,

In your services-config.xml file, within the properties for the 
channel/endpoint you app is using to issue remoting calls to the server, try 
turning on the following config option:

!-- Optional. Default is false. Setting this flag to true will cause clients
to automatically attempt to re-authenticate themselves with the server when
they send a message that fails because credentials have been reset due to server
session timeout. The failed message will be resent after re-authentication 
making the
session timeout transparent to the client with respect to authentication.
--
login-after-disconnecttrue/login-after-disconnect

This is also exposed as the 'loginAfterDisconnect' property on Channel, if 
you're building your channels and ChannelSet directly in ActionScript.

It should handle this case seamlessly, removing the need to re-prompt the user 
with a login dialog.
If you really want to reprompt the user, in your fault handler for your 
RemoteObject calls, you could watch for faults with an 

RE: [flexcoders] Using RMTPS channel

2008-12-02 Thread Seth Hodgson
Hi Ivan,

No, SecureRTMPChannel has no dependency on SecureAMFChannel. More info here: 
http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_1.html

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ivhaggi
Sent: Tuesday, December 02, 2008 1:33 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Using RMTPS channel

Hi group, i have a simple question, If i want to use the
SecureRTMPChannel its a must the SecureAMFChannel be enabled?

Thanks in advanced.
Ivan.


Re: [flexcoders] clear the cache

2008-12-02 Thread Guy Morton
Depends on the browser you're using. Clearing the cache is all you  
should have to do, but depending on whether you are sitting behind a  
web proxy even that might sometimes not be enough. In my experience,  
web proxies are a frequent source of developer frustration (especially  
MS proxies).


Sometimes putting a query string on the end of your request can help, eg

http://www.yoursite.com/myapp.swf?foo=bar

You can then randomise this which can help if you're behind a bad web  
proxy.


In addition, if you have control over the server environment, you can  
set the no-cache headers when serving your files. This should stop  
your browser holding onto them (and ought to also stop web proxies  
doing the same).


Guy

On 03/12/2008, at 10:21 AM, Adolfo Ruiz wrote:



When ever I compile a proj/application the SWF I saw didn’t reflect  
any of the changes I’d made.


I need to clear the cache, history, cookies in the browser.

How to over come this.


¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy:
http://mx.mujer.yahoo.com/






RE: [flexcoders] Param to a channel endpoint

2008-12-02 Thread Seth Hodgson
The context root is not something that the swf can automatically substitute 
into the URI value at runtime on the client based on where it was served from, 
so you need to provide it at compile.
If you're using the JEE webtier compiler that happens automatically.
If you're using MXMLC at the command line, or FlexBuilder, add a the 
-context-root={value} compiler argument, where {value} is the actual context 
root for your JEE webapp.

Best,
Seth

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
jlopes151
Sent: Sunday, November 30, 2008 3:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Param to a channel endpoint


Were the channel-definition is

channel-definition 
endpoint uri=http://{server.name}/{server.port}/
{context.root}/messagebroker/fastamfpolling 

what happens is the {context.root} get filled with the wrapped in
single quotes. I then get a Send Failed error. Were is the
context.root passed? I have gotten around this by putting the channel
on my mx:RemoteObject



[flexcoders] Re: ItemRenderer, mislabels scrolling

2008-12-02 Thread ross_w_henderson
Robert,

Try this: overwrite the set data function to sort of force refresh the
value of this.data (and super.data).

Something like this:

public override function set data(value:Object):void
{
super.data = value;

if(value == null)
{
return;
}
}


You can do a lot of cleansing in this setter, but the above addresses
the basic need of keeping this.data fresh.


Hope that winds up the problem for you.


Ross

--- In flexcoders@yahoogroups.com, Robert Byrne [EMAIL PROTECTED] wrote:

 Ross, when I saw your idea I went straight to it thinking this might
be it!  But it wasn't.  Infact, this.listData.label was the old
information.  But when entering the renderData function, it is the new
value.  This only serves to confuse me even more.  It's like the
binding never happened.
  
 I tried both of these:
  
 BindingUtils.bindProperty(this.creativeLinkButton, label, this,
[listData, label]);
 BindingUtils.bindProperty(this.creativeLinkButton, label,
this.listData, [label]);
 -
 Sorry bout the colors and font, pasted from eclipse.
  
 Also, I looked into this.data.  I set a break in my code and
mx.core.Container to see not only the value passed into the set data
function but to see when things are kicking off.  Well, the data is
not being set until after my code runs.  The correct information is
passed into the setter, but not at the right time.
  
 Perhaps I can use the data change event that is dispatched to update
my values.  Any other ideas?
  
 Thanks,
 -Robert
  
 --- On Tue, 12/2/08, ross_w_henderson [EMAIL PROTECTED] wrote:
 
 From: ross_w_henderson [EMAIL PROTECTED]
 Subject: [flexcoders] Re: ItemRenderer, mislabels  scrolling
 To: flexcoders@yahoogroups.com
 Date: Tuesday, December 2, 2008, 3:19 PM
 
 I've had similar issues.  
 
 One of the things I've found is that it is important to reduce the
 steps between this.data, or this.listData, and the property you're
 populating. 
 
 If you can rewrite so that you bind directly on this.listData.label,
 rather than set the value of 'value' and bind on 'value', I
 think
 you'll probably be okay.
 
 
 Alex - if you wrote a book on item renderers, I would buy it.  Just so
 you know there's a market.
 
 
 Ross
 
 
 
 
 --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote:
 
  itemRenderer.data should always be the data for the row.  It should
 never be the old data unless you overrode the setter.
  
  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
 On Behalf Of Robert
  Sent: Monday, December 01, 2008 3:58 PM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] ItemRenderer, mislabels  scrolling
  
  
  When scrolling, the labels on the grid turn into those that the
  recycled item renderer used. I tried using this.data to overwrite
  the values every time. The new listData object has the correct
  label and so I thought it was working, but there is a url I need in
  the current rows' XML for the button click to work and accessing the
  this.data gave me the old results. I then thought I could use the
  row index in listData but quickly found that the row index is always
  the same when scrolling down or up, the end or the begining of the
  grid. So it's not really the row index of the XML but the grid.
  Seems overwritting the values wasn't quite the answer.
  
  There is a variable in listData called item. I see it in the
  debugger but the compiler won't let me access it. This is the XML
  for the row. So, in short, how can I access this 'listData.item'
 or
  find out the actual XML row I am on. Actually, any suggestion would
  be great. Banging my head on this one all day.
  
  And thanks.
  
  Here's some code:
  
  public function get listData():BaseListData{
  return _listData;
  }
  
  public function set listData(blData:BaseListData):void{
  _listData = DataGridListData(blData);
  renderData();
  }
  
  private function renderData():void {
  var columnIndex:int;
  var xmlRow:XML;
  
  columnIndex = this.listData.columnIndex;
  xmlRow = XML(this.data);
  /*
  * I added this to get at the item.
  try{
  if(this.listData.item != null){
  xmlRow = XML(this.listData.item);
  }
  else{
  xmlRow = XML(this.data);
  }
  }
  catch(e:Error){
  xmlRow = XML(this.data);
  }
  */
  
  this.value = this.listData.label;
  if ( value == [multiple] ){
  this.creativeLinkButton.enabled = false;
  this.creativeLinkButton.useHandCursor = false;
  this.creativeLinkButton.setStyle(textDecoration,
 none);
  }
  else{
  this.creativeLinkButton.enabled = true;
  this.creativeLinkButton.useHandCursor = true;
  this.creativeLinkButton.setStyle(textDecoration,
 underline);
  }
  
  // get toolTip = @u(columnIndex)
  // get url = @u(columnIndex)
  var urlName:String = @u + columnIndex.toString();
  this.url = xmlRow[urlName];
  this.description = xmlRow[urlName];
  }
  
  override protected function setMXMLViewBindings():void{
  super.setMXMLViewBindings();
  this.logger.debug(setMXMLViewBindings);
  
  // Set creativeLink link 

[flexcoders] Unformatting currency values - best practice?

2008-12-02 Thread flexcoder2008
What is the best practice or a good recommendation for formatting
currency values and then removing the currency formatting for saving
to the database?

Here's what I have attempted to do so far.  It works - but only if the
user enters plain old numbers - if they add any currency symbol or
thousand separator, it fails.

I have a form which has some textInput's that are formatted with
currencyFormatters.  I initialize each textInput's .data property to
0.  The textInput displays formatted currency amounts from xml data
retrieved from the database.  On the focusIn event, the text property
is assigned to the textInput's .data property, so the value stays the
same but the formatting is gone. And when a change event fires, the
unformatted text in the textInput gets updated to the data property as
well.

On the FocusOut event, the currency formatting is re-applied.

When I save to the db, I use the textInput's .data property.  So for
the most part this works, but fails if the user enters any currency
symbols.

Is there a good class or function someone could recommend to take a
currency value in a textInput and strip out all the extra formatting
characters?  I am also trying to implement localization, so the
various currency symbols will be different depending on the locale.

Thanks







RE: [flexcoders] Is there any Name -Value Pair concept for Arrays?

2008-12-02 Thread Tracy Spratt
I do not understand what you are trying to do, but...

 

In your labelfunction logic, you are not using any values from the
passed in row item.  That does not make any sense.  The purpose of a
labelFunction is to use the row item properties to build a string to
display.  Look at that logic again.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of anuj sharma
Sent: Tuesday, December 02, 2008 6:02 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Is there any Name -Value Pair concept for
Arrays?

 

Hi Tracy 
Finally I would be able to retrieve labels but sorry I used
labelFunction because for some reason labelfield is breaking other
programmer's code: I have no idea why.
So Below is my code. But Now I am doing some logical error. I am getting
all the values in an array but it gives all the entries in all the whole
list. For example if there are 10 values named friendly name I need the
list to show 
Value 1
Value 2
Value 3
.
.
.
.

Value10 as 10 entries in the list but with my code it is showing
Value1,Value2Value10 10times in 10 rows with 10 entries in each row
10 times . I guess I am messing up in the logic. Can you please help me
to fix this problem.
Thanks alot for all your help
Anuj

/*CODE*/

public var arrPoolNameText:Array=new Array(); 
private function assignFriendlyName(item:Object):String
{
var devicesTextFN:XMLList =
devicesCollection.child(attributes).child(attribute);


for each (var attributesInFriendlyPool:* in
devicesTextFN) 
{
//Checks if the attribute name is pool
if([EMAIL PROTECTED] ==
'friendly-name') 
{
var poolnameText:String =
attributesInFriendlyPool.toString();
arrPoolNameText.push(poolnameText);
}
}
return arrPoolNameText.toString();
}

mx:List id=nvrsInPoolList labelFunction=assignFriendlyName
horizontalScrollPolicy=on allowMultipleSelection=true
dragMoveEnabled=true dragEnabled=true dropEnabled=true 
y=105 x=17 height=462 width=294/

On Mon, Dec 1, 2008 at 6:36 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Skip the Array entirely.

 

Use the devicesCollection directly as the dataProvider:

nvrsInPoolList.dataProvider = devicesCollection;

Then do:

mx:List id=nvrsInPoolList
labelField=[EMAIL PROTECTED] .../

 

labelField tells List what to display.

 

Then nvrsInPoolList.selectedItem will contain the entire xml node and
you can access any value from it,

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of anuj sharma
Sent: Monday, December 01, 2008 4:27 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: Re: [flexcoders] Is there any Name -Value Pair concept for
Arrays?

 

Hi Tracy 
Yes I have attached code to tell you exactly how I am doing this. I am
assigning an Array to my dataProvider and my array consists of XML
Nodes. I hope I answer all of your questions. I am putting array of XML
Nodes as dataProviders in List. I hope the code below will help you.
Please let me know how to solve the problem of displaying different
entities as labels and values in the List.
Thanks for all your help
Anuj

//MXML Code
mx:HTTPService id=devicesXML method=GET resultFormat=e4x
result=devicesXMLHandler(event) showBusyCursor=true
/mx:HTTPService

mx:List id=nvrsInPoolList allowMultipleSelection=true
dragMoveEnabled=true dragEnabled=true dropEnabled=true 
y=105 x=17 height=462 width=294/

//Action Script Code

[Bindable]
private var devicesInList:Array=new Array();
[Bindable]
private var devicesList:XMLList;
[Bindable]
private var poolsList:XMLList;
[Bindable]
private var devicesCollection:XMLListCollection; 


public function init()
{
devicesXML.url=http://121.0.30.6:8182/config/devices
http://121.0.30.6:8182/config/devices ;
devicesXML.useProxy=false;
}
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;
devicesCollection = new XMLListCollection(devicesList);

   //Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
var label:[EMAIL PROTECTED];
   
devicesInList.push(deviceName);
}
nvrsInPoolList.dataProvider = devicesInList;
}


On Mon, Dec 1, 2008 at 1:24 PM, Tracy Spratt [EMAIL 

RE: [flexcoders] clear the cache

2008-12-02 Thread Tracy Spratt
And check your browser settings.  I set mine to always check for new page 
(something like that)

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Guy 
Morton
Sent: Tuesday, December 02, 2008 6:29 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] clear the cache

 

Depends on the browser you're using. Clearing the cache is all you should have 
to do, but depending on whether you are sitting behind a web proxy even that 
might sometimes not be enough. In my experience, web proxies are a frequent 
source of developer frustration (especially MS proxies).

 

Sometimes putting a query string on the end of your request can help, eg

 

http://www.yoursite.com/myapp.swf?foo=bar 
http://www.yoursite.com/myapp.swf?foo=bar 

 

You can then randomise this which can help if you're behind a bad web proxy.

 

In addition, if you have control over the server environment, you can set the 
no-cache headers when serving your files. This should stop your browser holding 
onto them (and ought to also stop web proxies doing the same).

 

Guy

 

On 03/12/2008, at 10:21 AM, Adolfo Ruiz wrote:





 

When ever I compile a proj/application the SWF I saw didn't reflect any of the 
changes I'd made.

I need to clear the cache, history, cookies in the browser.

How to over come this.   
http://www.blogger.com/delete-comment.g?blogID=5403941postID=4967821826573734262
 

 




¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy:
http://mx.mujer.yahoo.com/

 

 

 



RE: [flexcoders] Re: ItemRenderer, mislabels scrolling

2008-12-02 Thread Tracy Spratt
I have not been following this thread from the beginning, but I would
suggest that you do not bind.  Binding is a convenience, just saving you
some coding, but is hard to debug.  If it is not working, don't use it.

 

Tracy



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ross_w_henderson
Sent: Tuesday, December 02, 2008 6:51 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ItemRenderer, mislabels  scrolling

 

Robert,

Try this: overwrite the set data function to sort of force refresh the
value of this.data (and super.data).

Something like this:

public override function set data(value:Object):void
{
super.data = value;

if(value == null)
{
return;
}
}

You can do a lot of cleansing in this setter, but the above addresses
the basic need of keeping this.data fresh.

Hope that winds up the problem for you.

Ross

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Robert Byrne [EMAIL PROTECTED] wrote:

 Ross, when I saw your idea I went straight to it thinking this might
be it!  But it wasn't.  Infact, this.listData.label was the old
information.  But when entering the renderData function, it is the new
value.  This only serves to confuse me even more.  It's like the
binding never happened.
  
 I tried both of these:
  
 BindingUtils.bindProperty(this.creativeLinkButton, label, this,
[listData, label]);
 BindingUtils.bindProperty(this.creativeLinkButton, label,
this.listData, [label]);
 -
 Sorry bout the colors and font, pasted from eclipse.
  
 Also, I looked into this.data.  I set a break in my code and
mx.core.Container to see not only the value passed into the set data
function but to see when things are kicking off.  Well, the data is
not being set until after my code runs.  The correct information is
passed into the setter, but not at the right time.
  
 Perhaps I can use the data change event that is dispatched to update
my values.  Any other ideas?
  
 Thanks,
 -Robert
  
 --- On Tue, 12/2/08, ross_w_henderson [EMAIL PROTECTED] wrote:
 
 From: ross_w_henderson [EMAIL PROTECTED]
 Subject: [flexcoders] Re: ItemRenderer, mislabels  scrolling
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Date: Tuesday, December 2, 2008, 3:19 PM
 
 I've had similar issues. 
 
 One of the things I've found is that it is important to reduce the
 steps between this.data, or this.listData, and the property you're
 populating. 
 
 If you can rewrite so that you bind directly on this.listData.label,
 rather than set the value of 'value' and bind on 'value', I
 think
 you'll probably be okay.
 
 
 Alex - if you wrote a book on item renderers, I would buy it. Just so
 you know there's a market.
 
 
 Ross
 
 
 
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote:
 
  itemRenderer.data should always be the data for the row. It should
 never be the old data unless you overrode the setter.
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
]
 On Behalf Of Robert
  Sent: Monday, December 01, 2008 3:58 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

  Subject: [flexcoders] ItemRenderer, mislabels  scrolling
  
  
  When scrolling, the labels on the grid turn into those that the
  recycled item renderer used. I tried using this.data to overwrite
  the values every time. The new listData object has the correct
  label and so I thought it was working, but there is a url I need in
  the current rows' XML for the button click to work and accessing the
  this.data gave me the old results. I then thought I could use the
  row index in listData but quickly found that the row index is always
  the same when scrolling down or up, the end or the begining of the
  grid. So it's not really the row index of the XML but the grid.
  Seems overwritting the values wasn't quite the answer.
  
  There is a variable in listData called item. I see it in the
  debugger but the compiler won't let me access it. This is the XML
  for the row. So, in short, how can I access this 'listData.item'
 or
  find out the actual XML row I am on. Actually, any suggestion would
  be great. Banging my head on this one all day.
  
  And thanks.
  
  Here's some code:
  
  public function get listData():BaseListData{
  return _listData;
  }
  
  public function set listData(blData:BaseListData):void{
  _listData = DataGridListData(blData);
  renderData();
  }
  
  private function renderData():void {
  var columnIndex:int;
  var xmlRow:XML;
  
  columnIndex = this.listData.columnIndex;
  xmlRow = XML(this.data);
  /*
  * I added this to get at the item.
  try{
  if(this.listData.item != null){
  xmlRow = XML(this.listData.item);
  }
  else{
  xmlRow = XML(this.data);
  }
  }
  catch(e:Error){
  xmlRow = XML(this.data);
  }
  */
  
  this.value = this.listData.label;
  if ( value == [multiple] ){
 

RE: [flexcoders] Unformatting currency values - best practice?

2008-12-02 Thread Tracy Spratt
You could use restrict to prevent entry of any non-numeric characters.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexcoder2008
Sent: Tuesday, December 02, 2008 6:51 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Unformatting currency values - best practice?

 

What is the best practice or a good recommendation for formatting
currency values and then removing the currency formatting for saving
to the database?

Here's what I have attempted to do so far. It works - but only if the
user enters plain old numbers - if they add any currency symbol or
thousand separator, it fails.

I have a form which has some textInput's that are formatted with
currencyFormatters. I initialize each textInput's .data property to
0. The textInput displays formatted currency amounts from xml data
retrieved from the database. On the focusIn event, the text property
is assigned to the textInput's .data property, so the value stays the
same but the formatting is gone. And when a change event fires, the
unformatted text in the textInput gets updated to the data property as
well.

On the FocusOut event, the currency formatting is re-applied.

When I save to the db, I use the textInput's .data property. So for
the most part this works, but fails if the user enters any currency
symbols.

Is there a good class or function someone could recommend to take a
currency value in a textInput and strip out all the extra formatting
characters? I am also trying to implement localization, so the
various currency symbols will be different depending on the locale.

Thanks

 



Re: [flexcoders] Unformatting currency values - best practice?

2008-12-02 Thread Josh McDonald
The cleanupNumberInput() function could be better, but it's a starting point
:)

http://pastie.textmate.org/329356

-Josh

On Wed, Dec 3, 2008 at 10:23 AM, Tracy Spratt [EMAIL PROTECTED] wrote:

  You could use restrict to prevent entry of any non-numeric characters.

 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *flexcoder2008
 *Sent:* Tuesday, December 02, 2008 6:51 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Unformatting currency values - best practice?



 What is the best practice or a good recommendation for formatting
 currency values and then removing the currency formatting for saving
 to the database?

 Here's what I have attempted to do so far. It works - but only if the
 user enters plain old numbers - if they add any currency symbol or
 thousand separator, it fails.

 I have a form which has some textInput's that are formatted with
 currencyFormatters. I initialize each textInput's .data property to
 0. The textInput displays formatted currency amounts from xml data
 retrieved from the database. On the focusIn event, the text property
 is assigned to the textInput's .data property, so the value stays the
 same but the formatting is gone. And when a change event fires, the
 unformatted text in the textInput gets updated to the data property as
 well.

 On the FocusOut event, the currency formatting is re-applied.

 When I save to the db, I use the textInput's .data property. So for
 the most part this works, but fails if the user enters any currency
 symbols.

 Is there a good class or function someone could recommend to take a
 currency value in a textInput and strip out all the extra formatting
 characters? I am also trying to implement localization, so the
 various currency symbols will be different depending on the locale.

 Thanks

 




-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk


[flexcoders] Re: Unformatting currency values - best practice?

2008-12-02 Thread Tim Hoff

Here's what I use:

var myNumericString:String = RegExUtil.strip(myInputBox.text,
RegExUtil.NON_NUMERIC_CHARACTERS);

package
{
  public class RegExUtil
  {
   public static var NON_NUMERIC_CHARACTERS : String = [^0-9]+;



   public static function strip(source:String,
pattern:String):String
   {
if (source.length  pattern.length)
   {
 var regex:RegExp = new RegExp(pattern,g);
 source = source.replace(regex,);
   }
   return source;
  }
 }
}

-TH

--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 The cleanupNumberInput() function could be better, but it's a starting
point
 :)

 http://pastie.textmate.org/329356

 -Josh

 On Wed, Dec 3, 2008 at 10:23 AM, Tracy Spratt [EMAIL PROTECTED] wrote:

  You could use restrict to prevent entry of any non-numeric
characters.
 
  Tracy
 
 
  --
 
  *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On
  Behalf Of *flexcoder2008
  *Sent:* Tuesday, December 02, 2008 6:51 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* [flexcoders] Unformatting currency values - best
practice?
 
 
 
  What is the best practice or a good recommendation for formatting
  currency values and then removing the currency formatting for saving
  to the database?
 
  Here's what I have attempted to do so far. It works - but only if
the
  user enters plain old numbers - if they add any currency symbol or
  thousand separator, it fails.
 
  I have a form which has some textInput's that are formatted with
  currencyFormatters. I initialize each textInput's .data property to
  0. The textInput displays formatted currency amounts from xml data
  retrieved from the database. On the focusIn event, the text property
  is assigned to the textInput's .data property, so the value stays
the
  same but the formatting is gone. And when a change event fires, the
  unformatted text in the textInput gets updated to the data property
as
  well.
 
  On the FocusOut event, the currency formatting is re-applied.
 
  When I save to the db, I use the textInput's .data property. So for
  the most part this works, but fails if the user enters any currency
  symbols.
 
  Is there a good class or function someone could recommend to take a
  currency value in a textInput and strip out all the extra formatting
  characters? I am also trying to implement localization, so the
  various currency symbols will be different depending on the locale.
 
  Thanks
 
 
 



 --
 Therefore, send not to know For whom the bell tolls. It tolls for
thee.

 Like the cut of my jib? Check out my Flex blog!

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 :: http://flex.joshmcdonald.info/
 :: http://twitter.com/sophistifunk





Re: [flexcoders] Load time, multiple redundant Embed() calls, etc.

2008-12-02 Thread Nate Beck
Anytime you Embed anything, you're including it within your swf.  It may get
compressed a little bit, but you're still embedding it.  That means your SWF
file will contain all of the images that you
used [Embed(source=foo.png)] on.
Using Embed is not like HTML where you have your images in a directory and
then your swf calls them at runtime.

Also, use vector graphics as much as you possibly can.

Cheers,
Nate

On Tue, Dec 2, 2008 at 12:55 PM, Eric Cooper [EMAIL PROTECTED] wrote:

   Hi,

 I have inherited some code and it seems to build into a fairly large .swf
 and takes a very long
 time to download. Running locally, things go fairly quickly - but not so
 remotely. Part of this
 may be due to slow server and net connection - but I am not able to change
 those any time
 soon.

 So, I wonder two things:

 1. Are there tools for highlighting cause of slowness of download (e.g.,
 areas of bloat in
 code)?

 2. If the code is rife with [Embed(source=foo.png)] - where same 'foo' is
 being embedded in
 multiple files - would cause bloat? And would it be better to have one
 managing singleton
 that embedded all images?

 Thanks!
 -Eric

  



Re: [flexcoders] Is there any Name -Value Pair concept for Arrays?

2008-12-02 Thread anuj sharma
Alright Tracy
Sorry for the confusion and the ambiguity, I fixed it. Actually I was
looping through it and testing the condition without checking the match but
now this function below is working. It is showing me the attributes I was
looking for now.
Thanks for your help and again.
Anuj

/*CODE*/
private function assignFriendlyName(item:Object):String
{
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = [EMAIL PROTECTED];
//Checks if the current deviceID matches the current
item, if so it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child(attributes).child(attribute);
//Checks every attribute tag for each device
for each (var attributesFriendlyName:* in
devicesText) {
//Checks if the attribute name is friendly-name
if([EMAIL PROTECTED] ==
'friendly-name') {
var friendlynameText:String =
attributesFriendlyName.toString();
return friendlynameText;
}
}
}
}
return item.toString();
}

On Tue, Dec 2, 2008 at 4:15 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

I do not understand what you are trying to do, but…



 In your labelfunction logic, you are not using any values from the passed
 in row item.  That does not make any sense.  The purpose of a
 labelFunction is to use the row item properties to build a string to
 display.  Look at that logic again.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Tuesday, December 02, 2008 6:02 PM

 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Is there any Name -Value Pair concept for
 Arrays?



 Hi Tracy
 Finally I would be able to retrieve labels but sorry I used labelFunction
 because for some reason labelfield is breaking other programmer's code: I
 have no idea why.
 So Below is my code. But Now I am doing some logical error. I am getting
 all the values in an array but it gives all the entries in all the whole
 list. For example if there are 10 values named friendly name I need the list
 to show
 Value 1
 Value 2
 Value 3
 .
 .
 .
 .

 Value10 as 10 entries in the list but with my code it is showing
 Value1,Value2Value10 10times in 10 rows with 10 entries in each row 10
 times . I guess I am messing up in the logic. Can you please help me to fix
 this problem.
 Thanks alot for all your help
 Anuj

 /*CODE*/

 public var arrPoolNameText:Array=new Array();
 private function assignFriendlyName(item:Object):String
 {
 var devicesTextFN:XMLList =
 devicesCollection.child(attributes).child(attribute);


 for each (var attributesInFriendlyPool:* in devicesTextFN)
 {
 //Checks if the attribute name is pool
 if([EMAIL PROTECTED] == 'friendly-name')
 {
 var poolnameText:String =
 attributesInFriendlyPool.toString();
 arrPoolNameText.push(poolnameText);
 }
 }
 return arrPoolNameText.toString();
 }

 mx:List id=nvrsInPoolList labelFunction=assignFriendlyName
 horizontalScrollPolicy=on allowMultipleSelection=true
 dragMoveEnabled=true dragEnabled=true dropEnabled=true
 y=105 x=17 height=462 width=294/

 On Mon, Dec 1, 2008 at 6:36 PM, Tracy Spratt [EMAIL PROTECTED]
 wrote:

 Skip the Array entirely.



 Use the devicesCollection directly as the dataProvider:

 nvrsInPoolList.dataProvider = devicesCollection;

 Then do:

 mx:List id=nvrsInPoolList
 labelField=[EMAIL PROTECTED] …/



 labelField tells List what to display.



 Then nvrsInPoolList.selectedItem will contain the *entire xml node* and
 you can access any value from it,



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *anuj sharma
 *Sent:* Monday, December 01, 2008 4:27 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] Is there any Name -Value Pair concept for
 Arrays?



 Hi Tracy
 Yes I have attached code to tell you exactly how I am doing this. I am
 assigning an Array to my dataProvider and my array consists of XML Nodes. I
 hope I answer all of your questions. I am putting array of XML Nodes as
 dataProviders in List. I hope the code below will help you. Please let me
 know how to solve the problem of displaying different entities as labels and
 values in the List.
 Thanks for 

[flexcoders] Why no initial FlexEvent.SHOW event dispatched?

2008-12-02 Thread per.olesen
I was wondering why a flex control or container does not dispatch a
FlexEvent.SHOW when showing the first time? Given this code:

mx:Panel 
  id=panel 
  show=Alert.show('I am showing') 
  creationComplete=Alert.show('I was created')/

mx:Button 
  click=panel.visible = !panel.visible 
  label=Show/Hide/

When the panel Panel is constructed, the creationComplete is fired
and I see my Alert I was created. But I DO NOT get the Alert I am
showing.

If I then click the button to hide it and click it again to show it, I
am getting the show event.

Why no show event initially?

This applies equally well to TitleWindow, Button, Box, ...



[flexcoders] Preserve state in TitleWindow - mxml bind problems

2008-12-02 Thread dfrank76
I am loading data in a popup title window and then I'd like to reuse 
that title window instance with all the loaded data an user input data 
any time the user clicks the button to pop it up.  I'm having trouble 
with bound fields...

I implemented it using an instance of a custom TitleWindow that is 
referenced from the main app, and then use addPopup/removePopup to 
show/display it.  In the example below, click the button to pop up the 
TitleWindow.  Type any text into the TextInput.  Then in the ComboBx 
either select original2 from the dropdown or click to change the 
dataProvider.  Close the popup and reopen and you will see that the 
text you entered into popup is still there, but any change made to the  
combo box has been wiped out.  

Is this a bug?  If this is how it is supposed to work, can someone 
walk me through why it works this way?  Why are the mxml binds 
refreshed when the underlying data they are bound to did not change?  
Why are the mxml binds wiping out the user entered changes?  Is there 
any way to prevent this bind refresh from happening?



Below is the simplified example:

?xml version=1.0?
!-- MyLoginForm.mxml --
mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml;

mx:Script
![CDATA[
import mx.managers.PopUpManager;

[Bindable] private var provider1:XML = XMLrecord 
label=original1/record label=original2//XML;
[Bindable] private var provider2:XML = XMLrecord 
label=new1/record label=new2//XML;

private function swapProviders():void {
combo1.dataProvider = provider2.record;
}
]]
/mx:Script

mx:Form
mx:FormItem label=Text field test
mx:TextInput id=text1 width=100%/
/mx:FormItem 
mx:FormItem label=Bound droplist
mx:ComboBox id=combo1 width=100% 
dataProvider={provider1.record} labelField=@label/
/mx:FormItem 
/mx:Form
mx:HBox 
mx:Button click=swapProviders(); label=Swap data 
providers/ 
mx:Button label=Close 
click=PopUpManager.removePopUp(this);/ 
/mx:HBox 
/mx:TitleWindow


?xml version=1.0?
!-- Main.mxml --
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

mx:Script
![CDATA[
import mx.managers.PopUpManager;
import MyLoginForm;

public var login:MyLoginForm = new MyLoginForm();

private function showLogin():void {
PopUpManager.addPopUp(login, this, true);
}
]]
/mx:Script

mx:VBox width=300 height=300  
mx:Button click=showLogin(); label=Login/
/mx:VBox
/mx:Application




[flexcoders] Displaying Yahoo Finance Data in Flex

2008-12-02 Thread Kevin

I have a Flex application that reads stock data from
download.finance.yahoo.com http://download.finance.yahoo.com/  , which
takes various parameters and returns CSV formatted text. This is the
site I used as a reference. (http://www.gummy-stuff.org/Yahoo-data.htm
http://www.gummy-stuff.org/Yahoo-data.htm ).

I have been hoping to improve upon an old classic ASP application that
relies on a data file created nightly by a service that runs on one of
our servers. I'd prefer to go right to the Yahoo source with the
Flex application.

The application runs on my desktop when accessed from the file system,
but fails with a security error when I run it from a Web server. I
suspect the issue may be a cross-domain issue, but I've read
elsewhere on the Internet that Yahoo has a cross-domain file set up for
that feed. Could I have been mislead by the Internet!?  [:)]

I've put this application – with view source enable on my
personal Website
http://www.frontlinewebdev.com/StockQuotes/StockQuoteDisplay.html  in
case anyone can look at it and advise me about getting it working. I
will appreciate any help that can be offered.

Thanks,
Kevin



Re: [flexcoders] data serialization

2008-12-02 Thread freak182

Hello,

...here is the code for UserList.as

import mx.collections.ArrayCollection;
import mx.collections.ListCollectionView;

public class UserList
{
[Bindable]
public var listusers : ArrayCollection; //list of Users

public function UserList()
{
this.listusers = new ArrayCollection();
}

}

Thanks a lot.
Cheers.


Anthony DeBonis wrote:
 
 You did not post your code for UserList.as
 
 Did you add the meta tag RemoteClass? If not Flex does not know how 
 to map the class back...
 
   [RemoteClass(alias=com.whatever.UserList) 
 
 
 
 
 --- In flexcoders@yahoogroups.com, cooleman_99 [EMAIL PROTECTED] 
 wrote:

 Hello,
 Im having problem getting the data from java to flex and im totally
 new to flex and cairngorm... here is my code snippet:
 
 im my java end:
 
  ListUsers getAll() {  // from hibernate dao then return result
 which llist of users }
 
 in AS files:
 
 public class ListDelegate extends EventDispatcher
 {
 private var userService:RemoteObject;
 private var responder:IResponder;

 public function ListDelegate(responder:IResponder)
 {
 this.userService = new 
 RemoteObject(userService);

 this.responder = responder;
 }

 public function getUserList():void
 {

 var call : Object = userService.getAll();

 call.addResponder( responder );

 }
 }
 
 
 public class ListUserCommand extends BaseCommand
 {


 override protected function callDelegate():void
 {
 var listdelegate:ListDelegate = new
 ListDelegate(this);
 listdelegate.getUserList();
 }

 override public function result( event : Object ) : 
 void
 {
 this.modelHelper.onResultUser(event);

 }

 override public function fault( event : Object ) : 
 void
 {
 var faultevt:FaultEvent = event as 
 FaultEvent;
 Alert.show(faultevt.fault.rootCause.toString
 ());
 }
 
 }
 
 public class ModelHelper
 {
 [Bindable]
 public var userlist: UserList;

 public function ModelHelper(userlist: UserList)
 {
 this.userlist = userlist;
 }

 public function getUserList():void
 {
 new ListUserEvent(this).dispatch();
 }

 public function onResultUser(event:Object):void
 {
 this.userlist.listusers = event.result as
 ArrayCollection;
 }
 
 }
 
 ..and i use DataGrid to display datas:
 
 ?xml version=1.0 encoding=utf-8?
 mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml;
 initialize=init()
 creationComplete=loadAll() 

 mx:Script
   ![CDATA[
   import com.test.flex.util.UserList;
   import mx.rpc.events.ResultEvent;
   import com.test.flex.model.ViewModelLocator;
   import com.test.flex.events.ListUserEvent;
   import com.test.flex.model.ModelHelper;
  
   [Bindable]
   private var modelLocator:ViewModelLocator =
 ViewModelLocator.getInstance();
  
   [Bindable]
   public var modelHelper:ModelHelper;
   [Bindable]
   public var users:UserList;
  
   public function init():void
   {
 this.users = new UserList();
 this.modelHelper = new ModelHelper(users);

   }
  
   public function loadAll():void
   {
   this.modelHelper.getUserList();
   }
  
  
  
   ]]
  /mx:Script
  
  !-- mx:Label text={modelLocator.test}/ --
  
  mx:DataGrid id=userlist
 dataProvider={modelHelper.userlist.listusers}
   mx:columns
   mx:DataGridColumn headerText=ID dataField=id/
   mx:DataGridColumn headerText=Username dataField=username/
   mx:DataGridColumn headerText=Password dataField=password/
   /mx:columns
  /mx:DataGrid
  

 mx:Button id=logout label=LogOut
 click={modelLocator.modelWorkflowState =
 ViewModelLocator.LOGIN_SCREEN}/
 /mx:VBox
 
 ..and the rest are straigthforward code. When I change the return
 value to String it works fine nut when put it back to List it 
 display
 nothing or error i get but when i debug it i gets the results:
 
 11:20:14,459 INFO  [STDOUT] Hibernate: select this_.ID as ID1_0_,
 

[flexcoders] Re: Why no initial FlexEvent.SHOW event dispatched?

2008-12-02 Thread Michael VanDaniker
When a UIComponent is set to visible for the first time by the
LayoutManager, the SHOW event is suppressed.  The CREATION_COMPLETE
event fired immediately after that call to setVisible, so you should
be able to achieve whatever effect you're going for by registering the
same function to listen for both the SHOW and CREATION_COMPLETE events.

--- In flexcoders@yahoogroups.com, per.olesen [EMAIL PROTECTED] wrote:

 I was wondering why a flex control or container does not dispatch a
 FlexEvent.SHOW when showing the first time? Given this code:
 
 mx:Panel 
   id=panel 
   show=Alert.show('I am showing') 
   creationComplete=Alert.show('I was created')/
 
 mx:Button 
   click=panel.visible = !panel.visible 
   label=Show/Hide/
 
 When the panel Panel is constructed, the creationComplete is fired
 and I see my Alert I was created. But I DO NOT get the Alert I am
 showing.
 
 If I then click the button to hide it and click it again to show it, I
 am getting the show event.
 
 Why no show event initially?
 
 This applies equally well to TitleWindow, Button, Box, ...





RE: [flexcoders] any overhead for calling simple getters?

2008-12-02 Thread Alex Harui
You can measure the difference.  It is essentially function call overhead.  See 
http://blogs.adobe.com/aharui/2007/10/actionscript_readwrite_perform_1.html

So, over a million fetches you'll save by using _myVar, but consider that if 
someone subclasses and overrides, _myVar may not be what you want.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh 
McDonald
Sent: Tuesday, December 02, 2008 1:49 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] any overhead for calling simple getters?


There's *some* overhead, but properties are part of the VM, so it's not going 
to be much.

Also, keep in mind, anything that's [Bindable] without [Bindable(eventName)] 
is going to have a get/set pair generated by MXMLC, even if you've already 
written a get/set pair.

Personally, I only ever use the _privateVar reference internally when there's 
some voodoo in the getter (like construction logic for first access, or 
something) I need to work around in some circumstances.

-Josh
On Wed, Dec 3, 2008 at 7:37 AM, Pan Troglodytes [EMAIL 
PROTECTED]mailto:[EMAIL PROTECTED] wrote:
If I have this:

private var _myvar:int;
public function get myvar():int
{
  return _myvar;
}

should I try to refer to it in other parts of the same class as _myvar, or is 
myvar equally efficient?  In Delphi, you can define a property like:

FMyVar: Integer;
property MyVar:Integer read FMyVar;

and all references to MyVar automatically get optimized to FMyVar.  But I'm 
wondering if Flex optimizes out the unnecessary function call represented above.

--
Jason




--
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk



  1   2   >