PDA

View Full Version : pass variables through loadMovie


ards24
10-22-2006, 07:17 AM
I'm sure there is a simple answer, but every example of the 'loadMovie' function neglects to include an example utlising the optional [method] or [variables] field.

Problem: i am loading an external swf using
loadMovie(swfPath, targetMovie)

this is fine, but i would like to set a variable in that movie, so that when it loads, it will be able to use that variable. An example might be to type a word in a text box, which is in the parent movie, and then to pass that word to the child movie when it loads.

What options do i have?

can i use url variables?
should i use something other than loadMovie?

thanks

guiltfilter
10-23-2006, 01:31 AM
I dont think you can do what you want to do.

Do you have to load the swf externally? You could attach it via the library and have full control over it that way.

place the swf as a movie clip symbol in the library of your main fla file and set its linkage name and then use attachMovie to place it on the stage.

//

ards24
10-23-2006, 09:52 AM
How do i load my swf or fla file into the library?

Do i have to create a new symbol / movieclip and essentially recreate the movie from scratch, copying all the code over?

The files are rather complex (10 frames, 15 layers, web service connectors etc.)

anonymous
10-23-2006, 10:57 AM
You should be able to set a variable on the main timeline and then read it from any loaded movie as long as that movie is fully loaded, no problem.

ards24
10-23-2006, 11:44 AM
thanks heaps for that.

I added a variable "_global.xyz" to the timeline, and then i could access it from the new movies, loaded from an external swf, without having to put them in the library.

Many thanks anonymous & weevil.