#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    china
    Posts
    2
    Rep Power
    0

    trouble in load txt after wroten by asp



    hey,someone help
    i write some asp code:writeline("c="&myvariable),then the text wrote
    c=variable,but it added a ENTER end of it,so,when i use loadvariable(mytext,0) in my flash to load the text,it did not work,
    oh,how can i do with the unwanted ENTER,let flash load my text?
    thanx
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    china
    Posts
    2
    Rep Power
    0

    this is my code,i try to change


    hey,someone help
    i write some asp code:writeline("c="&myvariable),then the text wrote
    c=variable,but it added a ENTER end of it,so,when i use loadvariable(mytext,0) in my flash to load the text,it did not work,
    oh,how can i do with the unwanted ENTER,let flash load my text?
    and i changed the code:writeline("c="&myvariable) to writeline("c="&replace(application("countnum"),vbcrlf,"")) ,but i am failing in it,it always added a ENTER at the end,why?

    this is my count.txt text:
    c=28

    this is my homepage code:
    <HTML>
    <HEAD>
    <TITLE>counter3</TITLE>
    <%
    if isempty(session("conn")) then
    application.lock
    set counterfile=server.createobject("scripting.filesystemobject")
    set temp=counterfile.opentextfile(server.mappath("count.txt"),1,true,false)
    application("countnum")=temp.readline
    application("countnum")=mid(application("countnum"),3)
    application("countnum")=application("countnum")+1
    temp.close
    %>
    </HEAD>
    <BODY bgcolor="">
    visiters£º<%=application("countnum")%>
    <%
    set temp=counterfile.createtextfile(server.mappath("count.txt"),true,false)
    temp.writeline("c="&replace(application("countnum"),vbcrlf,""))
    temp.close
    application.unlock
    else
    response.write "visiters£º"&application("countnum")
    end if
    session("conn")=true
    %>
    <OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
    WIDTH=550 HEIGHT=400 align="top">
    <PARAM NAME=movie VALUE="counter3.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=>
    <EMBED src="counter3.swf>" quality=high bgcolor= WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" align="top" width="550"></EMBED>
    </OBJECT>
    </BODY>

    </HTML>

    this is my flash code:
    loadVariablesNum ("count.txt", 0);
    num = c;
    j = num.length;
    s = Number(num.charAt(j-2));
    g = Number(num.charAt(j-1));
    with (siwei) {
    gotoAndStop(s+1);
    }
    with (gewei) {
    gotoAndStop(g+1);
    }
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    2
    Rep Power
    0

    How to Pass variable to flash


    Hi Snowy,

    You know that flash will read the response of a ASP File "On the Fly".
    This is how it works.

    Contents of "Test.asp"

    <%

    VariableContents = "Testing123"
    Response.write "&VariableName=" & VariableContents

    %>

    This will write the following to the screen

    &VariableName=Testing123


    Then all you do is within flash use the following code

    loadVariablesNum ("Test.asp", 0);

    and give it about 10 - 20 Frames to load the varibles into flash before
    you do anything with the variables

    IMPORTANT
    This must be the only text that is wrote to the screen,
    in one continues line of text with no HTML Code within it.


    If you want Flash to pass you a variable Contents and you then write it to
    a Text file this is what you do.


    Contents of "WriteTextFile.asp"

    <%

    Const fsoForAppend = 8

    Dim FileSystemObject
    Dim FileSystemObject
    Dim VariableContents
    Dim TextToWrite
    Dim TextFileName
    Dim PathOfTextFile

    TextFileName= "FlashVariables.txt"
    PathOfTextFile = Server.MapPath(TextFileName")
    VariableContents = Request("FlashVariableContents")
    TextToWrite = "&VariableName=" & VariableContents

    Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextStream = FileSystemObject.OpenTextFile(, fsoForAppend)

    objTextStream.Write TextToWrite


    objTextStream.Close
    Set objTextStream = Nothing
    Set FileSystemObject = Nothing

    %>

    This will write the following to the text file (Without the ENTER/Return at the end)

    &VariableName=Testing123


    PS : All you need to do was use write instead of writeline as Writeline automaticly
    puts a return after the line wrote.

IMN logo majestic logo threadwatch logo seochat tools logo