How are you instantantiating it? I just went...
import Main;
var main:Main = new Main;
Seems to load fine... As expected I do get a problem with the
XMLParser as I dont have it...
More info?
Shaun.
On 07/05/2007, at 7:58 PM, Johan Nyberg wrote:
import mx.utils.Delegate;
import gs.dataTransfer.XMLParser;
class Main {
private var myCSS:TextField.StyleSheet;
private var cssURL:String = "main.css";
private var xml:XML;
private var xmlURL:String;
private var tournaments:Object;
private var updates:Object;
public function Main() {
tournaments = new Object();
updates = new Object();
_root.flap1_mc.activate();
loadCSS();
}
private function loadCSS():Void {
myCSS = new TextField.StyleSheet();
myCSS.load(cssURL);
myCSS.onLoad = Delegate.create(this, onLoadCSS);
}
private function onLoadCSS(success:Boolean):Void {
if (success) {
var txt:String =
'<h2>joha</h2>'+
'<h3>zona pellicia accinctis </h3>'+
'<p>haec at illi <a href="http://
www.google.com">dixerunt</a> </p>';
_root.report_txt.styleSheet = myCSS;
_root.foldOut_mc.menu_txt.styleSheet = myCSS;
_root.report_txt.htmlText = txt;
//_root.foldOut_mc.menu_txt.htmlText = txt;
XMLParser.load("tournaments.xml", Delegate.create(this,
onLoadTournamentsXML), tournaments);
XMLParser.load("updates.xml", Delegate.create(this,
onLoadUpdatesXML), updates);
}
}
private function onLoadTournamentsXML(success:Boolean,
results_obj:Object, xml:XML):Void {
if (success) {
var menu:TextField = _root.foldOut_mc.menu_txt;
menu.htmlText = '';
for(var i:Number=0; i <
tournaments.liveTournament.length; i++) {
var node:Array = tournaments.liveTournament[i];
menu.htmlText += '<h4><a
href="asfunction:_root.loadEvent,'+ node.id +'">'+ node.name
[0].value +'</a></h4>'+
'<p>'+ node.startDate[0].value
+'</p>\n\n<p></p>';
}
} else {
trace("XML Problem " + success);
}
}
public function loadEvent2(_arg:String):Void {
trace("hej");
}
private function onLoadUpdatesXML(success:Boolean,
results_obj:Object, xml:XML):Void {
if (success) {
//trace(updates.liveUpdate[1].title[0].value);
} else {
trace("XML Problem " + success);
}
}
}
--
Shaun O'Connor | +61 430 303 363 | [EMAIL PROTECTED]
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com