all groups > flash data integration > june 2007 >
You're in the

flash data integration

group:

Data in Flash 8 n ASP with navigation buttons!!


Data in Flash 8 n ASP with navigation buttons!! jamesw77
6/12/2007 12:00:00 AM
flash data integration:
I have built a flash movie, ASP page to declare the variables, ASP page to show
the flash movie and connected to a database. In the ASP page I have the
following code.

<!--#include file="Connections/connFlash.asp" -->
<%
Dim rsTest

Set rsTest = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM dbo.MyTable ORDER BY AreaName"

Const adLockReadOnly = 1
Const adOpenStatic = 1
Const adUseClient = 3

'Cursor Location
rsTest.CursorLocation = adUseClient

rsTest.Open sql, MM_connFlash_STRING, adOpenStatic, adLockReadOnly

rsTestTotal=rsTest.RecordCount
%>
<%
Counter = 1
While Not rsTest.EOF
%>
&areaID=<%=server.URLEncode(rsTest.Fields.Item("AreaID").Value)%>
&areaname=<%=server.URLEncode(rsTest.Fields.Item("AreaName").Value)%>
&areaintro=<%=server.URLEncode(rsTest.Fields.Item("AreaIntro").Value)%>
&counter=<%=Counter%>
&recordcount=<%=(rsTestTotal)%>
<%
Counter = Counter+1
rsTest.MoveNext
Wend
%>
<%
rsTest.Close()
Set rsTest = Nothing
%>

I have uploaded the and you can see the results
http://www.homematch.co.uk/flash/. It shows the tables unique ID, area name,
area description and also the number of rows in the recordset. All I want to
add are buttons that allow you to navigate through the recordset, can anyone
help me with this please!

Thanks,
James.

<!--#include file="Connections/connFlash.asp" -->
<%
Dim rsTest

Set rsTest = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM dbo.MyTable ORDER BY AreaName"

Const adLockReadOnly = 1
Const adOpenStatic = 1
Const adUseClient = 3

'Cursor Location
rsTest.CursorLocation = adUseClient

rsTest.Open sql, MM_connFlash_STRING, adOpenStatic, adLockReadOnly

rsTestTotal=rsTest.RecordCount
%>
<%
Counter = 1
While Not rsTest.EOF
%>
&areaID=<%=server.URLEncode(rsTest.Fields.Item("AreaID").Value)%>
&areaname=<%=server.URLEncode(rsTest.Fields.Item("AreaName").Value)%>
&areaintro=<%=server.URLEncode(rsTest.Fields.Item("AreaIntro").Value)%>
&counter=<%=Counter%>
&recordcount=<%=(rsTestTotal)%>
<%
Counter = Counter+1
rsTest.MoveNext
Wend
%>
<%
rsTest.Close()
Set rsTest = Nothing
%>
Re: Data in Flash 8 n ASP with navigation buttons!! srisumeet
6/13/2007 5:34:48 AM
Hi,

Simply echoing (writing) the variables again and again will override their
values, use a XML output and feed the data provider of a dataset and then
showcase the data on to Flash stage text variables by browsing through local
dataset. For example what you have currently in your ASP page is:

&areaID=52&areaname=xyz......&areaId=1485&areaname=abc... now in thise case
the while you retrieve data with Flash Loadvariables it will only treat areaID
and areaname as one variable not a set as in case of array, hence it will
finally fetch you the last value feeded for variable areaID i.e. 1485

try to echo something like this:
<node>
<node areaID="52" areaname="xyz" />
<node areaID="1485" areaname="abc" />
...
</node>

now you have many options to play around with this once you import this into
Flash with something like loadXML() method of XML object of Flash. You may
simply use the XML tree itslef to browse and showcase the values or feed it in
local dataset for further use.

Hope this helps.

Thanks,
Sumeet
AddThis Social Bookmark Button