hi everyone,
i’m working on a project for school, but i can’t continue because my code doesn’t work correct.
my problem:
i have a movieclip, an image at the same size as the movieclip (it’s like the backgroundImage of the mc) and a textfield.
i have first created a movieclip object ‘my_mc’
then i loaded an external image ‘ld_image’
i created also a TextField object ‘txtField’ with backgroundColor red
then i did:
my_mc.addChild(ld_image);
//my_mc size = ld_image size
after that i did:
my_mc.addChild(txtField);
addChild(my_mc);
but now the txtField isn’t visible but my cursor changes if i go over it with my mouse.
here is my code
var test:inDeKijker = new inDeKijker();
test.x=359;
test.y=70;
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("http://www.stubru.be/indekijker/home/"));
loader.addEventListener(Event.COMPLETE, geladen);
var xml:XML;
function geladen(evt:Event):void {
xml = new XML(evt.target.data);
var tekst:XMLList = xml.channel.item;
var fotos:XMLList = xml.channel.item.enclosure;
trace(fotos.attribute("url")[0]);
var loadImage:Loader = new Loader();
loadImage.load(new URLRequest(fotos.attribute("url")[0]));
loadImage.contentLoaderInfo.addEventListener(Event.INIT, fotoLoaded);
function fotoLoaded(evt:Event):void {
var ld:Loader = Loader(evt.target.loader);
ld.width = 330;
ld.height = 165;
test.addChild(ld);
var tekstveld:TextField = new TextField();
tekstveld.text = "TEEEESSSST";
tekstveld.backgroundColor = 0xFF0000;
tekstveld.background = true;
test.addChild(tekstveld);
addChild(test);
}
}
what can i do for it?
thx!