By the way, the Flex team considers Dirk's
way to be best practice in two regards:
1. Always use the "narrowest"
type that will work. If the event is a ResultEvent, don't type it as Event, Object,
or *.
2. Don't use fully-qualified class names like
mx.rpc.events.ResultEvent (except of course in import statements), unless you
must disambiguate two imported classes that have the same short name.
- Gordon
This worked too Dirk, thanks for your support, much appreciated!!
Dirk Eismann <[EMAIL PROTECTED]>
wrote:
Make sure to type your the
event object. Try this:
public function
handleCheckEmailExists(event:ResultEvent):void
you'll also need to import the class:
import mx.rpc.events.ResultEvent
Dirk.
________________________________
Von: [email protected]
im Auftrag von Alexander Tsoukias
Gesendet: Mi 05.04.2006 22:19
An: [email protected]
Betreff: [flexcoders] Re: GENERAL actionscript
question
Yes and I still get it. here is what I have in my
code:
import
mx.managers.PopUpManager;
import
flash.net.Responder;
import
mx.rpc.remoting.RemoteObject;
import
flash.events.Event;
import
mx.events.ValidationResultEvent;
import
Members;
public function checkEmailExists():void {
srv.checkEmail({email:userEmailInput.text});
}
public function
handleCheckEmailExists(event):void{
if (event.result == 'TRUE'){
submitSignup.enabled = false;
} else {
submitSignup.enabled = true;
}
}
<mx:RemoteObject id="srv"
destination="ColdFusion"
source="CFIDE.samples.palcafe.CF.MembersDAO"
showBusyCursor="true">
<mx:method name="checkEmail"
result="handleCheckEmailExists
(event)" />
</mx:RemoteObject>
Again... this works, but that message still
appears in the problems
panel when I compile...
"parameter 'event' has no type declaration.
Weird huh?
!A
--- In [email protected],
"Jignesh Dodiya" <[EMAIL PROTECTED]>
wrote:
>
> Have u imported flash.net.Responder or
import
mx.rpc.remoting.RemoteObject.
> Not sure for CF but it generally required
when u use remoting with
AMF...
>
>
>
> On 4/6/06, Alexander Tsoukias
<[EMAIL PROTECTED]> wrote:
> >
> > Hi Kelly,
> >
> > As always u got it right.
> >
> > It works fine ;-) but I am getting this
error in the compile
panel
> > "parameter 'event' has no type
declaration"
> >
> > and its talking about this line:
> > public function
handleCheckEmailExists(event){
> >
> > I even tried it like this:
> > public function handleCheckEmailExists(event):void{
> >
> >
> > Any ideas?
> >
> > Thanks,
> > Alex
> >
> >
> >
> >
> > --- In [email protected],
"Kelly @ Dekayd Media Inc."
> >
> > <dekayd@> wrote:
> > >
> > > Unless something has changed in
Flex 2 that I am not aware of,
you
> > need to
> > > define a result handler for Remote
Object call and do the
check in
> > there.
> > >
> > > RO Calls are asynchronous.
> > >
> > > Something like:
> > >
> > > public function
checkEmailExists():void {
> > >
srv.checkEmail({email:userEmailInput.text});
> > > }
> > >
> > >
> > > public function
handleCheckEmailExists(event){
> >
> if
(event.result == 'true'){
> >
>
submitSignup.enabled = true;
> > >
} else {
> >
>
submitSignup.enabled = false;
> >
> }
> > > }
> > >
> > >
> > > And in your Remote Object tag:
> > >
> > > <mx:method
name="checkEmail" result="handleCheckEmailExists
> > (event)" />
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: [email protected]
> > [mailto:[email protected]]
On
> > > Behalf Of Alexander Tsoukias
> > > Sent: Tuesday, April 04, 2006 11:34
PM
> > > To: [email protected]
> > > Subject: [flexcoders] GENERAL
actionscript question
> > >
> > > Hi all, I know this is not
advanced, but I have a deadline for
a
> > > FLEX app tomorrow and the client
needs to see a login and
signup
> > > sample.
> > >
> > > I have a CFC which has a method
that checks if the email
inputed
> > > already exists in the database.
> > >
> > > The cfc function returns TRUE or
FALSE
> > >
> > > This is the actionscipt that I
have:
> > >
> >
> public function
checkEmailExists():void {
> >
> if
((srv.checkEmail({email:userEmailInput.text}))
==
> > > true){
> >
>
submitSignup.enabled = true;
> >
>
} else {
> >
>
submitSignup.enabled = false;
> >
> }
> > > }
> > >
> > >
> > > Is this correct? It doesn't seem to
work.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives: http://www.mail-archive.com/flexcoders%
<http://www.mail-archive.com/flexcoders%25>
> > 40yahoogroups.com
> > > Yahoo! Groups Links
> > >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> >
> >
> > ------------------------------
> > YAHOO! GROUPS LINKS
> >
> >
> > - Visit your
group "flexcoders<http://groups.yahoo.com/group/flexcoders>"
> > on the web.
> >
> > - To unsubscribe
from this group, send an email to:
> >
[EMAIL PROTECTED]<flexcoders-
[EMAIL PROTECTED]>
> >
> > - Your use of
Yahoo! Groups is subject to the Yahoo! Terms of
> > Service <http://docs.yahoo.com/info/terms/>.
> >
> >
> > ------------------------------
> >
>
>
>
> --
> Regards,
>
> Jignesh Dodiya....
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS