[flexcoders] Re: Tilelist in Flex 2 - what to use instead of getItemAt()?

2007-04-11 Thread craig.drabik
Try using an ArrayCollection for your data provider instead of a
simple array.  

--- In flexcoders@yahoogroups.com, "erinwyher" <[EMAIL PROTECTED]> wrote:
>
> Thanks for the suggestion, but it doesn't work :(. Do you need the
> latest version of Flex 2 for that to work?  I didn't install the latest
> upgrade (2.1 I believe).
> 
> When I tried it, I got the following error.
> 
> TypeError: Error #1006: value is not a function.
>  at test/clickedList()
>  at test/___Button1_click()
> 
> Also, in the debugger, IList(myTiles.dataProvider) cannot be evaluated,
> and neither can IList(myTiles.dataProvider).getItemAt(any_number)
> 
> Any more ideas? I really need help with this and I appreciate any
> suggestions! Thank you.
> 
> -Erin
> 
> --- In flexcoders@yahoogroups.com, "bhaq1972"  wrote:
> >
> > the getItemAt() function is available but not like the flex 1.5 way.
> >
> > you can do the following
> >
> > import mx.collections.IList;
> >
> > public function clickedList():void {
> > //myTiles.getItemAt(1).testFunction();
> > IList(myTiles.dataProvider).getItemAt(1).testFunction();
> > etc
> >
> >
> >
> > --- In flexcoders@yahoogroups.com, "erinwyher" erinwyher@ wrote:
> > >
> > > In Flex 1.5, you use getItemAt() to call functions from the
> > children
> > > of the TileList, but that method no longer exists in F2. Any
> > > suggestions to do this?
> > >
> > > Here is some sample code:
> > >
> > > test.mxml:
> > > 
> > >  > >  xmlns:mx="http://www.adobe.com/2006/mxml";
> > >  xmlns:view="view.*"
> > >  layout="absolute"
> > >  creationComplete="doInit()">
> > >  
> > >   
> > >  
> > > 
> > >
> > >  > itemRenderer="view.TestComponent"/>
> > >
> > > 
> > >
> > > TestComponent.mxml
> > > 
> > > http://www.adobe.com/2006/mxml"; width="40"
> > > height="30" backgroundColor="#FF3366">
> > > 
> > >  
> > > 
> > > 
> > >
> >
>




[flexcoders] Re: Scriptable data binding

2007-04-04 Thread craig.drabik
Have a look at the BindingUtils in the flex docs.  That will enable
you to programatically bind properties in actionscript.  Make sure the
properties you're binding to in your model are marked [Bindable].

As for creating buttons in actionscript, you create them like any
other object and use the container's addChild and/or addChildAt methods:



   




[flexcoders] Re: Scriptable data binding

2007-04-04 Thread craig.drabik
I should also mention you're going to want to be careful with this,
because if you're binding a lot of strings and then you change the
model they're bound to you're going to take a big lump on performance
when those strings change and every label in the application has to
have it's label property refreshed.



[flexcoders] Re: flex authenticating and sessions...

2007-04-03 Thread craig.drabik
What I do is this:

authenticate the user's ID and password.  If the credentials check
out, I generate a UUID token which I then send back to the client. 
The database table logs the token, the user ID it belongs to, and a
timestamp representing the last time the token was used. 

On subsequent calls to the server, the token is passed along as a
parameter.  Before filling a request, the server side components all
pass the token they receive to a security component which validates
the token against the database table, checks the timestamp is within a
given timeout window, and updates the last-used timestamp if
everything checks out.

Everything goes over SSL.

--- In flexcoders@yahoogroups.com, "ripe101" <[EMAIL PROTECTED]> wrote:
>
> Nick,
> 
> Thanks for the reply...
> One question, if you are using SSL, why are you also encrypting the
data through the 
> application?
> 
> I also saw mention in several presentations that Flex apps are being
used by financial 
> institutions, so this must have been tackled already in an
"enterprise" security setting.  Is it 
> a full custom activity to implement strong security for flex
applications?
> 
> Thanks
> JK
> 
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "Nick Collins"  wrote:
> >
> > The way I have been doing it, while admittedly probably not best,
is this:
> > 
> > I have all my roles and user information in my database. When the
user types
> > in their username and password, it is encrypted, sent to the CFC which
> > decrypts it, and runs a query against the database. If the
authentication is
> > successful, it ecrypts and returns the users data (name, role,
etc.) to the
> > flex frontend, which then decrypts it and displays the information
they have
> > access to. The roles table of my database has flags for different
sections
> > of the app, and it has to return a positive value to open up
access to view,
> > or to edit, that section. The encryption key for the AES encryption is
> > stored in an external XML file and is read in when the app loads.
> > Additionally, I send the data via SSL.
> > 
> > Is it hacker-proof, probably not, but what is? It at least makes
it enough
> > of a pain that I haven't had any problems.
> > 
> > On 4/2/07, ripe101  wrote:
> > >
> > >   OK, I have only found several posts asking, and many answers
that don't
> > > seem to really
> > > address the issue.
> > >
> > > How is user authentication and session management handled best
in Flex?
> > > Taking into
> > > consideration the following:
> > >
> > > * All business logic is server side and available only to an
authenticated
> > > user (and only the
> > > components they have access to).
> > > * Cannot reverse engineer the flash file to gain access to the
server
> > > side.
> > > * Each server side call must be authenticated.
> > > * Preferably the main application is not downloaded until the
user is
> > > authenticated.
> > >
> > > I saw suggestions on authenticating the user and then storing
the roles on
> > > the client, this
> > > seems very insecure, as the user could potentially write their
own app and
> > > stick roles in
> > > that client side variable.
> > >
> > > I got the few books on Flex that are out there, but none of them
really
> > > cover this critical
> > > issue. Maybe I'm missing something basic?
> > >
> > > Thanks
> > > JK
> > >
> > >  
> > >
> >
>




[flexcoders] Re: rendering checkboxes with as3 instead of mxml?

2007-03-30 Thread craig.drabik
--- In flexcoders@yahoogroups.com, "blc187" <[EMAIL PROTECTED]> wrote:
> The problem comes in when I want to add functionality on toggle.
> I can't type cbox.click = updateFld and I'm not sure what events I 
> can listen for on it.
> 
> Little help on how to handle this?
>

Create an actionscript class that extends CheckBox, put your custom
code in there, and then create instances of that class instead of
programatically setting up checkboxes.




[flexcoders] Re:

2007-03-27 Thread craig.drabik
--- In flexcoders@yahoogroups.com, "flexjeremy" <[EMAIL PROTECTED]> wrote:
>One last thing if I
> were getting a value out of the database is there a way to say that
> item is selected? 

I've written a class that allows you to data-bind a combo similar to
how you bind a text field..  You set the valueField propertie on an
instance of this component to the field in the dataProvider that
you're using as the "data" or key field, then you bind the
bindableValue property to your dataModel in both directions.  

So, saw you have a form that you're using to track customer's
addresses, and this form is backed by a  customerAddress object with
properties like "city", "state", and "zipCode".  You also have an
ArrayCollection with state names and abbreviations - states.stateName
and states.stateCode..  You would set the combo's dataProvider to
states, and it's labelField to stateName.  For the custom properties,
you set the valueField property to stateCode, and then two-way bind
the bindableValue property to customerAddress.state.

Any time the user selects a new state from the combo, the component
will update the bindableValue property with the corresponding
valueField value - data binding changes it in your model.  When the
model changes programmatically, eg from the result of a remoting call,
data binding will update bindableValue from the model..  The
propertyChange event is issued and caught by the component, and it
calls code exactly like what's been posted to locate the item with the
corresponding key.

Code:



http://www.adobe.com/2006/mxml";
change="onChange(event)" creationComplete="setup()">







[flexcoders] Re: Flex -> CFC access question

2007-03-14 Thread craig.drabik
--- In flexcoders@yahoogroups.com, "Robert Chyko" <[EMAIL PROTECTED]> wrote:
>
> My Flex app is hitting a ColdFusion backend.  If I call a function whose
> access is set to "remote", everything works as expected.  If that remote
> function calls a "private" accessible function within the same .cfc
> using the "this" keyword, it cannot find the function.  If I don't use
> the "this" keyword it works fine.


Actually, your problem is not unique to accessing a method from Flex
and it's got nothing to do with instantiation..  It's a scope issue. 
The scope names applied to the properties and methods of a cfc are
confusing.  Anything marked as public or remote will show in the
"this" scope.  Anything private is in the variables scope or the "no"
scope (no prefix).  So, if you're trying to call a private method
using this.methodName() you will get an error because the UDF isn't
defined in the public (this) scope.



[flexcoders] Re: Authentication - Kerberos

2007-03-06 Thread craig.drabik
Java has a class for dealing with Kerberos -
http://java.sun.com/j2se/1.4.2/docs/api/javax/security/auth/kerberos/package-summary.html

Have a look at that, as it should be pretty straightforward to use it
from CF.

--- In flexcoders@yahoogroups.com, "mindmillmedia" <[EMAIL PROTECTED]>
wrote:
>
> Has anyone had any experience authenticating via a Kerberos server in
> a Flex application (with a Coldfusion MX7 Enterprise Backend)?  It is
> hard for me to even find examples of Coldfusion + Kerberos.  I am on a
> machine that is Kerberized and I also have mod_auth_kerb.  
> 
> I have one inefficient way that I can use now - but the response time
> is horrendous.
> 
> Any ideas?
> 
> David
>




[flexcoders] Constrain where a popup can be dragged?

2007-02-26 Thread craig.drabik
Hello all.  Is there a way to constrain where a user can drag a popup?
 I have a sort of MDW application which has the application's controls
on the left, and the reports the user works with in popup windows on
the right.  I want to make it so the user cannot drag the reports on
top of the navigation.

Thanks!