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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attachMovie problems

Status
Not open for further replies.

motte

Programmer
May 31, 2001
155
US
Hi all,

I'm very new to Flash, MX to be exact, and am having troubles with something. I've tried to research this, but I haven't found any examples.

What I am doing is loading up a movie clip dynamically with attachMovie. I have the movie's linkage properties set and I can do everything with the movie, such as load it, unload, change its position, and change its alpha. What I can't do is set the textfield instances inside the attached movie. I tried finding more about this initObject but haven't been successful. Can someone help?

Here is what I have, sitting on the main timeline:

Code:
on(release){
	_root.attachMovie("FrontScreen_mv","homemovie", 1);
	homemovie._x = 337;
	homemovie._y = 285;

	SiteContent1 = new LoadVars();
	SiteContent1.onLoad = onText1;
	SiteContent1.load("site_content.txt");

	function onText1() {
		homemovie.frontscreen_name.text = SiteContent1.hometitle;
		homemovie.frontscreen_content.text = SiteContent1.home_content;
	}

}

frontscreen_name and frontscreen_content are the instance names of 2 textfields inside of FrontScreen_mv. They don't show any text, even undefined. I checked the font color to make sure it doesn't match the background. All looks fine. Any and all help is appreciated. Do I need to use the initObject? If so, how?

Mike
 
the code is correct...just cant sit on the main timeline...must be attached to a button or a movieclip

is it your text file thats wrong?
 
Bill,

Thanks for your quick reply. Does the movie that I attached need to be in another movie that is on the main timeline.

How would that look in code because my movie that I've attached runs fine, except the text doesn't show up. The text file is correct. I can pull data out of it in other areas, just not here.

Would I need to do this?
_root.SomeOtherMovieInstance.attachMovie("FrontScreen_mv","homemovie", 1);

then do:
SomeOtherMovieInstance.homemovie.frontscreen_name.text = SiteContent1.hometitle;

If you could advise on that, I'd appreciate it.

Mike
 
I responded to other post, but I must confess I missed that you didn't have it on a button.

Wow JT that almost looked like you knew what you were doing!
 
Bill,

Thanks for the code. I'll have a look at it tonite or tomorrow night to compare to what pixl8r did. I appreciate all the help and time both of you have given.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top