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!

Coldfusion, Flash and database 2

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.
 
try the flash form.

er... i see you double posted anyway...

try the macromedia forums if you can't find help here.

Beware of programmers who carry screwdrivers.
 
I am confused on what you are trying to do. Basically you just need a way to pass info from ColdFusion to Flash?


Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
Actually I want to reverse that and pass the information from Flash to Coldfusion, like this lets say you have a Flash image with 2 colors in it the Blue color and the red color, In the CFM file I have a Drop down list Categoy that I chose lets say BOX, Circle, ...., so if I chose on the index.cfm page from that drop down category list BOX, and then I either have chosen in the Flash Image the Color RED, Then the Server knows that I have chosen in the Flash file the Color red, and in the .cfm page that I have chosen the BOX from the drop down menu. Does that make more sence.
 
So you would have a drop down box with the categories and underneath that you would have the flash movie where you choose the color. Then you click submit the next page would say "You chose a red box." I know this isn't your final need, but just for me to understand. So essentially when you choose red a variable in the CFM page would get set to Red?



Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
If this is the case I do not think that there is any way to do that since ColdFusion is server side variables need to get set when the ColdFusion engine is processing your cfm page, and after it is loaded you can not touch them. Is there a way you can encapsulate everything you need into a Flash application?


Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
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.
 
You mean hide the String in the address bar? If so, then no, you can not hide URL variables, only form variables.


Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
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.

lets work threw this.
you click on a page and you have a big string with countryID and provinceID and such. then you click on a link for a category you want it to remain in the same country and province.

in that case you need to be sure to include the country and province in the link to the category. for example:
Code:
<a href = "cats.cfm?countryID=#url.countryID#&privinceID=#url.provinceID#&cat=rugs>rugs</a>

Beware of programmers who carry screwdrivers.
 
here let me show you exactly what I mean


Click the province and then city then area in that city then you can play with the category and sub category in order then retreive results if there are any in that area, you can also just click on a province and then select Automotive then Dearler, and 3rd Chrysler, this should show the chrysler dealers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top