Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Scrollbar And LoadVar?



i can't get the scrollbar component to react???

layer 1, frame 1:

-dynamic text box with NO text in it, with multiline and render html selected, the var: LoadText, and the instance name: MyText
-scrollbar next to the text box with"MyText" as the target text field

layer 2, frame 1:

-loadVariables action to load "LoadText.txt"

i then have the LoadText.txt with the var in the correct place.

the issue is that the scrollbar does not respond (no scrolling) - i'm clueless as to how to get this going - is there something i'm missing?

thanks in advance...



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-01-24


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Scrollbar Works With LoadVar With On Level0, Not Higher.
Well, that is part of the problem, but not all of it. I read the macromedia tech note (attached for those who are interested) about scrollbars and loading with LoadVar. I followed their directions and it works great when I test the file. Of course that is only on level0. The text loads fine when the file is launched from level0 and played on level three, but the scroll bar does not.

I wondered if part of the problem was that I used two Loadvars objects. The first LoadVars object loads text into the dynamic textbox a very small file). When the second LoadVar is loaded, the movie moves to a frame with buttons for different txt variables. I tested the hypothesis that the second LoadVars was affecting thigs by removing the second loadVar object. That changed things slightly. The up/down arrows on the scrollbar work, but the bar does not (i.e., can't drag to scroll).

Since it works fine on level0 but not on level3, it would seem to be a path issue. Where would I specify the path, do you think?

Here is the code I am using:
Frame one
stop();
fstLoadVars = new LoadVars();
fstLoadVars.load("Open.txt");

// loadMovieNum("AppWait.swf",4);
//assign a function which fires when the data is loaded:
fstLoadVars.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "Heavybox" equal to the
//contents of the variable
Heavybox.text = this.Greeting;
gotoAndPlay("SecondLoad")
} else {
trace("not loaded");
play();
}
};
Frame two-
prevFrame();
Frame three-
stop();
scndLoadVars = new LoadVars();
scndLoadVars.load("units.txt");
// loadMovieNum("AppWait.swf",4);
//assign a function which fires when the data is loaded:
scndLoadVars.onLoad = function(moresuccess) {
if (moresuccess) {
trace("done loading");
//Now that we know the Units data is loaded,
//stop preloader and show buttons (ButtonsHere)
//The dynamic test stays unchanged until buttons
//are clicked.
unloadMovieNum(4);
gotoAndPlay("ButtonsHere");
} else {
trace("not loaded");
play();
}
};
Frame four-
prevFrame();
Fame five (ButtonsHere)-
stop();


Anybody have an idea?

Loadvar
Could some one explain how 2 load variables from a text document? i just can't figure it out myself! A complete explanation of how it works would be very nice... with an example maybe

thx

frank

Loadvar
I am using loadvar to load variables from a specified text document. But i also want the User to choose which file to load from in the form of an input variable. so i have a input textbox named "specify" in which the input has to be written in a "document.txt" form. then the actionscript on my load button is.

on (release) {
loadVariables ( specify , 0);
gotoAndPlay (1);
}

the problem is, that its not workig . it id not loading any variables. Does anyone know if "loadVariables ( specify , 0); " is valid syntax, and if it isn't how can i fix it or by pass it?

thx
frank

Can I Specify One Var In LoadVar?
Please help me if u can...

