This content has been marked as final. Show 17 replies
the php is generating the html page that embeds the swf?
The swf is loaded in a standard .php page which calls the variable from SQL and places it in the FlashVars param... I have created two dynamic text boxes that imports the text no problems... however I want to import the name of an image that then calls the image from the server and loads it into a movie clip, or call the image directly so that I can work with it on the stage.
Basically the user of the movie selects an image and text that is placed in a database under a unique ID... this ID then calls all the relevent info out of the database and places it on the stage (including the image).
The FlashVars is the problem as I cannot get the image loaded into the movie... however I can get the source code of the php to load the image name correctly... ie <param name="FlashVars" Value="message1=Hello World&message2=Hello Catflea&image=hello.jpg" /> but cannot get 'hello.jpg' to load into the movie.
I hope I have explained this correctly and that you can understand my wafflings. Any help would be much appreciated.
show the code that embeds your swf file using the attach code option in this forum.
you have more code than that. show the relevant html code that embeds your swf including your begin and end html tags. the code you showed wouldn't embed your swf.
This code drags the info out of the database and can get the two dynamic text fields to import the variables... it is just the image that I can not import/work on the stage with.
are you verifying the $row['imagename'] returns what you expect?
When you process the page the param values return as
VALUE="message=this is the caption&from=somebody&image=theimagename.jpg" />
which 'message' and 'from' will display in their respective dynamic text boxes... the image (called here) theimagename.jpg is declared but not in the swf.
Basically I am getting stuck on the code to bring in the image and to display it on the page.
Do you think I am doing this correctly or is there any other way I can bring these variables in? Do you think I could bring these variables in through the url method better? Or would I come up with the same problems I am having now with the image not loading into the swf?
BTW - I am very grateful for your help.
there's no reason to change methods. you already have this one (almost) working. there's just something that doesn't make sense.
1. how are you verifying that
is returned by your php script?
2. how are you checking the value of image in your swf?
This is where I fall down... Although I have been using flash for over seven/eight years I have always been on the animation side of the art... coding has always been my downfall...
I have been trying to load the image through loadMovie() but to no avail as I cannot declare the var to use in the MC... your much needed experience will be valuable...
I get an error message relating to unexpected ; ' " etc...
to verify that your php script is returning the correct value
2. in your swf, use:
var tf:TextField=new TextField();
// position tf someplace where you can see it.
tf.text = root.loaderInfo.parameters.image;
Offline last night... before I say anything I would like to say thank you for the help you are offering...
and the function call could be placed after your body tag:
I inserted the code and it returned a value of...
[object Object] - within the square brackets, but no image...
The php page still returns all the variables need so no change on that... I messed with the 's', changing it to the var name and the php name of 'imagename' but to no avail...
Any further thoughts?
if the alert showed [object Object], $row['imagename'] isn't returning a string.
Thank you for the help given... we have changed direction a little and have sussed the answer that we needed.
Once again thank you.