|
|||
|
Hi,
I have a Flash application that contains a number of variables on the _root level of my main .swf. My application has a volume control (which a user can increase or decrease), and so one of the variables stores how "loudly" the sound should be played. Code which sets it is similar to the following: Code:
// set volume variable
FlashPlayer.setVariable("control.volume.vol", vol);
// play the submovie
pla.bindData("control.volume");
pla.updateData(true);
pla.targetPlay(pla.control.volume);
Code:
var pla = new FlashPlayer;
//bind the variables between flash and SWFkit
pla.bindData("_root.link", "_root.name");
//collects variable values from flash
pla.updateData(true);
.
.
.
// set the variables in Flash
pla._root.link = whatever;
pla.updateData(false);
It looks like pla.updateData(false); might be deleting any variable entries that are not explicitly bound to the pla object before making the call? I don't use setVariable here as there seemed to be a timing issue between setting the variable and Flash actually receiving it. Any ideas would be great. Cheers, G. |
|
|||
|
The "bindData" method won't override the bound variables. When calling the second updateData method, you get three bound variables, "control.volume", "_root.link" and "_root.name". The method will update all of them.
You can call the "unbindData" method to avoid the problem. In fact, you don't need to bind a component or movie clip. I think you can do like this Code:
pla.targetPlay("_root.control.volume");
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|