Got this tutorial off the net. My stylesheets and HTML dont seem to be loading. Did the stylesheets tutorial off Kirupa. That worked fine. But in my code below, the only thing that worx is the <b></b> tags.
My stylesheet should be fine as well. Dont see what the problem is?!
Please help. Desperate
posting the code (ignore the AMFPHP stuff)
function getStyle() {
// load stylesheet first, then get content (separate function)
var flash_css = new TextField.StyleSheet();
var path=“sitestyles.css”;
flash_css.load(path);
flash_css.onLoad = function(success:Boolean) {
if (success) {
categoryTitle.StyleSheet = flash_css;
pageContent.StyleSheet = flash_css;
} else {
pageContent.htmlText = “Style sheet appears to be rodgered”;
}
};
};
import mx.remoting.;
import mx.rpc.;
import mx.remoting.debug.NetDebug;
import mx.utils.Delegate;
NetDebug.initialize();
// ----------------------------
// create the responder object
// In this object we will define
// all the result function for
// the data received from server
// ----------------------------
mainResponder = new Object();
// echoString receiver
mainResponder.echoString_Result = function( data_pass ){
trace(“echoString result”);
trace(“received: " + data_pass );
trace(”----");
}
// echoPageTitle receiver
mainResponder.getCategoryTitle_Result = function( data_pass ){
categoryTitle.html = true;
categoryTitle.htmlText += “<p class=‘three’><b>”;
categoryTitle.htmlText += data_pass;
categoryTitle.htmlText += “</b></p>”;
}
// echoPageContent receiver
mainResponder.getPageContent_Result = function( data_pass ){
pageContent.html = true;
pageContent.wordWrap = true;
trace(“in GetPageContent”);
//data_pass type object
// pull out data loop build string
var data_pass_string="";
data_pass_ln=data_pass.getLength();
for (var i:Number = 0; i < data_pass_ln; i++) {
// for each person node:
trace(data_pass.getItemAt(i).Item_title);
data_pass_string+="<b>" + data_pass.getItemAt(i).Item_title +"</b>" + " R" + data_pass.getItemAt(i).Item_cost + i + " <BR> ";
}
pageContent.type=“dynamic”;
pageContent.htmlText += “<p class=‘two’>”;
pageContent.htmlText += data_pass_string;
pageContent.htmlText += “</p>”;
}
// generic onStauts responder, it will be invoked
// when an error is received from the server
mainResponder.onStatus = function ( data_pass ) {
trace(“an error occurred”)
trace("in line: " + data_pass.line)
trace("error level: " + data_pass.level)
trace("description: " + data_pass.description)
}
// define the path of our gateway.php
NetServices.setDefaultGatewayUrl( ‘http://localhost/flashservices/gateway.php’ );
// initialize a variable for the connection
conn = NetServices.createGatewayConnection();
// initialize the service for our class ModxTut
// an tell which is the responder object
// for all the calls to the server
serv = conn.getService(“FontanasMenu”, mainResponder);
serv.getCategoryTitle(1);
serv.getPageContent(1);
// flash stuff again
_root.createTextField(“categoryTitle”, getNextHighestDepth(), 2, 2, 300, 40);
_root.createTextField(“pageContent”, getNextHighestDepth(), 20, 40, 300, 200);
// scrollbar
this.createClassObject(mx.controls.UIScrollBar, “my_sb”, 20);
// Set the target text field.
my_sb.setScrollTarget(pageContent);
// Size it to match the text field.
my_sb.setSize(16, pageContent._height);
// Move it next to the text field.
my_sb.move(pageContent._x + pageContent._width, pageContent._y);
getStyle();
====================================