Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

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?
0
tariez
Asked:
tariez
  • 3
  • 3
  • 2
1 Solution
 
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
 
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now