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




List Vars From LoadVars



Is there a way to list the vars retrieved from loadVars?

Thanks,
e39m5



SitePoint > Design Your Site > Flash and Actionscript
Posted on: Dec 17, 2005, 14:28


View Complete Forum Thread with Replies

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

Getting Vars From LoadVars
I am loading VARs from an external text file and populating dynamic text fields with information from this external file. This is what I have so far (frame action):

loadVarsText = new loadVars();

loadVarsText.load("directory/file.txt");

loadVarsText.onLoad = function(success) {

if (success) {
dynamicTextFiled.text = this.information1;
} else {
trace("not loaded");
}
};
stop();

As you can see, a dynamic text field is populated with information that is taken from the external text file – after the external text file has been loaded. How can I access other information from this same external text file WITHOUT reloading the entire external text file? In other words... when the next frame in the scene loads I want dynamicTextField.text=this.information2. Any ideas?

Loadvars Getting Vars From A Php File
i have this simple php file set up
<?php
$name1 = "Hello";
$name2 = "World";
echo $name1 . $name2;

?>

i want to load them up in flash
the action script in flash

var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success:Boolean) {
if(success) {
trace(myLoadVars.name1);
trace(myLoadVars.name2);

}else{
//throw error
}
}
myLoadVars.load("http://localhost/dataDriven/loadvars.php");

however i get this when i test the movie iin flash

undefined
undefined

can anyone point out my mistake
thks

How Get Vars If I Use LoadVars.onData
I use this code and try to get data from simply txt file.
I explored with onData method.
AS:

Code:
var myLV:LoadVars = new LoadVars ();
myLV.onData = function (scr:String)
{
if (scr == undefined)
{
trace ("Error loading content");
}
else
{
_level0.createTextField ("scr_txt", 1, 10, 10, 200, 200);
_level0.scr_txt.border = true;
_level0.scr_txt.text = scr;
_level0.createTextField ("a_txt", 2, 10, 300, 200, 200);
_level0.a_txt.border = true;
_level0.a_txt.text = myLV.var_a;
}
};
myLV.load ("myText.txt", myLV, "GET");
How can I get the value of var_a?
Shoud I use for it method onload ?

Thanks
TXT file has those vars:

Code:
var_a=Hello&var_b=World

Need LoadVars To Show Vars In Address Bar
Hi,

I'm using this code for a search form and the problem is that when I hit "submit", it returns the page without the variables showing in the address bar of the web browser. I need them to show up.

I need it to go from this: mysite.com/search.php
to this: mysite.com/search.php?search%5Ftype=like&player%5Fname=mantle &cat=1&searchby=last%5Fname&action=search

This is the code I'm currently running:

Code:
stuff = new LoadVars();
stuff.action = "search";
stuff.searchby = searchby;
stuff.cat = cat;
stuff.player_name = mainfield;
stuff.search_type = stype;
//trace(stuff);
stuff.send("http://www.mysite.com/search.php","_self","POST");
Any help would be GREATLY appreciated.

LoadVars = Success, But My Vars Are Undefined?
Hello all!
I've been working with LoadVars a lot recently and like it very much so. However, I have encountered a new problem. As always, I have searched through a bunch of threads to no avail; if this is a repeated question, please trout slap me and I'll apologize! Anywho -

I have this array that already works in my Flash project:

ActionScript Code:
angles = [0, 35, 100, 72, 72, 81];

Now I want to pull those numbers in the array from a changing PHP program. To start, I'm using a test file:

PHP Code:



&p1=0&p2=35&p3=100&p4=72&p5=72&p6=81 




Then I have actions like this right before I need those pulled in:

