Hi,
I have an xml feed generated from our CMS. It sends lot availability to a flash map. The map has some buttons that will change color based on availability. There is also a tooltip that I would like to display 2 more fields that the xml is sending....price and model number. I am not sure how to get this to work when one rolls over each individual lot button
This is the actionscript in each of the 4 neighborhood frames:
var _xml:XML = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = myLoad;
var child = _xml;
function myLoad(ok)
{
if (ok == true) {
// for each node in the xml file
var index =0;
while (index %26lt; _xml.firstChild.childNodes.length){
//var objecttitle = _xml.childNodes[0].childNodes[index].childNodes[0].childnodes[0].nodeValue;
var objecttitle = _xml.firstChild.childNodes[index].childNodes[0].childNodes[0].nodeValue;
if (objecttitle.indexOf(''Neighborhood1'') %26gt;= 0){
var lotnumber = _xml.firstChild.childNodes[index].childNodes[1].childNodes[0].nodeValue;
var ourstatus = _xml.firstChild.childNodes[index].childNodes[2].childNodes[0].nodeValue;
var price = _xml.firstChild.childNodes[index].childNodes[3].childNodes[0].nodeValue;
var model = _xml.firstChild.childNodes[index].childNodes[4].childNodes[0].nodeValue;
var colorful = new Color(''_root.Lot'' + lotnumber);
trace(colorful);
if (ourstatus == ''Sold''){
colorful.setRGB(0xFF3366);
}else if (ourstatus == ''Pending''){
colorful.setRGB(0xFFCC33);
}else{
colorful.setRGB(0x00FF00);
}
}
index++;
}
}
}
_xml.load(''XMLFeed.aspx?ObjectType=Lot%26amp;SortPropert y=Lot Number'');
This dynamic text fields are located in a movieclip located at:
_root.tooltip.pricefield
_root.tooltip.modelfield
Each Button has an instance name, e.g. ''Lot 100''
Here is an example of (not the full) xml:
%26lt;ContentManagementObjects%26gt;
%26lt;Lot%26gt;
%26lt;Title%26gt;Neighborhood1%26lt;/Title%26gt;%26lt;LotNumber%26gt;1%26lt;/LotNumber%26gt;%26lt;Status%26gt;Pending%26lt;/Status%26gt;%26lt;Pri ce%26gt;$1,100,000%26lt;/Price%26gt;%26lt;Floorplan%26gt;Model A%26lt;/Floorplan%26gt;%26lt;/Lot%26gt;
%26lt;Lot%26gt;
%26lt;Title%26gt;Neighborhood1%26lt;/Title%26gt;%26lt;LotNumber%26gt;2%26lt;/LotNumber%26gt;%26lt;Status%26gt;Pending%26lt;/Status%26gt;%26lt;Pri ce%26gt;$1,100,500%26lt;/Price%26gt;%26lt;Floorplan%26gt;Model A%26lt;/Floorplan%26gt;%26lt;/Lot%26gt;
%26lt;Lot%26gt;
%26lt;Title%26gt;Neighborhood1%26lt;/Title%26gt;%26lt;LotNumber%26gt;3%26lt;/LotNumber%26gt;%26lt;Status%26gt;Sold%26lt;/Status%26gt;%26lt;Price%26gt; $1,100,000%26lt;/Price%26gt;%26lt;Floorplan%26gt;Model A%26lt;/Floorplan%26gt;%26lt;/Lot%26gt;
%26lt;Lot%26gt;
%26lt;Title%26gt;Neighborhood2%26lt;/Title%26gt;%26lt;LotNumber%26gt;1%26lt;/LotNumber%26gt;%26lt;Status%26gt;Sold%26lt;/Status%26gt;%26lt;Price%26gt; $1,300,000%26lt;/Price%26gt;%26lt;Floorplan%26gt;Model B%26lt;/Floorplan%26gt;%26lt;/Lot%26gt;
%26lt;Lot%26gt;
%26lt;Title%26gt;Neighborhood2%26lt;/Title%26gt;%26lt;LotNumber%26gt;2%26lt;/LotNumber%26gt;%26lt;Status%26gt;Sold%26lt;/Status%26gt;%26lt;Price%26gt; $1,550,000%26lt;/Price%26gt;%26lt;Floorplan%26gt;Model B%26lt;/Floorplan%26gt;%26lt;/Lot%26gt;
%26lt;/ContentManagementObjects%26gt;
What do I have to do to get the price and model name into the dynamic text fields in the tooltip whenever one rolls over that unique button.
Thanks in Advance.
Help with loading xml into dynamic text... var tl:MovieClip=this;
var _xml:XML = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = myLoad;
var child = _xml;
function myLoad(ok)
{
if (ok == true) {
// for each node in the xml file
var index =0;
while (index %26lt; _xml.firstChild.childNodes.length){
//var objecttitle = _xml.childNodes[0].childNodes[index].childNodes[0].childnodes[0].nodeValue;
var objecttitle = _xml.firstChild.childNodes[index].childNodes[0].childNodes[0].nodeValue;
if (objecttitle.indexOf(''Neighborhood1'') %26gt;= 0){
var ourstatus = _xml.firstChild.childNodes[index].childNodes[2].childNodes[0].nodeValue;
Help with loading xml into dynamic text...
Thank you for your reply, however I still can't get this to work. Any thoughts?
are the price and model variables being assigned correctly?
Hi,
Thank you for your help. I am attaching a stripped down version of my file so that you can see how it is set up. I'm not sure what is wrong here. Thanks.
i don't usually download and correct files unless i'm hired to do that.
How much would you charge to fix that file?
How much would you charge to fix that file?
i'm checking your file(s).?send me an email via my website:?www.kglad.com
No comments:
Post a Comment