I really need help here. I hope someone can show me where I am going wrong.
I have a SWF which I embed in a html page with flashvars (see attached txt file)
I have three .as files from which I try to take the flashVars and use to pick up an XML file and colour in symbols on the SWF file plus show some text.
None of it works after spending days trawling through sites to find solutions.
Can someone help?
Below id the complete code. I'm running CS4/AS 3.0.
public function LoadXML(e:Event):void
{
xmlData = new XML(e.target.data);
//xmlData = new XML("myxml2.xml");
var rslt:XMLDocument = new XMLDocument();
rslt.ignoreWhite = true;
rslt.parseXML(xmlData.toXMLString());
//trace(result.firstChild.childNodes.length);
for each (var val:String in staticClass.mc_Array)
{
var btn:SimpleButton = SimpleButton(this.parent.getChildByName(val));
if (btn != null)
{
var rojo:ColorTransform = new ColorTransform();
rojo.color = uint (staticClass.color_code_Array[j]);
btn.transform.colorTransform = rojo;
btn.addEventListener(MouseEvent.CLICK, onClick);
btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
/*
* Set mouse over separate colour
*/
btn.alpha = 3;
function onOver(e:MouseEvent )
{
e.currentTarget.alpha = 1.5;
for each (var val:String in staticClass.note_Array)
{
if(e.currentTarget.name == val.substring(0, val.indexOf("##", 0)))
{
e.currentTarget.parent.getChildByName("HoverText") .text = val.substring(val.indexOf("##", 0) + 2, val.length);
//e.currentTarget.parent.getChildByName("HoverText") .text = "HELP ME";
}
}
}
}
}
}
********************
staticClass.AS
********************
package com
{
import flash.display.MovieClip;
public class staticClass
{
public static var head_Array:Array = new Array();
public static var color_code_Array:Array = new Array();
public static var url_Array:Array = new Array();
public static var note_Array:Array = new Array();
public static var mc_Array:Array = new Array();
public static var url_Array1 :Array = new Array();
}
It will take me a lot of time to read your code, but you can start by changing the SWF file name from 8 - WHN Sixth Floor.swf to something shorter and without spaces. Spaces uses to produce errors. I will check your code later.
Please use [code] tags to post code.
It doesn't even look like you're using the flashvars in that code, you have "myxml2.xml" hardcoded. If you do attempt to use the flashvars, I think you need to use the root's loaderInfo, not the stage's.