I want to change the color of a button on a page by reading in a database entry, and also have the button call a particular URL using it's instance name as part of the URL
my starting file is at:
I'm starting to create an interactive map for a client which I want to accomplish several things. The client has a cold fusion site which allows him to enter lot numbers for sale, the price, and whether that lot has sold or not. currently the community has 341 lots - about 30 are available.
I'm planning on making each lot a button, with an instance name consisting of the lot number itself. I have a cfm page created which gives me the following output from the database:
&LotNumber=#getinfo.lotnumber#&Price=#thecost#&TotalRecords=#count.recordcount#&soldyesno=#getinfo.soldyesno#
I have the folling code attached to each button:
on (release)
{
loadVariables (" this);
}
where "248" is replaced by the actual lot number. Can I change that dynamically based on the instance name? Also, if the "getinfo.soldyesno" returns a "Yes," I want to be able to change the color of the button to red to indicate visually that it's sold.
Can anybody help?
TIA
For reference, the following script on my main timeline:
onClipEvent(load)
{
CurrentRecord = 0;
loadVariables (" this);
}
onClipEvent(data)
{
strLotPrice = Price;
strLotNumber = LotNumber;
strPosition = "Record " add String(CurrentRecord+1) add " of " add String(TotalRecords);
}
my starting file is at:
I'm starting to create an interactive map for a client which I want to accomplish several things. The client has a cold fusion site which allows him to enter lot numbers for sale, the price, and whether that lot has sold or not. currently the community has 341 lots - about 30 are available.
I'm planning on making each lot a button, with an instance name consisting of the lot number itself. I have a cfm page created which gives me the following output from the database:
&LotNumber=#getinfo.lotnumber#&Price=#thecost#&TotalRecords=#count.recordcount#&soldyesno=#getinfo.soldyesno#
I have the folling code attached to each button:
on (release)
{
loadVariables (" this);
}
where "248" is replaced by the actual lot number. Can I change that dynamically based on the instance name? Also, if the "getinfo.soldyesno" returns a "Yes," I want to be able to change the color of the button to red to indicate visually that it's sold.
Can anybody help?
TIA
For reference, the following script on my main timeline:
onClipEvent(load)
{
CurrentRecord = 0;
loadVariables (" this);
}
onClipEvent(data)
{
strLotPrice = Price;
strLotNumber = LotNumber;
strPosition = "Record " add String(CurrentRecord+1) add " of " add String(TotalRecords);
}