visibility false, XML, as3

Posted by pixelGreaser on Stack Overflow See other posts from Stack Overflow or by pixelGreaser
Published on 2010-05-13T15:36:20Z Indexed on 2010/05/13 15:44 UTC
Read the original article Hit count: 160

Filed under:
|

Hey,
I'm using external XML to set flash vars. Alpha works, but not Visibility. How do I get my swf to respond to visibility? Thanks.

XML

<?xml version="1.0" encoding="utf-8"?>
<SESSION>
<BGv TITLE="visible true">false</BGv>
<BGa TITLE="alpha 50 percent">.5</BGa>
</SESSION>

SWF

//LISTEN AND LOAD XML
var myXML:*;
var myLoad:URLLoader = new URLLoader();
myLoad.load(new URLRequest("visible.xml"));
myLoad.addEventListener(Event.COMPLETE, parseXML);
//PARSE XML
function parseXML(e:Event):void {
myXML = new XML(e.target.data);
//MY TEST
var bgA:*;
var bgV:*;
trace(myXML.BGa.text());
trace(myXML.BGv.text());
bgA =(myXML.BGa.text());
bgV =(myXML.BGv.text());
//MY OBJECT
bg.alpha = bgA;//This works great
bg.visible = bgV;//This has no effect
}

OUTPUT

.5
false

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3