Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash mx, coldfusion and database 1

Status
Not open for further replies.

grafixs

Programmer
Apr 13, 2005
16
CA
I am trying to figure the best way to complete a task, that allows a Flash movie post to the database your location, and then retreiving that information when Placing an Ad or viewing an Ad, Let me give you a small discription of what I want to do. On the webpage you have a Flash design of North America, then by clicking on lets say Canada you are then presented with a canadian map, then you are capable of chosing a Province, then a City,
Now each map in flash has a script as followed,

on (release) {
FlashPath = "maps/north america/canada/ontario/";
FlashName = "ontario.swf";
CountryID = "1";
CountryName = "Canada";
ProvinceID = "4";
ProvinceName = "Ontario";
CityID = "36";
CityName = "Toronto";
getURL("index.cfm", "", "GET");
}


I would like to learn how I can send
this data out, and retreive it on demand with dropdown menue, I am using ColdFusion, so if you have chosen your City, you are capable of going outside of the flash file
and chose categories, lets say Category_1 is "Automobile", sub Category_2 is "Dealerships", sub Category_3 "Chevrolet", So now we have Data to the database from the Flash File and Also from the Coldfusion, and if I then click get Results then only the Advertisement that is in
that City and of Chevrolet will display on the screen.
Thanks
 
Let me see if I can explain what is happening, with the above script it is passing the info through the URL, and in order to grasp the URL I need in my CFM page the following code,

<CFIF IsDefined("okForAdds")>
<A name="goto1"></A>
<cfoutput>
<A href="index.cfm?results=yes&FlashPath=#URLENCODEDFORMAT(FlashPath)#&FlashName=#URLENCODEDFORMAT(FlashName)#&myCategorie_1=#URLENCODEDFORMAT(myCategorie_1)#&myCategorie_2=#URLENCODEDFORMAT(myCategorie_2)#&myCategorie_3=#URLENCODEDFORMAT(myCategorie_3)#">Get Results</A>
</cfoutput>

<CFIF IsDefined("url.results")>

<CFQUERY name="get_results" datasource="dbAds">
SELECT *
FROM Ads
WHERE FlashPath LIKE '#URLENCODEDFORMAT(FlashPath)#%'
AND Categorie_1 = '#URLENCODEDFORMAT(myCategorie_1)#'
AND Categorie_2 = '#URLENCODEDFORMAT(myCategorie_2)#'
AND Categorie_3 = '#URLENCODEDFORMAT(myCategorie_3)#'
</CFQUERY>

<CFIF get_results.RecordCount gt 0>
<CFOUTPUT query="get_results">
<CFSET Description = Left('#Full_Description#',50)>
<table cellspacing="0" cellpadding="0" border="0" width="450">
<tr>
<td>
<div class=table>
<div class=tablea>
<table cellspacing="1" cellpadding="1" border="0" width="450">
<tr>
<td width="95" rowspan="4" align="center" valign="center"><CFIF Picture_Path NEQ ""><img src="#Picture_Path#" border="0" alt="">
</CFIF></td>
<td align="left"><font class=adTitle>#Name#</font></td>
<td rowspan="3" align="center" width="100"><a href=#Web_Link# target="_blank"><img src="_pictures/remote_a.gif" width="11" height="11" alt="Visite #Name# Web Page" border="0"></a><BR><BR>
<a href="mailto:#Email#"><img src="_pictures/envelope.jpg" width="16" height="13" alt="Send an Email to #Name#" border="0"></a></td>
</tr>
<tr>
<td align="left"><font class=adText>#Address#, #City#, #Province#, #Country#</font></td>
</tr>
<tr>
<td align="left"><font class=adText><b>Phone</b>: #Phone#&nbsp;&nbsp;&nbsp;<br><b>Fax</b>: #Fax#</font></td>
</tr>
<tr>
<td align="left"><BR><font class=adText><b>Desciption:</b>&nbsp;#Description#<CFIF Len('#Full_Description#') greater THAN OR EQUAL TO 50>...<CFELSE>&nbsp;</cfif></font></td>
<td align="left" width="100" valign="bottom"><font class=highlight>»</font><a href="##" onclick="NewWindow('read_more.cfm?ID=#ID#','Add_Read_More',600,200,'no');return false;" class=menu2>&nbsp;read more&nbsp;</a><font class=highlight>«</font></td>
</tr>
</table>

I want to know if there is any otherway that I can pass the Flash info other then "URLENCODEDFORMAT" so that my flash file post directly to the database.
 
here have a look , here it is working some what but using the
FlashPath=#URLENCODEDFORMAT
That I am concerned later on for security reasons, the problem I have right now is that I am capturing in the database when I post an Add the FlashPath which becomes a very long String in the database

e.biz/index.cfm?FlashPath=maps%2Fnorth%20america%2Fcanada%2Fontario%2Ftoronto%20gta%2Fmetro%20toronto%2Ftoronto%2F&FlashName=toronto%2Eswf

But it should be picking up the variables that I have as CountryID=1 and so on because the string that I have bellow if I chose only the maps it shows the string bellow, but as soon as I click the category boxes I end up losing the CountryID=1, ProvinceID= like there is in the string bellow.

.biz/index.cfm?FlashPath=maps%2Fnorth+america%2Fcanada%2Fontario%2Ftoronto+gta%2Fmetro+toronto%2Ftoronto%2F&FlashName=toronto%2Eswf&CountryID=1&CountryName=Canada&ProvinceID=1&ProvinceName=Ontario&CityID=378&CityName=Toronto+GTA&RegionID=2&RegionName=Metro+Toronto&AreaID=11&AreaName=Toronto&NeighborhoodID=102

Is there anyway that this Long String can becomme hidden also.
 
How about using Session variables to persist the info instead of a string?

Of course the way to hide the stuff coming out of the Flash movie is to use POST instead of GET. That will probably change the way you address the string in your CF code.

I would try to give you an example but my CF is Veeeeery rusty!

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top