Very critical problem

dear fellow

can any body tell me how to change the background of a movie through external text file

is it possible???

how to change the background? just the colour, or change an image or movie clip? would you like the background to be set by a parameter in the text file, or would you like the text file to container a selection of colours/images/movies that your movie takes a random value from when its loaded?

(-:

i have only one movie clip where i have called external jpeg file and the text file , now problem is that , my client wish he can change the back ground through the text file, suppose, if he mentioned red in the txt file the background of the movie should be red

okay thats not too hard to set up, first create a text file called ‘Image.txt’ in the same directory as your site and put this in it:

Image=MyBackground.jpg

now put this code in frame one of the movie (this is for Flash MX let me know if you’re working with an earlier version):


Background = new LoadVars();
Background.load("Image.txt");
Background.onLoad = SetImage;

function SetImage(Success) {
	ImageContainer.loadMovie(Background.Image);
}

finally, place an empty movie clip in the first frame of your movie and give it an instance name ‘ImageContainer’. This is where your background image will load to so you need to put it on the bottom layer of the movie

let me know if you’re having any problems getting it working
(-:

I HAVE TRIED IT BUT ITS NOT WORKING , CLEAR ME ONETHING U, I HAVE TO MENTIONED THE COLOR IN THE TEXT FILE BUT THE HEXADECIMEL VALUE I HAVE SPECIFIED IS NOT DISPLAYING, PLZ HELP

i am using flashmx

Oi! no CAPS THANKS! :-\

if you just want to set the colour of the background you need to create a movie clip that is a rectangle covering the whole of your site. Give the movie clip an instance name of ‘BG’.

Put this code in the first frame:


Background = new LoadVars();
Background.load("Image.txt");
Background.onLoad = SetImage;

function SetImage(Success) {
        Col = new Color(BG);
        Col.setRGB(Background.Colour);
}

and put this in your text file:

Colour=0xff0000

(or whatever colour)

if you’re still having problems, post the .fla and I’ll have a look at it :wink:

hi

andrew

i am forwarding the fla plz find it, and if u can fix the problem i will really thankfull to u, see probably u will not find all the external text and image file when will u running, coz it will unnessarily make the attachment heavy

thanks a lot

hai but the file is really heavy and its not allow me to upload it

can u do me a favor can u just give a fla where implement this idea

i will be thankfull to u

okay give this a go. save all the files in the zip file to the same directory on your computer

(-:

Thanks

Andrew

its a great help, i have fighting with this for continuous 6 hour, Thanks man thanks

if u have any yahoo chat id , then probably it will be more easy to communicate

manas