Wolfie7873
Technical User
I have an actionscipt enabled movie that worked just fine under CS2 and is now misbehaving under CS4. I have several ornaments on a tree that I want to control the visibility of through XML and ActionScript. Here's the AS:
...
...
And here's the XML:
...
This used to work great, but now all of the ornaments are visible even where their xml-visibility is false. What gives?
Code:
import flash.display.*;
import flash.events.*;
import flash.net.*;
var decorations:XML = new XML();
var XML_URL:String = "tree.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void
{
decorations = XML(myLoader.data);
trace("Data loaded.");
// Sets visibility based on XML data.
Star1.visible = decorations.Star1.visible;
Star2.visible = decorations.Star2.visible;
Code:
// Sets textbox from XML data for each decoration
Star1.addEventListener(MouseEvent.ROLL_OVER, function(event) {textbox.text = decorations.Star1.dedication.toString();});
Star1.addEventListener(MouseEvent.ROLL_OUT, out);
Star2.addEventListener(MouseEvent.ROLL_OVER, function(event) {textbox.text = decorations.Star2.dedication.toString();});
Star2.addEventListener(MouseEvent.ROLL_OUT, out);
Code:
}
function out(evt:MouseEvent):void {
textbox.text = "";
}
Code:
<decorations>
<Star1>
<visible>true</visible>
<dedication></dedication>
</Star1>
<Star2>
<visible>false</visible>
<dedication></dedication>
</Star2>
Code:
</decorations>
This used to work great, but now all of the ornaments are visible even where their xml-visibility is false. What gives?