This content has been marked as final. Show 4 replies
What is the result, an error, a broken image icon?
nothing happens no error no broken icon nothing
Image(sgbA1) - work
Image("sgbA1") not working
Image(myData,getItemAt()) - not working
This works. Is the Image actually added to the display list?
I'm sorry it seems that the first time i wasn't able to explain my problem properly i will try again
1. I have one xml data base it looks something like that
I have connected the DB and i try it by setting label.text = myData.getItemAt(0).Pre and it worked fine
2. I have few Images added to the project with id sgbA1 and sgbA2. They have a default source "blank.png"
in the script part i have a function
private function Load():void
Image().source = "white.png"
now if in the brakets i wrote sgbA1 its working
image(sgbA1).source = "white.png" //working
here comes the problem
Image( ----------------).source = "white.png"
i want the empty space from the brackets to be filled with the data from the xml table
i have tried the direct way
Image(myData.getItemAt(0).Pre).source = "white.png"; //not working
i have tried declaring a string variable and then use it
public var str:string;
str = myData.getItemAt(0).Pre;
Image(str).source = "white.png" // not working again
for the test i tried directly use string
image("sgbA1").source = "white.png" // not working again
so my question is how to set the empty field in the brackets getting it from the xml table