نمایش نتایج 1 تا 2 از 2

نام تاپیک: ارتباط بین Flash و صفحات وب

  1. #1
    کاربر دائمی
    تاریخ عضویت
    فروردین 1382
    محل زندگی
    تهرانسر_ فاز5
    پست
    317

    ارتباط بین Flash و صفحات وب

    سلام

    اقا ما طی تحقیقاتی که دوستان ما را راهنمای نمودن فهمیدیم برای Submit کردن اعطلاعات در فلش باید از این دستور استفاده کرد

    loadVariables("http://sunboy/sher/sher.asp",0,"POST");

    و ما هم این کار کردیم مثلا یه تکس باکس در فلش داریم به اسم mail و یک Buttom که داخلش این کدرو می نویسیم

    on(press){
    loadVariables("http://sunboy/sher/sher.asp",0,"POST");
    }


    و از ان طرفم درون صفحه ASP این کد رو می نویسیم



    a = request ("mail")

    response.write (a)



    ولی کار نمی کنه
    از دوستانی که در این زمینه تجربه ای داند خواهشن منو راهنمایی کنند

    در زمن من فردا دارم می رم مشهمد و همتونو دعا می کنم

  2. #2
    کاربر دائمی
    تاریخ عضویت
    بهمن 1381
    محل زندگی
    ایران - تهران
    پست
    2,342
    یک مثال کامل :

    Flash and ASP Guestbook

    Classic guest book made with ASP and Flash

    I have created this script using Flash and ASP.Data is saved in access database and retrieved through ASP and displayed in Flash movie in HTML format. PHP version of the same Guestbook is available under PHP section.

    Steps

    Start a new flash movie. Insert a new Dynamic text box and give it name txtmain and don't forget to check the HTML option. Insert a dynamic text fields status which will be used for displaying messages. Insert a new layer, name it action and place following code in action window.

    lowlimit = number(1);
    highlimit = number(10);
    loadVariablesNum ("asguest.asp", 0,"post");
    stop();

    lowlimit and highlimit are the flash variables that would be send to PHP script. First time data range from record 1 to record 10 will be displayed in HTML enabled text box.

    Insert two new button instances for up and down scrolling

    For Up Button
    on (release) {
    txtmain.scroll--;
    }

    For Down Button
    on (release) {
    txtmain.scroll++;
    }

    Above code is self-explanatory.

    I am not giving details for SCROLLING the movie. I will add a new tutorial in the flash section.

    Add two button instances for Next 10 and previous 10 records and add the following code in action window.

    Code for next Button
    on (release) {
    lowlimit = Number(lowlimit)+Number(10);
    highlimit = Number(highlimit)+Number(10);
    txtmain = "Processing Entries from "+lowlimit+" to "+highlimit+" Please wait ::: ";
    loadVariablesNum ("asguest.asp", 0,"post");
    }
    Code for Previous Button
    on (release) {
    if (txtll == "1") {
    txtmain = ":::: Nothing before Zero ::::";
    }else {
    lowlimit = Number(lowlimit) - Number(10);
    highlimit = Number(highlimit) - Number(10);
    txtmain = "Processing Entries "+lowlimit+" to "+highlimit+" Please wait for a while :::::: ";
    loadVariablesNum ("asguest.asp", 0,"post");
    }
    }
    Add three dynamic text fields to the movie for Total entries(totalentries),Low Limit (txtll) and High Limit (txthl) respectively.

    Now Insert a new movie instance. Place four dynamic text boxes for name(textname) , email (txtemail) , website (txtwebsite) and comments (txtcomments). Add two buttons for Submit and Reset.

    Code for Submit Button

    on (release) {
    if (txtname == "") {
    _root.txtmessage = "Name information missing.";
    } else if (txtemail == "") {
    _root.txtmessage = "Email missing.";
    } else if (txtcomments == "") {
    _root.txtmessage = "Comments missing.";
    } else if (txtwebsite == "") {
    _root.txtmessage = "Enter the URL to your website";
    } else {
    submit1 = "Y";
    highlimit = 10;
    lowlimit = 0;
    _root.txtmain = "wait :::: Posting New Entry ::: ";
    loadVariablesNum ("/asguest.asp", 0, "post");
    _root.txtmessage = "Comments posted";
    txtname1 = txtname;
    gotoAndStop (2);
    }
    }

    Code for reset button

    on (release) {
    txtname = "";
    txtemail = "";
    txtWebsite = "http://";
    txtcomments = "";
    }



    "GuestBook.asp"

    dim filename 'name of database file
    dim maxfld 'record counter
    dim cmtStr ' comment string
    filename=server.mappath("/") & "\" & "guestbook.mdb" // path to access database


    Set connection string for access database

    cs="Provider=Microsoft.jet.oledb.3.51;"
    cs=cs & "Persist Security info=false;"
    cs=cs & "data source="
    cs=cs & filename & ";"

    set adocon=server.createobject("adodb.connection"& #41; 'create connection object
    adocon.open cs 'open connection
    'fetch variables from flash
    txtname=request.form.item("txtname")
    txtemail=request.form.item("txtemail")
    txtwebsite=request.form.item("txtwebsite")
    txtcomments=request.form.item("txtcomments"&#4 1;

    'Create recordset and get no of records in the database.

    set rs_max_value=adocon.execute("select max(val(gid)) as x from tbguest")
    maxfld=rs_max_value.fields("x")

    'Increment the no by one.

    if isnull(maxfld) then
    maxfld=1
    else
    maxfld=maxfld+1
    end if
    rs_max_value.close ' close the recordset object.


    'If new data is submitted
    if request.form.item("submit1")="Y" then


    'create a new string in HTML format using variables
    cmtstr = "Name: <b>" & txtname & "</b><br>Email: <b><u><a href=" & "'" & "mailto:" & txtemail & "'" & ">" & txtemail & "</a></u></b><br>"
    cmtstr = cmtstr & "Website: <b><u><a href=" & "'" & txtwebsite & "'" & " target=" & "'" & "_blank" & "'" & ">" & txtwebsite & "</a></u></b><br>"
    cmtstr = cmtstr & "Comments: <b>" & txtcomments & "</b><br>"
    cmtstr = cmtstr & "<i>Posted on: " & Now() & "<br>"

    dim commandobject
    dim insertionstr

    set commandobject=server.createobject("adodb.comma nd") 'create a command object
    set commandobject.activeconnection=adocon // set active connection to the command object

    insertionstr="insert into tbguest (gid,gcomments) values (?,?)" ' sql query for insertion

    commandobject.commandtext=insertionstr
    commandobject.prepared=true
    commandobject.parameters.append commandobject.createparameter("gid",3,,1000&#4 1;
    commandobject.parameters.append commandobject.createparameter("gcomments",200, ,500)

    'Assign values to command objects
    commandobject("gid")=maxfld
    commandobject("gcomments")=cmtstr

    commandobject.execute 'execute the query
    set commandobject=nothing // destroy the command object
    end if

    dim llimit
    dim hlimit

    llimit=request.form.item("lowlimit")
    hlimit=request.form.item("highlimit")

    'Calculate total entries in Access
    dim sqlstr
    dim flashstr
    sqlstr="select max(gid) as x from tbguest"
    set rs_flash=adocon.execute(sqlstr)
    totalent=rs_flash.fields("x")
    rs_flash.close

    'Following code is for displaying entries from lowlimit to highlimit
    if totalent>0 then
    sqlstr="select * from tbguest order by gid desc"
    set rs_flash=adocon.execute(sqlstr)
    dim strflash
    rs_flash.movefirst
    if totalent>=hlimit then
    hlimit=totalent
    end if
    upto=llimit-1
    j=0
    for j=1 to upto
    rs_flash.movenext
    next
    i=0
    for i=1 to (hlimit-llimit)+1
    if rs_flash.eof then exit for
    strflash=strflash & rs_flash.fields("gcomments")
    rs_flash.movenext
    next
    strflash=strflash & "<br><br>" & " :::::::::: ::: Nothing Below This :::::::::: ::::: "
    else
    strflash=":: Nothing to Display ::"
    rs_flash.close
    end if
    response.write("&txtll=" & llimit & "&txthl=" & hlimit & "&totalentries=" & totalent & "&txtmain=")
    response.write(strflash) // variables for flash movie.
    adocon.close // destroy the connection

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •