Problem with using data variables from ASP to Flash

Hi

I am retrieving a score from my database

(approachA)
If ScoreE= 0, my movie will do A.

If scoreE !=0, my movie will do B.

Problem is my Flash is not using the score variable even though it appears correct onscreen (dynamic text reflect the score)

Approach B
To solve this, I had wrote my asp such as that score = 0, my asp will write "&successful&" else  if score != 0; asp write "&unsuccessful"

But i am wondering, other than having my asp writing this, how else can I use my score variables directly? I am looking to do it in my  approach A where the Score variable will determine action coz i had several files working that same way. It worked perfectly in another exact duplicate of this file (only difference btw the 2 swfs is the score variable is called "Score" in one, and "ScoreE" in another)

And any experts can enlighten me y is it that sometimes flash just dun seems to be using these retrieved variables from asp etc?
tariezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BillystyxCommented:
First of all it should be if(ScoreE==0)
and I think, but not sure(try it), that if you do
if(ScoreE=="0"){
instead it should work

But, you should make sure the asp script has completed successfully before trying to do anything with the variables returned.
That involves similiar to what you tried in verson b:
final response from asp should be "&successul=1&"
and then in flash, loop over it until successful=="1"

if(successful=="1"){
gotoAndPlay("yourdoingstuffframe");
}
and next frame would be gotoAndPlay("thatlastframe");

There you can try to work with all your variables, because they will be fully loaded

Billystyx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tariezAuthor Commented:
Hi there again Billystyx

sorry for the late reply. rushing the last day of my project.

will try on wat u suggest with the "0". vaguely remembered i tried it before . anyway i will try it again tmorrow when my project's over. thanks!

0
BillystyxCommented:
no worries - I will be here:)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

tariezAuthor Commented:
Hi

So wat if it returns unsuccessful from the server? One of my login file is running on the client's server now but it returns unsuccessful though the userid and password are correct. is that issue with flash or asp?

0
BillystyxCommented:
This sounds like a problem with your asp, because I assume that its the asp file that processes the result to show either successful or unsuccessful. Maybe try altering the reponse to
score and then picking that up in flash and seeing what its value is. That may help you get to the bottom of it.

Does this make sense?
Because the end result is that asp is telling you that score is not equal to 0, and I suppose it should be for you asp to have excuted correctly.
Can you also post the asp script here so we can have a look and see where the problem might be

Thanks

Billystyx
0
elhyCommented:
Not sure if this is your typo in EE or typo in your code, look:

>>If ScoreE= 0, my movie will do A.
>>If scoreE !=0, my movie will do B.

one is using ScoreE and the other is using scoreE. Flash variables is case-sensitive.
0
tariezAuthor Commented:
Hi

pardon me

please ignore my question:So wat if it returns unsuccessful from the server? One of my login file is running on the client's server now but it returns unsuccessful though the userid and password are correct. is that issue with flash or asp?

must have typed that out of exhaustion and desperation

i realised that swf that wasnt working was using a old unreliable script (it worked perfectly previously but didnt work now)
the 'unreliable script"
"if (status ne "")
      {
         if (status eq "successful")
         {
             gotoAndPlay("success");
          }else if {status eq "failed")
                 {
                   gotoAndPlay("denied");
                  }
}

I did not have a second frame that goes back to this frame again. So flash just goes straight to "denied" all the time

and i changed the script to
  if (status =="successful")
         {
             gotoAndPlay("success");
          }else if {status=="failed")
                 {
                   gotoAndPlay("denied");
                  }

and a second frame that returns to this frame.

it worked now.  one of my swf still uses the first 'unreliable script" and til now it still works perfectly. but i am wondering if the database get longer and the asp need more time to access the database, will that script not work again. that is it jumps to denied without getting a 'real response' from asp? so will the lenght of database affects?


as for using the scores directly, i havent tried score="0"; will try it once i get the time.

also, to verify too, is variable case senstive? i tot it wasnt coz one of my variables is "UserID". sometimes in my files i accidentally name it Userid it still works.cant quite remember if score and Score make a difference but i tot it didnt but i just try to for good practice.


0
elhyCommented:
to answer your question: is variable case senstive?

if I'm not wrong it is. I did a smiple test to that. I assigned a = 1 and A=2. When I did a trace(a) it returns 1 instead of 2. So it should be case-sensitive.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.