Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load a movie while keeping the same color bgrnd

Status
Not open for further replies.

martinb7

Programmer
Jan 5, 2003
235
GB
hi.

I was wondering how you load another movie (jim.swf - with a green background) into a main.swf while keeping the same color background for the loaded .swf). Ive tryed loading it the normal way by using the "loadMovie" command but the loaded movie takes the main.swf background color. Any answers??

Thanx.
 
place a rectangle on the bottom layer the color you want it to be in the movie you are loading. a loaded moie always takes the background color of the parent movie so this a workaround.
 
Thanx. that works. but that means everytime i want to load a different movie -1nce a month, i hav 2 change the bgcolor and re upload it. is there a workaround or is that the only solution?
 
make the rectangle a movie clip (give it an instance name)then you can change the color dynamically.
you could store the color in an external text file and then to change the color just edit the textfile.
 
thanx. could u give me the code on how to read it out of a txt file? call the .txt file - bgcolor.txt. Thanx

Martin
 
text file back.txt (say)

&color=0x0000ff&

flash frame 1

mydata = new loadvars();
mydata.onload = function (){
theColor = mydata.color;
clipcolor = new Color(_root.clip);//movie clip with instance name clip
clipcolor.setRGB(parseInt(_root.clip));
}
mydata.load("color.txt");

the above when run ought to lead to a blue backdround. you may have to alter the path to your rectangle clip.
 
sorry typos

mydata = new loadvars();
mydata.onload = function (){
thecolor = new Color(_root.clip);//movie clip with instance name clip
thecolor.setRGB(parseInt(mydata.color));
}
mydata.load("color.txt");


text file color.txt not back.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top