A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Loadvariables help! Linking to ASP!

  1. #1
    Member
    Join Date
    Jan 2001
    Posts
    37
    Okay heres what I want to do,
    At the moment on my page im calling most of the text content from .txt files. Now I want to make it call from a ASP data base. Now one of the url address for it is http://portable01/idc/MenuItemsPage.asp?MENU_ITEM=4

    Apparently It says in the flash 5 help files that it can do it but it never really gave me details on how to actually achieve it (does it ever?) Can someone guide me through the exact steps on how to make it call from an asp database.

    Any help would be very much obliged

    Thnx
    David

  2. #2
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660

    try

    You only need to know that if you want your flash movie read data from ASP, you need to write in one format:
    variableName=content

    response.write("variableName=");
    response.write(content);

    Suppose your variable name in ASP is "content" and the variableName is the same as the dynamic text field.

    websam

  3. #3
    Member
    Join Date
    Jan 2001
    Posts
    37

    Elaborate

    Can you please elaborate on that or anyone else. Ie. Can someone tell me the way you call on it. At the moment its http://portable01/idc/OverViewPage.asp?MENU_ITEM=1. When it gets there it has inputtext=adsfasjdkfjakldsrandomtext now back in the movie it has a dynamic text field called inputtext. Can anyone help me on this please because it still dosen't work. I've even put the html file and the swf file in the same directory as OverViewPage.asp and the other ASP files. The exact code for calling on the asp file is
    loadVariables ("http://portable01/idc/ContentPage.asp?MENU_ITEM=4&SUB_MENU_ITEM=2", "");

    When I loaded it from txt files it did show it and the code for that was
    loadVariables ("b2b.txt", "");
    It was only b2b.txt because it was in the same directory please help me someone pleeeaaassseee.

    David

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    Alright, my first suggestion is to post this in Scripting and backend. That's where you'll find the ASP guys.
    I don't know ASP too well, but I do know CF and Perl pretty well - as well as RDMS. So here goes my generic stab at this:
    It looks to me like you have a bunch of buttons and each one sends a different variable string/combo to an ASP script which is supposed to return a text blurb based on the string/combo. If you are using a relational DB, in your ASP file you'll need to write an SQL statement that queries the DB and returns the correct blurb. Something like:
    SELECT Content
    FROM MyTable
    WHERE RecordID = URL.Menu_Item
    Now that's a very generic statement that you'll have to alter depending on your field/table/variable names and the type of DB you are using, and I can't write the DB connect statement out - I don't know ASP well enough for that. From there just do like websam says and write the "Content" variable to the page and make sure all of your variable/textfield names correspond correctly between Flash and ASP. Sorry i couldn't be more help, but it does sound like what's happening is you are not retrieving the proper data from the DB and writing it to the action page. I think that's all you really need to have happen for this to work...at least it works that way in CF, and it's very similar to ASP...

  5. #5
    Member
    Join Date
    Jan 2001
    Posts
    37

    Maybe I should rephrase this

    I think I made a mistake sorry. It's actually finding the file allright and it can open it because Im not getting an error in output. Now In the file its reading from it is written like:
    inputtext=In Idc ..... etc.

    Now back in flash the dynamic text field is told to load the address. Now since I don't get any error in output it must be able to read it. The variable in the dynamic text field is called inputtext. It worked when it called it from a txt file and it was written the exact same way. All I'm doing is changing the address. Why isn't it working? Got any views or ideas?
    David

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    Okay, then you are not actually using a relational database here, right?
    Well the way I understand this process, you'll have to output the variable to the page after you've read it. Kind of like what websam said:
    response.write("inputtext=whatever");
    response.write(inputtext);

    Try renaming the output from the text file to something other than inputtext...
    Also make sure the text box in Flash is named "inputtext"

    I really wish I could be of more assistance here, but I only have a vague idea of what you are doing and I'm not up on the rules of reading a text file through ASP then putting the values back into flash. Why don't you post the entire ASP script - I will be able to better see what you are trying to do. Also, like I suggested, if you haven't already try S&BE... there's a guy called edeveloper whop is a whiz with ASP...

    Also, did you put a trace variable in your Flash that will output the value to the screen during testing?

  7. #7
    Member
    Join Date
    Jan 2001
    Posts
    37

    How What Where?

    Whats this trace variable and how do I do it?
    Sounds good whatever it is

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    trace ("inputtext");
    just put that action in your movie and then control>>test movie and it will output the value... I'm not sure that it works in a published swf... i can't remember... post that script... i need to see what you are doing....

  9. #9
    Member
    Join Date
    Jan 2001
    Posts
    37

    Yep

    It comes up on output with inputtext
    What does this do or mean?

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    that means that the value of the variable input text is "inputtext"
    in other words inputtext="inputtext"
    ..this is pretty difficult to follow. it's really better to post examples of output and scripts (copy-n-paste) when trying to troubleshoot these problems...

  11. #11
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660

    debug

    To debug your problem, you may try this:

    produce an ASP file, whatever.asp
    In it, type nothing else except:
    <%
    response.write "inputtext=this is a test"
    %>

    then in your flash, use:
    loadVariablesNum ("whatever.asp", 0);

    If "inputtext" in your flash movie can display "this is a test". That means your ASP has got problem. Otherwise, you better cut and pasted relative codes so that we can debug it for you.

    websam

    [Edited by websam on 04-10-2001 at 02:04 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center