ActionScript Code:
lv = new LoadVars();lv.onLoad = function(success){if(success){p1 = this.p1;p2 = this.p2;p3 = this.p3;p4 = this.p4;p5 = this.p5;p6 = this.p6;trace(p1);     //returns a zero}}lv.load("myStupidTextFile.txt");trace(p1);    //returns 'undefined'  

How do I get those variables to register outside of the loadVars? There has to be a way, right??!!

Update Vars Sent To Flash WITHOUT 'GET' Or Loadvars?
OK - could somebody simply tell me if this is even possible -


My main.swf is embedded in my index.html page.

It loads external swfs in ONLY WHEN a HTML button, sitting outside my main.swf but ON index.html is clicked - posting it's variable/value to my swf?

So what I am saying is - Flash will not be functioned to do it's loadVars magic, I want Flash to be ready & waiting for a new variable to arrive at any given time - THEN action a function depending on the value of the variable.

Does this make sense to anyone?

I'm just not sure on the limitations of Flash - the program where I thought absolutely ANYTHING is possible.

If it's not possible then I will go around this problem another way.

LoadVars = Success, But My Vars Are Undefined?
Hello all!
I've been working with LoadVars a lot recently and like it very much so. However, I have encountered a new problem. As always, I have searched through a bunch of threads to no avail; if this is a repeated question, please trout slap me and I'll apologize! Anywho -

I have this array that already works in my Flash project:

ActionScript Code:
angles = [0, 35, 100, 72, 72, 81];

Now I want to pull those numbers in the array from a changing PHP program. To start, I'm using a test file:

PHP Code:



&p1=0&p2=35&p3=100&p4=72&p5=72&p6=81 




Then I have actions like this right before I need those pulled in:

ActionScript Code:
lv = new LoadVars();lv.onLoad = function(success){if(success){p1 = this.p1;p2 = this.p2;p3 = this.p3;p4 = this.p4;p5 = this.p5;p6 = this.p6;trace(p1);     //returns a zero}}lv.load("myStupidTextFile.txt");trace(p1);    //returns 'undefined'  

How do I get those variables to register outside of the loadVars? There has to be a way, right??!!

LoadVars - Passing Vars To External Loaded SWF
I load my vars with LoadVars in main SWF and would to like use the loaded variable in later loaded SWF.
I canīt find how to find the right path to my txt field in this loaded SWF.
E.g.
I load ext. SWF in mc container_images_of_pools
In root of this ext. SWF I habe txt field txt_pools_plastic
Thanks

LoadVars - Passing Vars To External Loaded SWF
I load my vars with LoadVars in main SWF and would to like use the loaded variable in later loaded SWF.
I canīt find how to find the right path to my txt field in this loaded SWF.
E.g.
I load ext. SWF in mc container_images_of_pools
In root of this ext. SWF I habe txt field txt_pools_plastic
Thanks

How To Cycle Through A List Of Vars From Php/mysql
Hello everyone ive been stumbling with this for days and it keeps returning so i need to find away to fix it.
i have a mysql db and php im very good with php and mysql and im learning actionscript right now. i have flash 8 pro. im loading a list of testimonials from the database and i need them to print out in a flash document that i have created, it works great when i just send one variable but i need it to dynamically cycle through all the variables untill there are no more testimonials. so in php i have

Code:
<?PHP
require_once('conn.php'); // connects to db
$getmsgs = "select * from messages where type='testimonial';";
$gomsges =@mysql_query($getmsgs);
$i=0;
while ($msgrow = mysql_fetch_array($gomsges)){
if($i!=0){echo"&";}
echo "testiname$i=$msgrow[4]&testimsg$i=$msgrow[2]";
$i++;
}
mysql_close($link);
?>
as you can see i concated the incrementing i to the names so that i can distiguesh between them then in flash i load them into a array to kindof weakin my workload here is the actionscript the if statement is just to put the & symbol into the first variable but only if its not the first variable ... pay it no mind

Code:
myVars = new LoadVars();
myVars.load("http://www.harryrice.zonemikel.com/testiflash.php");
myVars.onLoad = function( ){
trace("variables loaded");
}
myVars.onLoad = function( success ){
if(success){

testi.textColor = 0x000000;
var testimonial:Array = [myVars.testiname0,myVars.testimsg0,myVars.testiname1,myVars.testimsg1];
i=0;
while (i<4){
testi.text +="From:" +testimonial[i] +"
";
i++;
testi.text +=+ testimonial[i] +"

";
i++;}
} else {
trace("Error loading page");
}
}
I have had similar problems with php and i solved them by having $variable3 =variable2$variable1 and then i would incrament to give me variable1,variable2,variable3 but i cant just tag the i onto the end of a vairable in flash to get var1 var2 and var3 because if i do something like while(i<3){vari; i++} it has no way to disinguish the i from the variable..

as you can see it prints out the first two testimonials that are loaded into the array (myvars.testiname0 and myvars.testimsg0 and one) which correspond to the first two testimonials but is there any way i can load the variables from php and have it print them all out till there are no more ? i tried doing it without appending the incrementing i to each name in php but then it just prints out the last message twice ? I need it to print out every message till there are no more.
thanks in advance the only other alternative i have is to load like all the way up to myvars.testimsg10 into that array and loop through them and then only print out to the textfeild if it is not undefined which would be a pain and not very dynamic. this is a stepping stone for a similar problem that i have with a flash chat room so when i figure it out the rest will be gravy.
Thanks and your welcome to look at the page and click testimonials to see the flash movie ... i think testi is a bad variable name but it seemed good at the time

Mailing List And Sending Vars
Hi,

Trying to replicate an HTML form in Flash

HTML FORM :


Code:
<form method=post action=http://www.ymlp.com/subscribe.php?myUserName>
<td width="180"><input type="text" name="YMLP0" size="30"></td>
<td width="227"><input type="submit" value="Submit"></td>
</form>
ACTIONSCRIPT :


Code:
var listURL:String = "http://www.ymlp.com/subscribe.php?myUserName";

var request:URLRequest = new URLRequest(listURL);
var vars:URLVariables = new URLVariables();
vars.YMLP0 = inputText.text;
request.data = vars;
request.method = URLRequestMethod.POST;
navigateToURL(request, '_blank');
If I send the form without any vars, I get the correct response from the php - a page telling me I need to fill in an address.

If I add the var as in the code above, I get the same response.

Any ideas? Thanks

Checking A List Of Vars For Similar Values ?
This one's a little hard to explain.
here goes...

I have a list of variables imported from a dbase/textfile. Looks something like this:

&title1=blablabtitle&content1=blabcontent&date1=au gust 2002&title2=balbalb&content2=balbalmorecontent&dat e2=march 2003&title3=...&content3=...&date3=august2002&item count=3

Its a list of, let's say 50 items. These items provide content for dynamically generated movieclips on a timeline-like interface.

Some items share a same date (e.g. august 2002). when there's two things in a same month, I need to generate two movieclips that pop out of my timeline...

I need something that tells me:
august 2002 --> 2 items
september 2002 --> 1 item
november 2002 -->3 items
december 2002 --> 1 item

how should I do this / what technique should I use ?

hope this makes a little sense...
thanks

[MX]loadVars - List All Varialbes?
Hello,

Using loadVars and importing variables into Flash through a text file, is there a way to automatically list all of the variables that are in the Text file? For example say my text file had these variables:

&foo=chuck&
&mario=luigi&
&frodo=hobbit&

If I didn't know the names of the variables foo mario and frodo, could I somehow scan the text file for all variables and simply list:

chuck, luigi and hobbit?

Thanks!

[MX]loadVars - List All Varialbes?
Hello,

Using loadVars and importing variables into Flash through a text file, is there a way to automatically list all of the variables that are in the Text file? For example say my text file had these variables:

&foo=chuck&
&mario=luigi&
&frodo=hobbit&

If I didn't know the names of the variables foo mario and frodo, could I somehow scan the text file for all variables and simply list:

chuck, luigi and hobbit?

Thanks!

LoadVars From List Text File
I have a filenames.txt file filenames.txt contents
____________
a.jpg
b.jpg
c.jpg
d.jpg
____________

Is there any other way to get the list than loadVars?
Please help me convert the filenames in to a array string like - ["a.jpg", "b.jpg", "c.jpg", "d.jpg"]

Thx,
Nitin

Preload LoadVars, Stage/browser Alignment And Mailing List
Hey, I was wondering wether anyone could help me out with giving some feedback to users when using LoadVars to load .txt files, just in case there is a bit of a wait. I believe you can use getBytesLoaded and Total to trace the progress but i don't know how to apply it to LoadVars. Anyone help please?

Also i'm trying to publish my flash movie at 650 width 500 height and it will pop up in a browser of the same size, so i thought. I can't seem to get it tight to the edges and have to leave a gap which doesn't give a great effect, anyone know whats the best alignment and settings for that effect?


Also i've been trying to resurect an old mailing list code i found, but i don't have any experience in it.
The code can be found here, but i need to try and implement it as soon as possible but don't really know what the PHP means and how to create the database named correctly etc. I'm using PhpMysql.
Any help would be brilliant!
Thanks.
I'll post my site check soon just a few problems like this to iron out.
Thanks alot.

oh yeah, i tried to link to a long php url in one of my external .txt files, using HTML codes and because & is needed it didn't work, i tried using the & code which is supposed to read as "&" in a text file like that. That didn't work either, anyone experienced that before?

POLL: Best AS3 Send Vars And Load Vars Method
Hi Guys,

Can you help me decide which way to go with as3 to php and back again.

I generally use sqlite, xml or mysql for a database. I don't know if that matters. And sometimes (rarely) I don't use a database at all.

In the past (with as2) I always went custom. Im not sure If id be better off doing something else.

If you have another suggestion please let me know.

Converting ALL Vars Of A Clip To Global Vars -possible?
I wonder if it is possible to convert ALL variables set within a movie clip to global variables, using a self-defined prototype like movieclip.varsToGlobal or something like that. Here's the code I tried:


Code:
for (z in this) {
if (typeof (this[z]) != "movieclip") {
eval("_root."+z) = eval(z);
}
}


This seems to work, it copies ALL items found in the clip (excepted movie clips) to the root. But I am not sure WHAT things are duplicated to the root exactly. Just the variables? Or anything else I don't expect?

Mike
x-pressive.com

Local Vars Versus Class Vars
Hey guys, if a function gets call alot of times, such as a collision detection function in a game, will it be quicker to run if the variables for the function are declared and initialised outside the function as class variables? Or should they are declared and initialise inside the function as local variables everytime it is called, for good software engineering?

Load Xml Data(list Of Names), Use List As Buttons In Flash Possible?
Hi, basically I have a quiz game that I made, the quiz is done but I want to keep track of how many times a person has failed the quiz. I have an XML file that has a list of names. I want to take those names, put them in a quiz game (at the beginning) as a "list" of some sort and let the user be able to choose their own name (which is of course already in the XML file). This name will be used to keep track of how many times they have tried the quiz.

I have successfully loaded the XML file (names) into an ARRAY in Flash but how can I output them to the screen AND let the user be able to choose those from the list? as a button? This will add the count after they clicked their name to +1 and then save it to somewhere(where is best?). I will attach the zipped files (there are 4, the fla,swf,2 XML files[quiz/names]). If anyone can help me ASAP it would be awesome.

Chnage The Font Of Selected Item Color In A List Mx:List
Hi,am Trying to change the font (bold and color) of a selcted item in List..But it is changing the complete list's font..

Here it is my code..
<mx:List id="businessFunctions" left="10" right="10" bottom="10" top="208"
dataProvider="{processList}"
itemClick="select();"
horizontalScrollPolicy="auto"
labelField="@name"/>


ActionScript COde:
private function select():void
{
businessFunctions.setStyle("textSelectedColor","#D 3E9F5");
businessFunctions.setStyle("fontWeight","bold");

var page:XML = businessFunctions.selectedItem.page[0];
var pageID:String = page.@id;
var processID:String = businessFunctions.selectedItem.@id;

server.submit(pageID, processID, RequestMessage.BEGIN);
}



Here i need toc hange the selected item color only..

Separate The List Items With The Separator And List Is Dynamic
Hi,
I am getting the list items dynamically ,and hv to draw a separator after the every group of list items.For this I have to embed a script function after every group.How can i do this Actionscrip 3.0 Any help?

Ex:

Group 1:

ABC
DEF
GHI

TODO-----Here we need to draw a line
Group 2:

123
456
789

TODO-----Here we need to draw a line
Group 3:


abc
def
ghi

Here I have da code:

for each(var group:XML in event.responseMessage.rawXML.group)
{
var pageSection:PageSection = new PageSection();

pageSection.text = group.@name;
pageContents.addChild(pageSection);
trace("***********Group Name: "+group.@name);

// once the section has been added, iterate through it's children and render each field.
// for each(var field:XML in server.currentPage..field)
for each(var field:XML in group.field)
{
var formElement:FormElement = AppCode.FieldRenderer.renderField(field, pageSection);
/* check for null, if for some reason we encounter an unknown control type
* the formElement will not be instantiated so we should skip over it.
*/
if(formElement != null)
{
/* formElement.field = field;
pageSection.addChild(formElement); */

formElement.setRuleDetails = this;
formElement.communicator = this.communicator;

if(event.responseMessage.pageType == PageType.UPDATE || event.responseMessage.pageType == PageType.ADD )
formElement.readOnly = false;

fieldList.push(formElement);
}


}
//Add Separator b/n groups

TODO...Here we need to call a function which draws a line.....}


Plz help me if u have any idea?

Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!

What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.

Can anyone assist please,
Thanks,
Stephen.

Converting Bulleted List To Numbered List
I'm trying to put out a list of questions for a test. I'm also using a stylesheet to format the way the text is displayed. This is the way the list should look like:

1. question#1 text.............................................. ......

2. question#2 text.............................................. ......

If more than one line of text per question, it continue on the next line indented. The text for each question needs to be looking like a block of text. The same way a bulleted list displays.

This format can be created by using the <ol>, <li> tags in HTML. But Flash doesn't recognize any style formats for the <li> tag. Only a bulleted list is printed out. How can I format that list into a numbered list? or if not how can I create the same output, keeping in mind that I have to use a stylesheet? Thanks.

Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!

What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.

Can anyone assist please,
Thanks,
Stephen.

(Flash MX Or 8) List/List Component Issues
Hello all.

I recently completed Kirupa's "Creating a Listbox" tutorial, (http://www.kirupa.com/developer/mx/listbox.htm) but have been having a difficult time modifying the event attributes of each list item. Basically, I want to click on an item and have an object on the stage move to a unique xy coordinate. I can get the object to move already (object._x = object._x +10, but unfortunately ALL items on the list execute this script command. I've tried fooling around with the code to get each item to do a unique movement but...well, clearly I haven't succeeded yet.

I'm a Flash nooby and help in the form of specifics would be greatly appreciated. If you can provided modified code from the tutorial to move an object to a unique positions that's even better.

Thanks.

David

List Component. Help. Looked Everywhere. Button And List.
Trying to use a list component and a button. When user selects something from list component and clicks button it takes them to new page, if user doesnt select something from list and hits button, (this is where my question lies) I want it to do nothing and setFocus to list component.

Here is how I am going about it now: New if statement (however it still transfers user if nothing is selected from list component) How can I get it to not transfer? I have tried rewritting this many ways, searched all over the nets, and Nada.


Code:
var arUrl:Array=["/browsecategory.aspx?cat=1","/browsecategory.aspx?cat=2","/browsecategory.aspx?cat=3","/browsecategory.aspx?cat=4"];

var provider:Array=[{label:"Option 1",data:0},{label:"Option 2",data:1},{label:"Option 3",data:2},{label:"Option 4",data:3} ];

mcList.dataProvider=provider;
var obj:Object={};
obj.click=function(eo:Object)
{
var count:Number=mcList.selectedItem.data;
getURL(arUrl[count],"_blank");
trace("count="+arUrl[count]);
}
but.mcSubmit.addEventListener("click",obj);/////here is where I am sending off
if(mcList.selectedIndex == undefined) {
setFocus.mcList;
}
So this thing works perfectly, however if user hasnt selected anything how can I get it to not transfer and setFocus?

I have tried setting if to check it for - 1 (since starts at 0) set to 0? Any ideas please help. Thanks in advance MT

Preloading Loadvars + Code That Uses The Loadvars
Hey everyone

I can't find out how to do this.

I have a main file with a menu. When a menu button is pressed, and external SWF with the corresponding page is loaded into a container in the main movie. I use the MovieCliploader for this

In all my external files, I have a loadVars that gets XML-output from a PHP-file. In the onLoad handler, I have a buildPage() function that takes the variables and e.g. builds a news page and so on.

My question is how I make a preloader that preloads the loadVars + all the code inside my buildPage function? I mean - on big preloader for it all?

I guess it cannot be done with my moviecliploader inside my main movie?

thanx - Rune

Help LoadVars.send Vs. LoadVars.sendAndLoad
OK, my understanding is that if example 1 works so too should example 2:

Example 1:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.send("score.php", _blank, "GET");
Example 2:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.sendAndLoad("score.php", result_lv, "GET");
My understanding is however clearly wrong as example 1 will pass the variable quite happily to my php script which will update appropriately. In example 2, nothing. Nada. Variables aren't availabe to php and (therefore unsurprisingly) my_lv.onload isn't picking up any return.

Where am I going wrong this time?!

Cheers,
Andrew

[AS1][loadVars] Scope Trouble With LoadVars
Hi everybody,

I'm new on this server !
Is there a way to attach a file to my thread ?
You would find enclosed a ".zip" file in wich there's a ".fla" file, a ".txt" file and 6 ".jpg" images.
Frame 1 of the FLA only has a "Preload" class/constructor found on another site and works well.
Frame 2 launches the graphic interface construction.

The file "externalVar.txt" has one variable "maxVin" with a value of 6.
I would like to know WHY i can't acces this variable from outside of the loadVars object's scope (i would better say from outside of its ".onLoad" methode scope).
In fact, when i trace my variable "maxVinNum" from outside of this function, flash player return "undefined". Even if i declare "maxVinNum" on the _root (_root.maxVinNum).

For information, at the start of frame 2, i have let an instruction in comment :
//var maxVinNum = 6;
When we activate this instruction, then the variable is directely declared and everything works well. This test allow us to verify that scripts are not bugged.

Here is the script of frame 2, some of you may understand quickly what's wrong :

//var maxVinNum = 6;
var vignetteVars = new LoadVars();
vignetteVars.onLoad = function(ok) {
if (ok) {
trace(this.loaded);
maxVinNum = this.maxVin;
trace("maxVinNum = " + maxVinNum);
}
};
vignetteVars.load("externalVar.txt");
//
function buildArray (arrayLength) {
FileArray = new Array();
for (var i=0; i<maxVinNum; i++){
FileArray.push ("v_"+(i+1)+".jpg");
}
trace("FileArray : " + FileArray);
};
//
function buildSlide(){
vinKern = 1;
preloadSlide = new Preloader(load_indicator);
for (var i=0;i<FileArray.length;i++){
//Construction du slide
slide.vignette.duplicateMovieClip("vignette"+i,i);
slide["vignette"+i]._x += i*(slide.vignette._width + vinKern);
// ajoute ā la file du preloader
preloadSlide.insert(FileArray[i], this.slide["vignette"+i].conteneur, i,"","","okload");
}
slide.vignette._visible=0;
};

buildArray(maxVinNum);
buildSlide()
stop();


I hope my english is not too bad, and my explaination not too long and understable.
thanks a lot for your help !

LoadVars.send VS LoadVars.sendAndLoad
Last edited by gkcohen : 2004-04-23 at 09:19.
























can someone tell me what the difference is with these two. here is my problem. i am trying to submit some info to php script. i have my variables in text file.

if if loadVars.load("textFile.txt");
and then say loadVars.send(url, "_blank", "post") then it will work. but i dont want to load the resulting php page outside of flash. if instead i do loadVards.sendAndLoad(url, dataReceiver, "post") then it will not work. my dataReceiver will return blank, or i will get an error that the variables were not sent.

i guess that you cant loadVar from a text file and then use it with sendAndLoad, is that right?

the reason for using the text file is the real problem. the php script requires a variable 'group_ids[]' with an integer for a value. apparently, flash cant read the variable with the '[]' in it. i have tried different ways to get it formatted, but it wont work. i tried do something like loadVars.group_ids + "[]" = 1 but i get message stating the the object to the left of the operand must be a variable.

my only fix was to use a text file to load this variable. it works, but only when using the send and having a php srcipt popup.

i am not too familiar with php to modify the scipt, and i think that variable needs to be an array.

i dont know what else to do. HELP

gkc

[AS1][loadVars] Scope Trouble With LoadVars
Hi everybody,

I'm new on this server !
Is there a way to attach a file to my thread ?
You would find enclosed a ".zip" file in wich there's a ".fla" file, a ".txt" file and 6 ".jpg" images.
Frame 1 of the FLA only has a "Preload" class/constructor found on another site and works well.
Frame 2 launches the graphic interface construction.

The file "externalVar.txt" has one variable "maxVin" with a value of 6.
I would like to know WHY i can't acces this variable from outside of the loadVars object's scope (i would better say from outside of its ".onLoad" methode scope).
In fact, when i trace my variable "maxVinNum" from outside of this function, flash player return "undefined". Even if i declare "maxVinNum" on the _root (_root.maxVinNum).

For information, at the start of frame 2, i have let an instruction in comment :
//var maxVinNum = 6;
When we activate this instruction, then the variable is directely declared and everything works well. This test allow us to verify that scripts are not bugged.

Here is the script of frame 2, some of you may understand quickly what's wrong :

//var maxVinNum = 6;
var vignetteVars = new LoadVars();
vignetteVars.onLoad = function(ok) {
if (ok) {
trace(this.loaded);
maxVinNum = this.maxVin;
trace("maxVinNum = " + maxVinNum);
}
};
vignetteVars.load("externalVar.txt");
//
function buildArray (arrayLength) {
FileArray = new Array();
for (var i=0; i<maxVinNum; i++){
FileArray.push ("v_"+(i+1)+".jpg");
}
trace("FileArray : " + FileArray);
};
//
function buildSlide(){
vinKern = 1;
preloadSlide = new Preloader(load_indicator);
for (var i=0;i<FileArray.length;i++){
//Construction du slide
slide.vignette.duplicateMovieClip("vignette"+i,i);
slide["vignette"+i]._x += i*(slide.vignette._width + vinKern);
// ajoute ā la file du preloader
preloadSlide.insert(FileArray[i], this.slide["vignette"+i].conteneur, i,"","","okload");
}
slide.vignette._visible=0;
};

buildArray(maxVinNum);
buildSlide()
stop();


I hope my english is not too bad, and my explaination not too long and understandable.
thanks a lot for your help !

'list' Event Of List Component
oops i mean 'change' event of list component

Hi guys/gals. Ive made an xml/list component driven mp3 player as can be viewed at http://www.flashmatics.co.uk/blog/sa...mp3player.html

When someone selects a new song from the list that songs starts to play. Everything is working fine.

I now want to add an extra bit of functionality i.e When one song finishes i want the next song to start playing. But this means I have to tell the list component that a change has occured as well (even though there has been no user interaction to cause this 'change'). How would I go about this. Here is a snippet of relevant code.


Code:
mySound.onSoundComplete = function():Void{

//from here i need to tell the component a change has occured and to move it
//to the next song in the menu
}


//create a listener for the list component
var compListener:Object = new Object();
list_comp.addEventListener("change", compListener);

compListener.change = function(info:Object):Void{
//how do i get this to move to the next track?
}
Thanks for any help in advance. I dont actually need the whole code or anything but rather a point in the right direction..cheers

HELP Symbols List To Text List?
Is there a way to get a list of all the symbols in the library into a text file quickly and easily?
Thanks in advance!
-Ted

Loading XML List Into RMP List Component
I have several XML lists to load into a RMP List Component List Box.
I was told the code should be like:

myButton.onRelease=function(){
myList.load(String(search.text));
}

So I made a button and named the instance "myButton"
Add the list component called "myList"
The XML files are named test1.xml, test2.xml etc.

I tried variations of:

myButton.onRelease=function(){
myList.load(String(test1.xml));
}

Result....

Nota

I think I may need a Listener or I am not sure...
Can anybody please advise me what I am doing incorrectly?

List's "CellRenderer_upSkin" Displays In List Items (BUG?)
Hi Everyone,

I'm having a huge issue with with the CellRenderer_upSkin displaying on the a list component's items:

http://www.davestewart.co.uk/temp/combobox.gif

It's supposed to display a border round the entire list, but bizarrely, it's also used for each of the list elements... so effective end result is that the up state has a huge border.

I'm sure this shouldn't be happening. Has anyone else seen this behaviour?

This is my first production job using AS3, and I'm falling at the first hurdle which is very annoying.

Cheers for any help,
Dave

Load Vars Doesn't Want To Load It's Vars
I'm trying to initiate a sendAndLoad operation from a remote movie clip. When the visitor clicks the clip, it triggers a LoadVars object in a different movie clip, and asks it to sendAndLoad. This is the code on the trigger clip:

this.onRelease = function (){
_root.albumHolder.albumLoader.albumName = "album1";
_root.albumHolder.albumLoader.sendAndLoad("readAlbum.php",...);
}

where "albumLoader" is the LoadVars object (already created inside a movie clip called "albumHolder"), and "albumName" is it's only variable.

The LoadVars object is created when the movie loads:

albumLoader = new LoadVars();
albumLoader.albumName = "";
____

What I have done so far:

1. I've used a trace(albumLoader.toString()) to verify that albumLoader indeed has a variable called albumName, and that it's value is "album1";

2. I've used a text box to display that trace value. That was interesting. The output was something like: "%5BType%30Method%5&albumName=album1"

3. I've accounted for all possible variable problems by simply calling the sendAndLoad from the button, and fixing the intial value of albumName to "album1"

4. I've used loadVariables("readAlbum.php?albumName=album1,....); This works, so I know that the paths are right, MySQL daemon is working, etc.

It seems that sendAndLoad either will not send the albumName variable, or it is sending a value that is unrecognizeable.

I HAVENT tried the sendAndLoad operation from the clip where albumLoader resides, but this kind of defeats my purpose as I would like to have different clips in the movie talk to this object at different times. As well, there is another LoadVars object doing a load operation, and it's working fine - I'm pretty sure I'm doing something right.

Thanks for any help - my apologies if the answer is a no-brainer... I'm flying by the seat of my pants with this stuff. Loving it, but feeling like I'm riding Wonder Woman's invisible jet plane - the ground is just WAY to visible, and WAY too far away....

List Box To Control A List Box
hi guys and gals...here is my doubt...

// Sets the change handler for the Component named 'dropDown'.
listBox.setChangeHandler("SelectItem");
}

// This is the Change handler it tells the the movie what to do when someone clicks on an item.
function SelectItem(){
DataBox= listBox.getSelectedItem().data;
}

the above code is for the listbox change handler to display the code of an item whose clicked in the listbox.....heres what i want to do ....i want this item which is clicked to again query the msaccess database and return results from another table into a second listbox......
for eg...when blue is clikced in a listbox1..it should return types of blue in a second listbox2....pls help me to achieve this ......

thanx in advance

Set Vars In 1 SWF From Another SWF
Hi there,

I have 3 swfs on the smae html page. 1 of them has some buttons that change the colours of the interface. I want the buttons to also change the colours of the other swfs. I have used functions and they are all set up quite nicely. I only have to change 1 value to change everything that uses that colour.

But is the best/only way to do this to set the other swfs( without the colour change buttons) to get their colours from a javascript function (or maybe even perl/cgi script) in the html page. That way the colour change buttons would simply change the values in the html page and the other swfs would update themselves as they use those same values.

Am I making sense here?!

Thanks...

Vars
I'll first tell you what my flash movie is supposed to do.

I have an input texf field where the user types a number.
The action script checks the number that has been inserted by the user and:
if var = 1 go to and play next cene frame 1;
if var is different than 1 (number one) is jumps to the second FRAME of the same scene.
I already tried many and many times and it doens't work.
What am I doing wrong????

Vars In A Var
i have a var like so...(in a txt file)

&url=movieplayer.swf?movie=test.swf&height=240&wid th=320

and a button.... loadMovie(url,"target")

how can i get around the multiple "&" signs in a single var string problem??
can i escape them somehow?

S

Vars
What I need is the code to read in vars from the "flash
vars" field (on the client side, it's in the embed code in the HTML) into the sub movies. I also need to know where to put it, and how to call it. I appreciate anyone who can offer any help and thanks in advance.

Vars To Txt
How do you save some variables into a txt file?

Help With Php And Vars
hello,

i've a tiny problem... but for me i'm stucked.
now i get pissed of trien around and wanna some help ! PLZ

my codes are:

PHP

<?

include ('admin/include.inc');

mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");

$msg=mysql_escape_string($msg);
$name=mysql_escape_string($name);
$quote=mysql_escape_string($quote);

$query = "INSERT INTO guestbook (datum, name, email, webseite, kommentar) VALUES ('$push_datum', '$push_name', '$push_email', '$push_webseite', '$push_kommentar')";
$result = mysql_query($query);
$push_status = "Übertragen ...";

?>

FLASH BUTTON SEND

on (release) {
if (input_name eq "") {
push_status = "Namen Bitte";
} else if (input_email eq "") {
push_status = "eMail Bitte";
} else if (input_kommentar eq "") {
push_status = "Nachricht Bitte";
} else {
push_datum = Date();
push_name = input_name;
push_email = input_email;
push_webseite = input_webseite;
push_kommentar = input_kommentar;
push_status = "Sende ...";
loadVariablesNum("send.php", _root.mc_gb.schreiben.status, "POST");
clear_input.call();
}
}

__________________________________________________ __________

my problem is not the DB it runs fine.
my problem is that i would have the variable of my TEXTFIELD get changed by my PHP script.

so if someone goes onto send the status shows SEND...
after that the PHP Script have to change the VAR in RECEIVED...

but it doesn't work... however i've tried a lot of echo, print and vars. but no one reaches my goal...

could anyone HELP me PLZ "!!"

-----------------------EDIT-----------------
i'm trien the tut found here in forum...

Get Vars From Id
HY!

i'd like to get the var from http://www.mySite.html?var=value in the embedded swf. is that possible?

tia

Vars Within MC
I have 4 instances of the same MC on my stage (check1 - check4). In frame 1 of this MC i have the following:
stop();
check == 0;
and a button that (when clicked) goes to the "cmark" frame where check == 1;. Also in "cmark" there's a hotspot button to take the user back to frame 1.

So, on my stage, i have a Check Answer button that needs scripting. As mentioned, there's 4 MCs that the user can check/uncheck. Now, I need a script that says something like this:
on (press) {
if(check1.check == 1 && check2.check == 0 && check3.check == 0 && check4.check == 0){
gotoAndStop("correct");
} else {
gotoAndStop("incorrect");
}
}

I know this is wrong (because it doesn't work) so please advise me on how to get this right. I'm thinking I need a script inside the MC to customize the check variable? TIA my flash brethren.

Help With AS And Vars
Hello all, I don't know if you can read my thread before, because it was a reply of the yesterday one, so I'll try to post it new.

I have this dropdown menu with a scrollbar, the buttons of the menu are called from a .txt and looks like this:

&nItems=89&country1=aediva&&country2=anden&country 3=anclas&country4=andromeda&country5=anubis&countr y6=aula73&country7=babylon&country8=bagus&country9 =barba_roja&country10=barracuda&country11=black_ja ck&country12=bleiz&country13=blonde&country14=blue _cubi&country15=blue_moon ETC

then in my movie everything is working well, but now I want that each variable in the menu (I mean "aediva", "anden", "anclas", etc) link to a movieclip different for each one.

I want to know three things if you can help me:

- how should I write the variables in the.txt if the link is a moviclip and not "letters"???

- In my script I have:

code: bob["menu"+i].textItem.textbox = this["country"+i];

how can I correspond each new variable to the one I already have (country)???

-Do I have to create a new empty movieclip to call the different movieclips for each button, and what's the script for the button??

Sorry about tooo much questions, but is very important to me to solve this out...thanx in advance to all of you!!!!!

Same Swf But Different Vars
im preloading 2 or more (the same) swf's dynamicly but with different xml whitin it.

I want to store a position of the scrollbar whitin it but it will store the same in the other swf....

how can i store unique variables in a swf (which gets loaded 2 or more times)?

thxn already!

[F8] How To Add Several Vars? Help Please
Code:
lvSend.address = friend1.text;
Thats my script.. How do i add several vars here?

Like, i guess: friend1.text, friend2.text etc.

But that didnt work soo...
Help please..

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