- Home
- Categorie
- Digital Marketing
- Grafica, Visual Design & UX
- flash e asp
-
flash e asp
Salve ragazzi, è la prima volta che scrivo in questo forum e ne approfitto subito per farvi i miei complimenti.
Avrei da chiedervi un aiutino, cerco di spiegarvi cosa sto cercando di fare, ho creato un db in access con 3 news, praticamente ho 3 campi "data" e 3 campi "news".
Nella pagina asp ho inserito questo codice per richiamare dal db il tutto:<%@LANGUAGE="VBSCRIPT"%> <%
set Recordset_News = Server.CreateObject("ADODB.Recordset")
MdbFilePath = Server.MapPath("/db/islo.mdb")
Recordset_News.ActiveConnection = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
Recordset_News.Source = "SELECT Data, News FROM News"
Recordset_News.CursorType = 0
Recordset_News.CursorLocation = 2
Recordset_News.LockType = 3
Recordset_News.Open
Recordset_News_numRows = 0
%><%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset_News_numRows = Recordset_News_numRows + Repeat1__numRows
%>
<html>
<head>
<title>MEMPHIS-RIMINI</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:link { text-decoration: none; color: #0033CC}
a:hover { text-decoration: none; color: #990000}
a:visited { text-decoration: none}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#333333" vlink="#0099CC">
<table width="620" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan="3">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b>News</b></font></div>
</td>
</tr>
<tr>
<td colspan="3">
<table border="0" cellspacing="0" cellpadding="0" width="70%" align="center">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset_News.EOF))
%>
<tr>
<td valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><%=(Recordset_News.Fields.Item("Data").Value)%></b></font></td>
</tr>
<tr>
<td valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%=(Recordset_News.Fields.Item("News").Value)%>
</font></td>
</tr>
<tr>
<td valign="top"><%
data = Recordset_News("Data")
news = Recordset_News("News")
response.write("&data="+Server.URLEncode(data))
response.write("&news="+Server.URLEncode(news))
%> </td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset_News.MoveNext()
Wend
%>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">2000
Memphis - All Rights Reserved</font></div>
</td>
</tr>
</table>
</body>
</html>
Se controllo il file asp sul server, funziona tutto, cioè mi carica tutte e tre le news.Nano
&data=52%2F21%2F2008&news=Nano
14/05/2002
Paquito
&data=14%2F05%2F2002&news=Paquito
21/10/64
ciao giancarlo
&data=21%2F10%2F64&news=ciao+giancarlo%0D%0AIl problema sta nel riuscire a caricare queste news in un testo dinamico in flash.
Nel file di flash, ho creato due testi dinamici con due variabili, una chiamata "data" e una "news".
L'action che richiama la pagina asp è questa:loadVariablesNum("http://www.islo.it/news/get_news.asp", "0", "POST")
stop();In questo modo riesco a vedere solo una news, ho provato a creare altri campi dinamici, ho usato il ciclo for, ma non cè verso non riesco a caricare tutte e tre le news.
Vi ringrazio in anticipo per il vostro aiuto.
Ciao e grazie
Alberto.
-
Ciao, ti consiglio vivamente di utilizzare la classe LoadVars e non loadVariablesNum
Dai un' occhiata quì:
http://www.giorgiotave.it/forum/flash-actionscript/39142-accesso-db-tramite-filmato-flash.html
-
Ciao Flep, grazie per il tuo aiuto.
Ho provato a guardare nel link che mi hai suggerito, ho fatto alcune prove ma non riesco a farlo funzionare.
Non è che mi potersti correggere lo script in flash?
Mi daresti veramente un grande aiuto.
Thanks