Adobe Dreamweaver Forums



Last 10 THreads :         Objects "Framed" when moving layer (Last Post : VegasMirage@adobeforums.com - Replies : 2 - Views : 3 )           »          Creating images to look like original oil paintings? (Last Post : Ian_Courtney@adobeforums.com - Replies : 0 - Views : 1 )           »          Opening a file in navpane from toolbar (Last Post : ChrisRousset - Replies : 0 - Views : 1 )           »          Help importing PNG sequence (Last Post : []MULISH - Replies : 0 - Views : 1 )           »          Problems importing PNG sequence (Last Post : []MULISH - Replies : 0 - Views : 1 )           »          Flash CS4 grey Icons in the Tool Panels are hard to see (Last Post : rnfw - Replies : 0 - Views : 1 )           »          Strip EXIF camera data from PSD files? (Last Post : Russell_Proulx@adobeforums.com - Replies : 2 - Views : 3 )           »          CSH Calls for Merged CHM's (Last Post : TrentSnake - Replies : 0 - Views : 1 )           »          Image Replacement (Last Post : WhatNow - Replies : 0 - Views : 1 )           »          Embedding Flash SWF Skin in External Site (Last Post : QADesign - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:38 AM
projectproofing
 
Posts: n/a
Diggs:
Default Am I remotely close?

I am attempting to do login in sequence to see if the user successfully logged
in and if so, setting a couple varibles as well as turn on and off some visual
elements. I am sure I am misusing the e.result, but in CF I would check to see
if there is a RecordCount > 0 to see if they passed the login (selected a user
record based on username and password). I don't know the equal in AS3. Help.

private function loginHandler(e:ResultEvent):void {
if (e.result) {
username = e.result.username;
role = e.result.role;
userLogin.visible = false;
mainApplication.visible = true;


if (e.result.role == 'Admin') {
usersLink.visible = true;
projectReports.visible = true;
}

}else{
Alert.show("Incorrect username and/or password. Please try again", "Login
Error");
username_txt.text="";
password_txt.text="";
}
}



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:38 AM
projectproofing
 
Posts: n/a
Diggs:
Default Re: Am I remotely close?

Better yet, how to you check to see if the variable exists or doesn't? So in
the if(e.result,getItemAt(0).username) comes up blank if the user didn't
complete the login successfully, how can I trigger off that?

The getItemAt(0) is throwing an error since if they don't succeed, it doesn't
exist..

I am getting this error:

RangeError: Index '0' specified is out of bounds.
at mx.collections::ListCollectionView/getItemAt()
at main/loginHandler()
at main/___main_Operation1_result()
at flash.events::EventDispatcher/dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.rpc::AbstractOperation/http://www.adobe.com/200 6/flex/mx/internal::dispatchRp
cEvent()
at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/ flex/mx/internal::resultHandle
r()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at NetConnectionMessageResponder/resultHandler()

Reply With Quote
  #3 (permalink)  
Old 11-03-2008, 04:38 AM
projectproofing
 
Posts: n/a
Diggs:
Default Re: Am I remotely close?

Ok, I feel stupid. Just sitting here on the couch...it dawned on me...

if (e.result.length != 0)
Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk