Multimedia
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignMultimedia

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 10th, 2007, 10:46 AM
liwanensis liwanensis is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 18 liwanensis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 59 m 59 sec
Reputation Power: 0
Problem passing variables from asp to flash (load object)

Hi all,


I'm creating a website that needs to read some urls from a database into flash, and so I decideded to use asp and access 2007.

At the moment everything works when I do dummy runs:

>Asp gets the information form the database and prints out to a window
>Flash takes the urls from a text file and adds it to some buttons.


This would all be good and well if thats what I needed for my app to work, but the problem is that the movie should be reading the urls from the window which the asp file outputs.

I've used



Code:
countryInfo.load("http://127.0.0.1:8180/database_2.asp",countryInfo,"GET");


Which goes to the url in arg 1 to read the info into the load object (arg2). Arg 3 is just the type of loading ( to post variables to another place or get them from a place).

There are no errors and I tested this function using:


Code:
countryInfo.onLoad = function(success:Boolean):Void
{
    if (success) 
    {
        trace(countryInfo.toString());
                 }
    else
                {
                                //outputs if cant connect to database
                                trace("Error connecting to server.");
                 }


Which after a few debugging runs printed out success so I know it connects to the asp file.

However...the urls didnt go to my buttons so I converted the loading object into a string in flash (using countryInfo.tostring()) so that I could see what was being sent back, and I tested the flash file with a text file then the asp file to make sure.

I have different outputs for the text file (which works) to the web file (which doesnt)...

The load object from the text file looks like this:

ausUrl=null&onLoad=%5Btype%20Function%5D

and the web one looks like this:

%0D%0A%0D%0AausUrl=null%20%20%0D%0A%20%20&onLoad=%5Btype%20Function%5D


I think the problem is that the flash file cant read the variable from the web load object (underlined). This is because the flash looks for a matching variable name, separating the name from the value using '=' and separating each variable from another using '&'.

In the text load object its easy cos the variables are formatted correctly and so flash evaluates a match, but in the web load object has all of this %0D%0A%0D%0A noise which I dont know how to omit...

If I cant get rid of that then flash assumes its all part of the variable name on the left side of the '=' and that on the right ( before the '&') its the value.

So if Im looking for a match for ausUrl=null I wont get it because its like this:

%0D%0A%0D%0AausUrl=null%20%20%0D%0A%20%20

how does one get rid of the noise??


Any help much appreciated as my boss is breathing down my neck

Reply With Quote
  #2  
Old May 11th, 2007, 07:19 AM
liwanensis liwanensis is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 18 liwanensis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 59 m 59 sec
Reputation Power: 0
Hi to anyone who was reading i figured out what was wrong:



When you send a variable to flash from asp you need to use the Response.Write method.

The problem was that flash must read data from an external file in a certain format

I was getting lots of %%% because I needed to put an '&' infront of the variable that I sent from the asp file like this :

1) response.write "&variable=" & var1

but I wrote it in the asp file like this:

2) response.write "variable=" & var1


Doing this (1) gets rid of all of the %%% business because flash reads the '&' as an indicator to the next variable.

Hope that was useful for anyone having the same probs


Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignMultimedia > Flash Pro 8 and Asp probs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT