PDA

View Full Version : Flash 7 projector and variables


sajiv
06-22-2004, 12:05 PM
Hi,

Im stumped.

I have 2 movie clips. One A.SWF and B.SWF

A.SWF is in my local PC and i need to load B.SWF which is my remote server into level 1.
No problem.

Im using LoadMovieNum("http://mydomain.com/B.SWF", 1);

But i cant access variables in A.SWF from B.SWF once it is loaded
I have set the Security.Allowdomain in A.SWF.

But when i load A.SWf using my browser at http://mydomain.com/A.SWF
then B.SWf which is loaded can read the variables from a.SWF

I have set all the variables i need as _global in A.SWF

I need A to run as a projector so any help is much appreciated

Thank You

woodsrr
06-22-2004, 02:17 PM
OK, this may be a lousy answer as I have only being doing flash a short time but here it goes.

In code if you use a LoadMovieNum command it actually executes at the end of your code.

Because it executes last any calls to the variables are ignored. (someone correct me if I’m wrong, remember reading something about this in Action Script Bible I think)

You can use the “Get” or “Post” command with LoadMovieNum to pass variables.

Post sends the values in a HTTP header so may not work with Player7

Actually you may ( and probably will) have the same problem with Get.

Maybe try ensuring that the movie is completely loaded before accessing any variables.

Good Luck

yorkeylady
06-22-2004, 03:56 PM
I use setInterval for loading, or put the loadMovie in it's own frame and code in the next frame

sajiv
06-22-2004, 07:59 PM
Hi,

Whats the format using GET. But how come my code works when i execute in a browser? It only does not work when i run the SWF directly from my PC.

Could it be a security sandbox issue?

sajiv
06-22-2004, 08:30 PM
Another observation. Once the B movie is loaded in level 1 and i tell target back to root and set the variables from the main movie to the loaded movie using _level1.movieclip.variable, it works.

But i need to get the variable from A movie once B is loaded so if i need to make changes in the fields in the B movie i can do so in B movie..

Any help is much appreciated

Tink
06-23-2004, 05:23 AM
this shouldn't be a problem

try targeting the variables you need using '_level0.'