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

dynamic text boxes and global variables 1

Status
Not open for further replies.

orangejuice

Technical User
Nov 18, 2002
33
CA
Alright I am rather confused with this one. I have a main flash movie which loads a set of variables from a website Code in first fram of movie:
loadVariables(" "_root", "GET");

This works fine for my main movie - I can set up two dynamic text boxes which will display the variables just loaded (news1= whatever text and news2= whatever text again).

However, I have this main movie set up to load an external .swf into an empty movie clip when the user clicks a button.
Code:
on (press) {
unloadMovieNum(1);
loadMovie("online.swf", "/fframe");
}
This movie clip also contains 2 dynamic text boxes which I want to display the variables news1 and news2 in. However, nothing displays in these when the .swf is loaded into the main movie! Its like the .swf can't see the variables on the _root timeline.

I think there is some way to define the variables as _global, but am not sure of the syntax, etc. Any help is appreciated!!!
 
Quick fix if you want to keep using loadVariables instead of the new LoadVars() object... Use (without the "GET")...

Code:
loadVariablesNum("[URL unfurl="true"]http://mysite.com/variables.txt",[/URL] 0);

Then simply add _level0 (not in the text file itself), but to your textfield's variable name in your "online.swf"...

_level0.news1
_level0.news2




Regards,

cubalibre2.gif
 
Ok tried that - it didn't seem to work. The variables will still load in my main movie, but not in the .swf that I've loaded into a movie clip. Any other suggestions? Do I need a specific instance name on the dynamic text fields? Or will LoadVars() be better for this??
 
for sure loadvars is better

the movie clip must have an instance name (myclip,say)...i aint sure about /fframe

as part of onload function

_root.myclip.news1 = lv.news1;

the above just looks like a path problem
 
If you try what I suggested, and if it works in the online.swf on it's own, then there's no reason it shouldn't work when loaded in another main movie.
 
Ok I've a sort of problem along simlar lines

I've a swf file that loads dinamic text form a txt file
using

_root.loadVariables("notpad.txt);

the actual note pad file is
&variblename=text...text.........

and the swf works well until
I put it into a html page in DW and it then does not show the text????
any ideas this is driving me mad I can even navigate to the directory straight throught windows and the swf runs ok and shows the text but put it in a HTML page and it does not show????

andy
 
You mean in a DW's html!
Have you tried it through Flash's own outputed html?

Regards,

cubalibre2.gif
 
Yes my problem is pretty much the same. None of the answers above seem to work! My variables load in my main movie (main.swf), but don't seem to be available to a secondary movie (online.swf) embedded into a movie cip in the main. I have tried loading to the _root and different levels - nothing works.

HELP!!!!!!
 
Ok. My fla is at:
Basically the main.swf is supposed to load the variables from the text file in the first frame (this file will actually be at an online address). Then, the main.swf loads the online.swf into a blank movie clip. The online.swf should display the three variables in the dynamic text boxes but it doesnt!!!

Any help appreciated...
 
Wow! That actually worked - Thanks so much!!! A little follow up question... I'd like to put some kind of statement in the "online.swf" file, saying that if the varialbes are loaded, play frame 2, otherwise play frame 3. How should I do this?? Code below:

lv = new LoadVars()
lv.onLoad = function(){
_root.fframe.news1.htmlText = lv.news1;
_root.fframe.news2.htmlText = lv.news2;
_root.fframe.news3.htmlText = lv.news3;
}
lv.load("stop();

THanks guys - you're awesome...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top