Flash movieclip dynamic image PHP external file
Use movieclips instead of dynamic textboxes for displaying dynamic images on flash using PHP.
The most commonly used method to load data from external files is through dynamic textboxes. When text is concerned its fine but when we dealing with images I strongly recommend movieclips instead of dynamic textboxes (personal experience buddy!!!).
Dynamic text needs an html tag to display the image while movieclips needs only the path. So myText.htmlText=”<img src=”imag.jpg”>” will load images to text boxes while myMC.loadMovie(”http://localhost/1.jpg”) will work for the movieclip
Example:
- Take a textbox, box++ anything and convert it into a movieclip.
- Give the movieclip “instance name” sPhoto
- Add actionscript on the same frame
loadText = new LoadVars();
loadText.load("http://localhost/product.php");
loadText.onLoad = function(success) {
if(success){
sPhoto.loadMovie(loadText.photo1);
}
}; - Create php file product.php and type the following
<?
print "&photo1=http://localhost/1.jpg";
?>
You can add mysql table variables ++ to make the file real dynamic
Note: Make sure to give the exact path of the image