Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash/ASP Timing Problems 1

Status
Not open for further replies.

VBRookie

Programmer
May 29, 2001
331
US
Ok I will try to explain my problem in detail here.

I have a web app that the user must log into to access. The login page is done in flash. I've written an object using VBCOM to interface with the Oracle DB in order to verify the user's login credentials.

The Flash page calls an ASP page which calls the object and passes the values back to the Flash login page. If the login is valid the user is redirected into the site. If not they get a box in flash that basically says 'invalid login credentials'.

The problem happens when the user enters invalid login data. The box comes up as it should. When the user clicks ok and enters their login information again (this time correctly) they get the invalid user box again. When they click ok the second time and just hit the login button again (with the correct userid and password) they are redirected into the site.

It seems that the second time around flash just shows the invalid user box without waiting to receive the new information from the ASP page. It seems to be some sort of timing issue.

Has anyone ever run into this before or have any idea how to get around it? Your help and insight would be greatly appreciated.

Many thanks,
- VB Rookie
 
Sounds like the data is loading when it's requested but isn't getting to the movie in time for Flash to act upon it first time. Have you investigated the onClipEvent(data) action?

Basically this waits for Flash to load fresh variables before acting. It's hard to know how best to advise you without seeing the code itself but, if you're using loadVariables to pick up the data from the ASP page, the link over HTTP can be pretty slow and Flash charges on ahead without actually waiting for data to load.

Slainte

 
Thanks Wangbar,

I got it figured out. It was a timing issue. I was sending a variable named iSuccessful back to flash from the ASP which indicated where or not the user was successfully validated.

I put a loop in the actionscript code in flash to loop through some frames until a value was detected in the iSuccessful flag.

I was not initializing this variable in the flash after the user dismissed the error dialog box. Therefore it retained the 0 value from the previous unsuccessful login attempt so when the user would try to log in again with the correct information Flash would just immediately display the error dialog.

After I initialized that variable in Flash -- it was forced to go through the loop until ASP populated it again with a value. It works fine now.

Many thanks.

- VB Rookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top