I am doing this design application that can save and also load the users design (it records x and y coords of mc's dragged around stage) to/from a php script.

Q. Can I download specific strings from a php script ...ie. a user needs to recall there mc positions by putting in their email address (that is part of the string that goes to the php script)

I have 2 buttons to send and load the vars from php script.

ON MY SEND BUTTON....

on (press) {

var requesta = new LoadVars();

requesta.xcoords = _root:xcoords;
requesta.ycoords = _root:ycoords;
requesta.rotn = _root:rotn;
requesta.type = _root:type;
requesta.email = _root.submitMC:EMAILvar;
requesta.password = _root.submitMC:PASSvar;
requesta.sendAndLoad ("http://kitchendesigner.com.au/savedesign.php", _blank, "POST");
}



ON MY LOAD BUTTON......

on (press) {
requesta.email = _root.submitMC:EMAILvar;
requesta.password = _root.submitMC:PASSvar;
requesta.sendAndLoad("http://kitchendesigner.com.au/savedesign.php", requesta, "GET");
trace(requesta);
}

but when a user goes back to the application and just types in their email address (EMAILvar) and hits LOAD ...it doesnt load anything at all. I need to be able to recall the string with that email on the server!!!

Please help if u can understand wat i am rambling on about (or havent fallen asleep)

LoadVar
Any reason why this is working without failure in Flash but on the web it won't send....it just stays at "Sending..." status?

on (release, keyPress "<Enter>") {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
sending = "Sending..."
form.loadVariables("http://www.website.com/xanga.php", this, "POST");
form.onData = function(){
nextFrame();
}
}

LoadVar
on (release, keyPress "<Enter>") {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
sending = "Sending..."
form.loadVariables("http://www.website.com/xanga.php", this, "POST");
form.onData = function(){
nextFrame();
}
}

LoadVar Help
I am an idiot when it comes to loading from a text file. I have to creat a file that loads a time sheet for twelve people. The time sheet has to show the 12 different people, and then load the time of work in dynamic boxes. Please help with loading from text file, and what should my text file look like? I am placeing the dynamic boxes under each name, and loading times into each.
Any help, or guide towards help, and I will be greetly thankful.
Thanks.

Php Loadvar
Hello

I have this code in actionscript 2... I try to figured out what it would be in 3. Can someone help me? It is just a little try to get a simple variable from a php file.


var phpVar:LoadVars = new LoadVars();

phpVar.load("aller_simple.php",phpVar,"POST");

phpVar.onLoad = function() {
for (i in phpVar) {
trace(phpVar[i]);
if (typeof phpVar[i] == "string") {
temp_array = phpVar[i].split(",");
}
}
};

LoadVar()
ive got a Question

ive got this code in my movie
with a button called login
and a dynamic textbox called box1
and you can see a example of the page which prints out the info here
http://81.229.231.191/jensleker/gamb...3222.456346346

there are also two text fields called passN and userN werein you type your info
the url above is just and exampel of what the code would get if the username runner and pass 123 was entered
the movie has 2 frames .. the 1st one contains all the code. the second one is a duplicate of all the grafix . but only contains the code gotoAndPlay(1);


Code:
login.onPress = function()
{
refresh1=Math.random()*300000000;
myVars = new LoadVars();
myVars.load("getinfo.php?user1="+userN+"&pass45="+passN+"random="+refresh1,"0");
box1.text=myVars.id;
}

Question is ... why dont it work


thanks

fla file is here
http://81.229.231.191/jensleker/gamb/main2.fla

LoadVar
hey, im just wondering for the best way to read variables of a .php page into flash

the page output looks like this
array[0,0]=1&array[0,1]=3&....

i tried load(http://urlhere);
but that dident work =p

then i tried

Code:
myVars = new LoadVars();
myVars.load("http://xev.mine.nu/nyheter/news.php?search=des","0");
myVars.onLoad = function() {
test3="wee";
}
but that dident work either
the real problem is, i guess that i need it to read in the variable array[0,0]=1
just like that and not use sumthingrather=(myVars.varname)

because there will be a hell of alot of variables , and the variable ammounts will switch and i cant do a
sumthingrather=(myVars.varname)
for all of em

thanks
//VoS

LoadVar()
this script allows a button to load text in different textfield and a jpg.

it also allows the hiperlink in a text referring to an URL.

____________
var contactInfo:LoadVars = new LoadVars(); // create LoadVars instance

contactInfo.load("contact.txt"); // load external data

contactInfo.onLoad = function (success:Boolean) { // monitor data download
if (success) { // system passes status
name_txt.text = this.firstName + " " + this.lastName;
phone_txt.text = this.workPhone;
email_txt.html = true; // turn on HTML text
email_txt.htmlText = "<a href='mailto:" + this.email + "'>"
+ this.email + "</a>"; // single statement on 1 line
site_txt.html = true;
site_txt.htmlText = "<u>" + "<a href='" + this.websiteURL + "'>"
+ this.websiteURL + "</a>" + "</u>";
empty_mc.loadMovie(this.imageURL); // load JPEG
} else {
trace("Failure");
}
}

__________________

my question is: how should I change it to call the url in a _blank window?

thank U by now!

LoadVar()
ive got a Question

ive got this code in my movie
with a button called login
and a dynamic textbox called box1
and you can see a example of the page which prints out the info here
http://81.229.231.191/jensleker/gamb...3222.456346346

there are also two text fields called passN and userN werein you type your info
the url above is just and exampel of what the code would get if the username runner and pass 123 was entered
the movie has 2 frames .. the 1st one contains all the code. the second one is a duplicate of all the grafix . but only contains the code gotoAndPlay(1);


Code:
login.onPress = function()
{
refresh1=Math.random()*300000000;
myVars = new LoadVars();
myVars.load("getinfo.php?user1="+userN+"&pass45="+passN+"random="+refresh1,"0");
box1.text=myVars.id;
}

Question is ... why dont it work


thanks

fla file is here
http://81.229.231.191/jensleker/gamb/main2.fla

LoadVar
hey, im just wondering for the best way to read variables of a .php page into flash

the page output looks like this
array[0,0]=1&array[0,1]=3&....

i tried load(http://urlhere);
but that dident work =p

then i tried

Code:
myVars = new LoadVars();
myVars.load("http://xev.mine.nu/nyheter/news.php?search=des","0");
myVars.onLoad = function() {
test3="wee";
}
but that dident work either
the real problem is, i guess that i need it to read in the variable array[0,0]=1
just like that and not use sumthingrather=(myVars.varname)

because there will be a hell of alot of variables , and the variable ammounts will switch and i cant do a
sumthingrather=(myVars.varname)
for all of em

thanks
//VoS

LoadVar()
this script allows a button to load text in different textfield and a jpg.

it also allows the hiperlink in a text referring to an URL.

____________
var contactInfo:LoadVars = new LoadVars(); // create LoadVars instance

contactInfo.load("contact.txt"); // load external data

contactInfo.onLoad = function (success:Boolean) { // monitor data download
if (success) { // system passes status
name_txt.text = this.firstName + " " + this.lastName;
phone_txt.text = this.workPhone;
email_txt.html = true; // turn on HTML text
email_txt.htmlText = "<a href='mailto:" + this.email + "'>"
+ this.email + "</a>"; // single statement on 1 line
site_txt.html = true;
site_txt.htmlText = "<u>" + "<a href='" + this.websiteURL + "'>"
+ this.websiteURL + "</a>" + "</u>";
empty_mc.loadMovie(this.imageURL); // load JPEG
} else {
trace("Failure");
}
}

__________________

my question is: how should I change it to call the url in a _blank window?

thank U by now!

LoadVar() And ASP
Hello all,
I have seen a few threads on this but I can't seem to figure out what I am doing wrong if anything. I have a flash movie that I would like to call an ASP page. This page connects to my database to retrieve my records and then outputs them in variable=value format. Ultimately what I am trying to do is take this data and fill an accordian component with the information.

So far, I am just using a "trace" to see the data sent back from the ASP page to make sure it is connecting correctly.
Here is my asp page code

Code:


call open_DBConn("QUINCE","FACILITIES")

dim SQL, rsFM, intX
SQL = "SELECT OWNER_ID FROM SPACE WHERE SPACE_TYPE_ID IN (3,9)"
call open_myRS(rsFM, SQL)

intX = 1
Response.write "&"
do while not rsFM.eof
Response.write "ownerName" & intX & "=" & rsFM("OWNER_ID") & "&"
rsFM.moveNext
intX = intX + 1
loop

call close_myRS(rsFM)
call close_DBConn()


Here is what the asp page processes

Code:

&ownerName1=MSABOVIK&ownerName2=ACEDRONE&ownerName3=JMOSHIER&ownerName4=JEBROWN&ownerName5=DLILLIBRIDGE&


I think this is in the correct format. Hopefully someone can let me know if I should be able to parse this into an array to use in the accordian.
Here is my load vars code in my flash movie

Code:


//get data from database
var dataloader = new LoadVars();
dataloader.onLoad = function(success) {
if(success) {
trace(this);
}
}

dataloader.load('process.asp');


I get this code in my trace when I run the flash movie. This is where I think I have something wrong.

Code:


%22%0D%0ArsFM%2EmoveNext%0D%0AintX%20=%20intX%20%20%201%0D%0Aloop%0D%0A%0D%0Acall%20close%5FmyRS%28r sFM%29%0D%0Acall%20close%5FDBConn%28%29%0D%0A%0D%0A%0D%0A&%20rsFM%28%22OWNER%5FID%22%29%20=&%20%22=&%20intX%20=&%22%0D%0Ado%20while%20not%20rsFM%2Eeof%0D%0A%09Response%2Ewrite%20%22ownerName%22%20=&%3C%21%2D%2D%23include%20virtual=%22%2Fwebincludes%2Fdb%5Fsubs%2Easp%22%2D%2D%3E%0D%0A%3C%0Acall%20o pen%5FDBConn%28%22QUINCE%22%2C%22FACILITIES%22%29%0D%0A%0D%0Adim%20SQL%2C%20rsFM%2C%20intX%0D%0ASQL% 20%3D%20%22SELECT%20OWNER%5FID%20FROM%20SPACE%20WHERE%20SPACE%5FTYPE%5FID%20IN%20%283%2C9%29%22%0D%0 Acall%20open%5FmyRS%28rsFM%2C%20SQL%29%0D%0A%0D%0AintX%20%3D%201%0D%0AResponse%2Ewrite%20%22&onLoad=%5Btype%20Function%5D


Hopefully all this code will help to explain my problem.Thank you in advance for all your help.
jlmoshier

Anyone Have Any Trouble With LoadVar()
I'm working on using the loadVars object to pass data to a server script. I'm not having the best of luck. So I was wondering if anyone has tripped over this before and may have some advice using loadVars beyond what is in the Flash Reference.

thanks.

LoadVar Can't Load From PHP?
I used to use this method to load variable from php:
loadVariables ( _level0.serverPath + "check_login.php", "", "POST" );

This time I try to use loadVars likes:
myLVObj = new LoadVars();
myLVObj.load(_level0.serverPath + "check_login.php");
myLVObj.onLoad = function(success) {
_root.traceMsg = "loadOK";
_root.error = myLVObj.error;
}

I put an text box on stage to trace "traceMsg" and "error", The traceMsg text box could show "loadOK" while _root.error's text box remain empty. I am wondering why the value of "error" couldn't be shown. Have I made something wrong?

Loadvar Problems
I am trying to load a txt file into my flash swf but to no avail.
I have some string literals (in quotes) and some numerical values but the files is being loaded as all string literals with escaped out quotes for the string literals.


Gosh I hope that makes sense.

code: lv = new LoadVars ();
lv.load ("http://www.startribune.com/style/news/graphics/slideshow/flash2.txt");
lv.onLoad = function (success)
{
if (success)
{
_global.lvresult = "yes";
trace ("success");
}
};

LoadVar() And Javascript
Hi

I am loading a variable from a javascript ASP page. This connects to a access db.

In clientside code I have
"&mainBoxVar="+droplist.value

the droplist is a select menu in the body tags.
When flash loads the page it displays the text "droplist.value .Why isn't it displaying the actual droplist value?

This is the first time I've tried connecting flash to a db, so hoefully there is a simple mistake

Thanks

In Search Of A Little Loadvar Help
I am having a devil of a time getting my txt file-loading code to work.

The problem is that I have both string literals and variables included in the txt file. When I load the txt file it makes string-literals (puts quotes on) out of everything.

code:
lv = new LoadVars ();
lv.load ("http://www.startribune.com/style/news/graphics/slideshow/flash2.txt");
lv.onLoad = function (success)
{
if (success)
{
gotoAndPlay ("Scene 2", 1);
trace ("success");
}
};

Also will the above code send those variables to scene 2 or will they be innaccesable from scene 2?

PLEASE HELP

Thanks!

Ouick One LoadVar
loadVariables("content.txt", "_root.main");


how do I load this into a text box with a onEnterFrame so it shows up when the text box appears, so I don't have to click a buttn

, also I need to make it scroll


thanks

very much

LoadVar.sendAndLoad Bug? (ASP)
Im at a loss! my ASP page isnt recieving sent data, which i use to retrieve requested data from a database. Below is an example and explanation of what is happening

If i use the the send method:

AS:
getSections=new LoadVars()
getSections.sendSQL="SELECT * FROM sections WHERE Use=True;"
getSections.send( _global.siteAddress+"getSections.asp", "_Blank");

and Display the sent value:

ASP:
Response.Write Request.QueryString("sendSQL")

for the ASP file it works!

However if i use the sendAndLoad


AS:
getSections=new LoadVars()
getSections.sendSQL="SELECT * FROM sections WHERE Use=True;"
getSections.sendAndLoad( _global.siteAddress+"getSections.asp", getSections);


getSections.onLoad=function(success)
{
if(success)
{
trace(getSections.Var1+"/")
}
}


ASP:

Response.Write "Var1="&Request.QueryString("sendSQL")


I get BOT all back !!!!

I quote from the help files:

Quote:




Variables are posted in the same manner as LoadVars.send(). Variables are downloaded into targetObject in the same manner as LoadVars.load().




So surely this should work!!!


Im about to break something so any help would be most appreciated and save me replacing said broken things

Trouble With Second LoadVar
If someone could just tell me what I am doing wrong. I'd appreciate it. I have tried every variation I can think of without success.

I am trying to use LoadVars and I am having trouble. I am using Flash MX 2004. I can have one LoadVars and that works just fine. I created a second LoadVars to handle a second text document. For some reason, this document is loaded but the scroll bar does not work properly. Does anyone have a clue? You can see it at www.lc.capellauniversity.edu/~tg8806 (Click on the who is thomas icon.) The Move in question is loaded into level three.

On frame one of my movie, I have:
stop();
WhoIsTom = new LoadVars ();
WhoIsTom.load("Who.txt");
MyResume = new LoadVars ();
MyResume.load("Resume.txt");
WhoIsTom.onLoad = function(Hedaman) {
if (Hedaman) {
trace("done ");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "Whobox" equal to the
//contents of the variable of desired content.
Whobox.text = WhoIsTom.Whois;
gotoAndPlay("SecondLoad")
unloadMovieNum(2);//this is a preloader
} else {
trace("not loaded");
play();
}
};
The button (frame four) has the following code.
on (release) {
Whobox.text = MyResume.Res;
}
The text file has only one variable: &Res=Blah, Blah, Blah.

I thought it might be that I needed a separate text field, so I created a process for that and I had the same result.

I thought, to heck with it, and put in the first LoadVars object (WhoIsTom) using the same textbox and scroll bar. With every other variable, the schroll bar worked fine. Only with this variable does the scrollbar misbehave. I thought maybe the variable included too much text; I cut it in half. That made no difference at all.

I am stumpted, but that is not so hard to do.

LoadVar Question
Hi,

I am trying to use a combo box to load a textfile.... what am I doing wrong???


Code:
function getFile() {
fillForm = new LoadVars();
targetFile = _root.cbox.getSelectedItem().label+".txt";
fillForm.load = targetFile;
}
myButton.onRelease = function() {
getFile();
trace(targetFile);
};
fillForm.onEnterFrame = function(success,fail) {
if (success) {
trace(myArea);
}
};



Do I need to add a delay to allow the textfile time to load? Just a one frame movie with a combo box and a textfield called "myArea"....
in the textfile there are only a few test variables......

myArea=Here&Fname=Woody&Lname=Woodpecker........et c

The trace on success for fail gets nothing,.. if I trace the combobox it traces correctly to the file that is supposed to load. If it loads, it should populate the textfield with "Here"

Any suggestions?

Thx
NTD

Loadvar Still Not Working
to quote Ryanw2626, i've been having the exact same problem!

"I have a problem. I have a main movie that loads external movies. That works fine. But in my external movie, I have a loadVariablesNum command to lad a text file. When i preview the external movie, the text appears, but when I test my main movie thats supposed to contain everything, the text doesn't appear. What am I doing wrong. Please help someone."

someone mentioned something about checking the paths but the advice really didn't make any sense.

More LoadVar Help Needed
Previously I have successfully loaded variables from a text file into a dynamic text box and I have done so successfully into movie clips using targets. however, i have a movie file in which it wont let me do this. I've checked and double checked the paths and the variables and the files and i can't figure it out. Any possible pitfalls i'm missing? here is my schematic (if you would like me to send the .fla, leave your email addy):


Main Timline (variables loaded from text file)
- Container MC
- Content MC (with dynamix text box)

please help, thanks!

Loadvar Prob
Ok I use loadvars to load text from a txt file, works fine bar one thing: all the lines are double-spaced, yet when I edit the text (input field in flash) i can add lines in between so the text-box is fine. ne ideas?

text loading:

text=abcdefg
hijklmnop
qrstuv
wxyz

load cmd:

loadVariables("test.txt", this);

[F8] LoadVar Question ....
This is probably something simple that im just missing for some reason ( probably the lack of sleep in the past week )

How can I make this load into a Dynamic Text Box

lv = new LoadVars();
lv.load("myfile.txt");
lv.onLoad = function(){
trace(lv.updates);
};


TIA

Loadvar Issues
Hi,

I need to load and send variables via the loadvar class at the same time. Here is what I have so far.


Code:
function loadData() {
var loadvars:LoadVars = new LoadVars();
houseID = "56952253";
loadvars.houseID = houseID;
//sendHouseID.sendAndLoad("http://www.xmascard.halfdayclosing.com/getdata.php", sendHouseID, "POST");
loadvars = new LoadVars();
loadvars.onLoad = function(success) {
if (success) {
trace("success");
} else {
trace("error");
}
};
loadvars.onData = function(myresults) {
trace(myresults);
};
}
loadvars.sendAndLoad("http://www.xmascard.halfdayclosing.com/getdata.php", loadvars, "POST");
Basically i need to send a variable to php, php does it's stuff and then sends me the result. Thanks in advance.

LoadVar Vs GetURL
What's wrong here: using geturl after asp processes it takes me to the blank asp page but sends the email:


Code:
on (release) {

geturl("http://www.sharpimpact.com/mail.asp","","POST");'
fname = "";
Email = "";
nmessage = "";
stop()

}

so then i tried the LoadVar and I don't go to the blank page but it doesn't send me an email either:

Code:
on (release) {
var my_lv:LoadVars = new LoadVars();
my_lv.fname = fname.text;
my_lv.email = email.text;
my_lv.Nmessage = Nmessage.text;
my_lv.send("http://www.sharpimpact.com/mail.asp", "","POST");
fname = "";
Email = "";
nmessage = "";
stop()

}

Loadvar From Other Site
Hi at first sorry for my poor english


i use in a swf this code :

system.useCodepage = true;
charg = new LoadVars();
charg.onLoad = function(a) {
_root.saints = charg.st.split(",");
cmpt = 0;
_root.minut = 0;
txt.saint.text = _root.saints[0];
};
charg.load("http://www.audeymat.com/fete/insert/saint.asp");

to retrieve informations from an other site. When i use my flash on the same site (than the asp page) or in Macromedia flash all is Ok. But when i put my swf in an other site my variable is empty.

LoadVar Issues (is It Just Me ?)
i am trying to set up a .swf (loaded into a parent clip) with a button to trigger the .loadVars function i have been using.

The actual load works fine (the selected swf loads in ok) but the preloader i have been using does not function properly. ( the "preloader_mc" and the "target_mc" are both in the _root .swf, and the code for the button is in a .swf previously loaded into the target_mc).

I hope i am explaining this properly as my actionscripting experience is pretty low still.

anyway, here is the code.

I have the feeling this is something very simple, but i cant work it out!!!!


ActionScript Code:
//this is my code

on (release) {

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
   
    var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
    progressBar.gotoAndStop(loaded);

}

myListener.onLoadInit = function (target_mc:MovieClip) {

    progressBar._visible = false;
}

myListener.onLoadStart = function (target_mc:MovieClip) {

    progressBar._visible = true;
}

myMCL.loadClip("about.swf", "_parent.container");

}



please help me if you can as im going round the bend trying to work this out.

Thanks for any posts everyone !!

jon saul

jon_saul@WaringCollins.com

Using LoadVar In A For Loop?
I have a list of filenames in an array pointing to data files on my hard drive. I'm trying to use a for loop to sequentially extract each filename from the array and load the file into an new array for later use. I have an onLoad event handler checking whether each file has been loaded.

Result: It looks like the loop goes through all of the filenames but only the last index gets loaded and pushed on to the new array i.e. all indices of the new array contain the data from the last loaded file.

Here is my code---can someone clue me as to what's wrong?









Attach Code

//make list of page contents to load
_global.pageContents = new Array();
for (var i = 0; i<moduleContents.length; i++) {
var fileload = "fileload"+i;
fileload = new LoadVars();
fileload.load(_global.moduleContents[i]);
fileload.onLoad = function(success:Boolean) {
if (success) {
_global.pageContents.push(fileload);
trace(_global.pageContents[i]);
} else {
trace("failed to load");
}
//if success
};
//onLoad
}

Add New LoadVar Properties
Im a beginner at flash and my english isnt that good eather but i'll give it a shot.

I know that you can add new properties in a variable like i'll show in the first part.
But is there anyway that i can do it as i will show in the second part?








Attach Code

// First part
myDataOut = new LoadVars();

myDataOut.artistVar = searchArtist.text;

//Second part
var properties = artist;
myDataOut = new LoadVars();

myDataOut. + [properties] = searchArtist.text;

// or something like this

myDataOut. + properties = searchArtist.text;

Problem With LoadVar
Code:

deleteVars = new LoadVars();
deleteResponse = newLoadVars();
deleteResponse.onData = function() {
trace("Responded");
Alert.show(this.response, "Delete Status", Alert.OK, _root);
};
deleteVars.path = directoryTree.selectedNode.attributes.path;
trace(deleteVars.path);
deleteVars.sendAndLoad("http://siteadministrator.simplifieds...org/delete.php", deleteResponse);

PHP Code:



<?phpecho 'response='.unlink($path);?>




Nothing happens...ever! But if I go to the site (http://siteadministrator.simplifieds...org/delete.php) and type in "?somefile.exe" it will either throw the error...or do what it is supposed to do delete the file...

So that would mean the the AS is flawed somewhere, right? What to do?

How To Change Url Using Loadvar?
Hi
Maybe this is simple but I have troubles trying to do it.
I want to change the url of the buttons of my swf movie using an external documment like txt or xml. Everybody says : use loadVars. How?

Thans for your help

LoadVar == String Only?
Ive been looking all arround and I cant find the answer to my question ....

First off is the LoadVar for Strings/Numbers only? (I'm using PHP to feed flash)
if so is there a way arround it?
Could I use XML

I have a combo box and right now I'm just trying to populate it via PHP

How can i get an object like {data:5, label:'click happy'}; to stay an object?

thus far Ive only seen it as a number or a string so when it outputs into the comboBox it shows exactly what you see.

LoadVar Problem
Howdy
Iīm having a textfield that is editable and then saved (by a button click) to a txt file. when pressing that button the visitor goes to another frame that just tells the user that the text is saved. Now my problem is that when the user goes back to the frame where he/she can edit the text the latest changes arenīt visible, but when closing the browser and returning to the page the new changes appears.
The code in my first frame (as learned from kirupa tutorials to make the scroller work).


ActionScript Code:
loadText = new loadVars();loadText.load("skivlog.txt");//creating the loadVarsText functionloadText.onLoad = function() {        scroller.text = this.newtext;};stop();


The php I use to save the text works I just canīt figure out how to "refresh" the textfield when new text is edited. I tought that jumping to another frame where the scroller.text = "", and then back would automaticly reload the text?
Very tankful for all help...

Hereīs a link to the fla if anyone likes to try something similar.
Link to fla

Problem With LoadVar
Code:

deleteVars = new LoadVars();
deleteResponse = newLoadVars();
deleteResponse.onData = function() {
trace("Responded");
Alert.show(this.response, "Delete Status", Alert.OK, _root);
};
deleteVars.path = directoryTree.selectedNode.attributes.path;
trace(deleteVars.path);
deleteVars.sendAndLoad("http://siteadministrator.simplifieds...org/delete.php", deleteResponse);

PHP Code:



<?phpecho 'response='.unlink($path);?>




Nothing happens...ever! But if I go to the site (http://siteadministrator.simplifieds...org/delete.php) and type in "?somefile.exe" it will either throw the error...or do what it is supposed to do delete the file...

So that would mean the the AS is flawed somewhere, right? What to do?

How To Change Url Using Loadvar?
Hi
Maybe this is simple but I have troubles trying to do it.
I want to change the url of the buttons of my swf movie using an external documment like txt or xml. Everybody says : use loadVars. How?

Thans for your help

About LoadVar Class
Hello!I'm beginner!

ActionScript Code:
_root.createTextField("conText",31,5,5,100,1000);
myVar=new LoadVars();
myVar.onLoad=function (success)
{
    if(success){
        trace(this.toString());     //output:myText=content,It's right!
        _root.conText.text=myText.text;
    }else{
        _root.conText.text="Failed load text!You may try again!....";
    }
}
myVar.load("hy.txt");

But the text field showed "undefined"!Who can tell why?thank you!

Cache Or Loadvar Problem?
This is my first "high score" board so forgive me if I'm doing it all wrong.

It's for a game. At on point I'm writing a .txt file using php, and the thing writes fine, but when I loadvars from it a few frames later, the movie refuses to show what I just wrote, but rather shows what was in it when the movie loaded.

The sequence is like this:

1. loadvars from txt file that have high scores

2. display high scores to user

3. user plays game, gets a high score.

4. write a new value into the highscore.txt file (overwriting the old value in the process).

5. go to the beginning of the movie (step 1) and repeat.

The file is written, the new value is there, but the frikken thing doesn't pick it up but uses the previously loaded value. Anyone know what I'm doing wrong? Is there a way to flush the cache somehow (if I close the browser and open a new browser I see the new value - but that method sucks).

Thanks in advance for any help at all.

Loadvar Cache Problem
got a simple .swf that loads content from a .txt file. the content changes frequently, but the old file remains in cache, so the changes won't show.

is there any way to remove the file from cache with flash? or always request some sort of refresh?

thanks.

Understanding LoadVar And More(MX,mysql,php)
Hi, I have a database(mysql)filled with different links and Iīd like to get that info into flash MX.

So the php script goes:

count.php, to see how many posts/links there are.
<?
server connections etc

$count_query="SELECT count( * ) FROM links";
$count_result=mysql_query($count_query);

print("&how_many=$count_result");

?>

then I have the php file that should list all the links.
links.php
<?
server connections etc

$link_query="SELECT * FROM links";
$result=mysql_query($link_query);

print("&name=$name");
print("&url=$url");
?>
*Note,, the sql/php code might be wrong. Im a newbie so please correct me.

I then want to get this information into flash.
I have 2 dynamic boxes called name and url.
On the first frame I have
loadVariablesNum("count.php", 0, "POST");

and on the second I have
loadVariablesNum("links.php", 0, "POST");

Then what?? If I have lets say 30 posts in the databas and want them all displayd I should have some sort of loop I guess.

And if I want the name to be the link so that the url doesnt show how would i do that?

And nothing of the code above works,, how should I do this.
Does anyone have the time and patience to help me out, give some examples. I have downloaded all the fla:s I could find but didnt understand much of it.

Found something on a tutorial about looping cause the script needs it somehow.. so I added a status box and at the first frame i say:
status="Loading";
and then the loadVar on the count.php,,
the I did this..
if (status eq "LOADING")
etc etc

still didnt work,, so I still need a friendly soul to explain this to me step by step.

plese help me

Loadvar, While Statement, And Many Instances
Ok I'd have to say, I'm no where near new to ActionSCript- but this boggles me dearly I swear it might be something simple.

I am willing to further explain this to anyone via AIM or email- but this is really a "can actionScript possibly do this?" type question, not "I know ActionScript can, I'm just No0b" thing.

I loaded a list of variables with loadVars and the loadVars object is called "thelist". I have a setup where thelist.numproducts tells this movie how man times to copy an instance of a blank rectangle- making spaces for each product to be displayed. The rest of "thelist" is the info to put in there. here is some of that url-encoded file:


Quote:





numproducts=6
&info1.price=80&info1.para=One+of+the+most+tedious +works+of+the+Awards+collection&info1.name=Natural +Deer+Engravement&info2.price=80&info2.para=One+of +the+most+tedious+works+of+the+Awards+collection&i nfo2.name=8+Inch+Handcut+Plate&info3.price=80&info 3.para=One+of+the+most+tedious+works+of+the+Awards +collection&info3.name=Crest+Engraved+Redwine






The variables load fine- so dont study that TOO hard. Study that and notice the pattern- this is ready for a while statement- and I have the blanks waiting to be filled. here is the prob:


code:
var startproducts = thelist.numproducts;
while (thelist.numproducts>1) {
//All the words
duplicateMovieClip("info"+a, "info"+a,a);
setProperty("info"+a, _y,("info"+a+"._y")+90);

//THIS IS THE PROBLEM LINE..
set("info"+a+".paragraph","thelist.info"+a+".para" );

a++;
thelist.numproducts--;
}

the 'info' movieclip has the dynamic text fields (para is just 1) inside- I know what I'm doing...

both sides are like.. dynamic.. so what actionScript statement supports this without taking the second side as a literate string? cause now my movie plays and shows "info1.paragraph", and so on and not the actualy info1.paragraph!! If I need to change my whole programming mindset- tell me what way is right...

LoadVar Fails In Frameset
I've created a file and have loadVar obj to pass data to php. This works fine at the very beginning. But when this swf was put in a frameset, php tell me it fails to get the variable from swf. Is there any possible solution to solve this?

My script is very simple:
sendLV = new LoadVars();
sendLV.school_no = _root.school_no;
sendLV.send("browsegallery.php", "POST");

in php, i have this script:
$school_no = $_POST['school_no'];

LoadVar Text Question
Hi,

I load several texts from different textfiles using codes like:


loadText = new loadVars();
loadText.load("lening.txt");
loadText.onLoad = function(success) {
if (success) {
veld.html = true;
veld.htmlText = this.myNews;

}
}
}


but, althought it works fine and looks pretty good, there are just one or two lines in each text that don't start at the most left position of the field, but one letterposition next to it (must be a word for that but i don't know).
I am using

Quote:
System.useCodepage = true;


to be able to use some special characters.
<BR> is not working to get rid of that one letter space.

I also tried
veld.align("left", true)
on buttons and/or frame but no luck.

Does somebody have a clue?

Thanks very much,

Jerryj.

[F8] Error Message Loadvar
hi i have the following code...
is it possible to add some actionscripting that returns a errormessage"no information aviable" when failing to load the variables in the jsp file ?

loadVariables("http://www.mydomain.com/text.jsp", "");

fla test here : http://board.flashkit.com/board/showthread.php?t=712286

LoadVar VS. LoadVariablesNum SMACKDOWN
A coworker and I were trying to solve the same problem of loading some variables from a txt file. She came up with loadVariablesNum, which worked. My solution was loadVars, which also worked.

She thinks hers was a better solution and I think mine was. Of course neither of us can explain WHY one is better than the other, so I thought I'd ask my friends here at FlashKit for some help.

Which of us was right!?



-Layne

Copyright Đ 2005-08 www.BigResource.com, All rights reserved