?
Solved

Problem with using data variables from ASP to Flash

Posted on 2005-03-21
8
Medium Priority
?
192 Views
Last Modified: 2010-04-03
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
Comment
Question by:tariez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 18

Accepted Solution

by:
Billystyx earned 1500 total points
ID: 13590925
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
 

Author Comment

by:tariez
ID: 13602876
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
 
LVL 18

Expert Comment

by:Billystyx
ID: 13605988
no worries - I will be here:)
0
Industry Leaders: 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!

 

Author Comment

by:tariez
ID: 13609923
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
 
LVL 18

Expert Comment

by:Billystyx
ID: 13610057
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
 
LVL 5

Expert Comment

by:elhy
ID: 13617196
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
 

Author Comment

by:tariez
ID: 13617661
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
 
LVL 5

Expert Comment

by:elhy
ID: 13618196
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question