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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to Draw a floorplan from xmldoc using Lineto etc.

Status
Not open for further replies.

KP7769

Programmer
Sep 2, 2002
5
US
I have tried this a dozen times a dozen ways and I never get the correct result. Hoping someone can tell me what I am missing. All i need to do is draw some squares and rectangles then fill them. I am using Flash MX. Please and Thank You. SOrry to be so long.
Here is a link to what I am getting.
and this is jpg of what I want.

and here is my code and sample of my xml doc:myXml = new XML();
myXml.onLoad = flplan;
myXml.load("plots4.xml");
myXml.ignoreWhite = true;
function flplan(success) {
if (success){
// trace("Good Load") ;
for( var i=0; i<this.childNodes.length; i++){
bth1 = myXml.childNodes.attributes.boothno
fil1 = myXml.childNodes.attributes.fill
x1 = myXml.childNodes.attributes.X
y1 = myXml.childNodes.attributes.Y
wid1 = myXml.childNodes.attributes.WIDTH
hgt1 = myXml.childNodes.attributes.HEIGHT
_root.createEmptyMovieClip(bth1, bth1);
linecolor = (255 << 16);
_root.lineStyle(1, linecolor, 100);
_root.moveTo(-x1, -y1);//320,95
_root.lineTo(-wid1, hgt1);//100,-100
_root.lineTo(-wid1, -hgt1);//100,100
_root.lineTo(wid1, -hgt1);//-100,100
_root.lineTo(wid1, hgt1);//-100,-100
// _root.endFill(-12, -12);
}
}
else{
trace(myXml.status) ;
}
}
stop();
************************************
XML DOC &quot;plots4.xml&quot;
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;320&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;243&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;340&quot; y=&quot;95&quot; fill=&quot;RED&quot; boothno=&quot;242&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;360&quot; y=&quot;95&quot; fill=&quot;RED&quot; boothno=&quot;241&quot;/>
<row width=&quot;40&quot; height=&quot;20&quot; x=&quot;380&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;240&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;420&quot; y=&quot;95&quot; fill=&quot;BLUE&quot; boothno=&quot;239&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;440&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;238&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;500&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;237&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;520&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;236&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;540&quot; y=&quot;95&quot; fill=&quot;BLUE&quot; boothno=&quot;235&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;560&quot; y=&quot;95&quot; fill=&quot;WHITE&quot; boothno=&quot;234&quot;/>
<row width=&quot;40&quot; height=&quot;60&quot; x=&quot;600&quot; y=&quot;115&quot; fill=&quot;WHITE&quot; boothno=&quot;233&quot;/>
<row width=&quot;40&quot; height=&quot;60&quot; x=&quot;660&quot; y=&quot;115&quot; fill=&quot;WHITE&quot; boothno=&quot;232&quot;/>
<row width=&quot;40&quot; height=&quot;40&quot; x=&quot;280&quot; y=&quot;135&quot; fill=&quot;WHITE&quot; boothno=&quot;231&quot;/>
<row width=&quot;60&quot; height=&quot;40&quot; x=&quot;340&quot; y=&quot;135&quot; fill=&quot;WHITE&quot; boothno=&quot;230&quot;/>
<row width=&quot;20&quot; height=&quot;20&quot; x=&quot;420&quot; y=&quot;135&quot; fill=&quot;WHITE&quot; boothno=&quot;229&quot;/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top