ActionScript 2.0 :: Looping Through External Variables?
May 31, 2007
I'm using LoadVars (results_lv below) to load variables from an ASP page, returned as follows: option1=4&option2=5&option3=32&option4=... etc. etc.
There are a different number of "options" returned each time, depending on the query sent to the script. I have access to the number of options ahead of time, but still don't know how to loop through them...
So... How on earth do I loop through these variables?!? Basically I'd be thrilled to be able to do this:
trace(results_lv.option1);
trace(results_lv.option2);
trace(results_lv.option3);
and so on, until they've all been traced.
View 2 Replies
Similar Posts:
Jan 27, 2010
Why doesn't AS2 interpret these variable as it steps through? Everything works if I write it out longhand and do not use a loop, but if I try to condense things by using an array, variables such as _root.myTargets[i]._x are not interpreted properly.
Code:
myTargets = new Array('shoot','shoot2');
for (var i:Number=0; i<myTargets.length; i++) {
if ((_root._xmouse > (_root.myTargets[i]._x - 30)) and
(_root._xmouse < (_root.myTargets[i]._x + 50)) and
[Code]....
View 1 Replies
Sep 3, 2003
I want to do a for loop that grabs values from different variables. This function works nicely without the eval() statement (using the commented line below it) but not with it.
function saveData ()
{
saveUrl = "savedata.php?";
for (count=1; count<=numberOfVariables; count++)
[Code].....
View 14 Replies
May 20, 2009
I have a sliding menu with buttons - each button calls an external swf - which plays in an empty movie clip.Now, I want the current loaded swf to loop till the time the user clicks on another button. The problem is, I do not have the fla files for any of the external swfs (these are screencam recordings using a software that does not publish .fla) - so I can't put a code at the end of each external swf asking it to not stop.
View 5 Replies
Feb 19, 2009
How do I tell my extrnal .flv, which I am calling with the FLVplayback component, to go back to the beginning and play again when it gets to the end?
View 2 Replies
May 20, 2009
What I have is a sliding menu with buttons - each button calls an external swf - which plays in an empty movie clip. Now, I want the current loaded swf to loop till the time the user clicks on another button. The problem is, I do not have the fla files for any of the external swfs (these are screencam recordings using a software that does not publish .fla) - so I can't put a code at the end of each external swf asking it to not stop.
View 5 Replies
Dec 20, 2010
How can I stop my Logo.swf file from looping. Actually the external Logo.swf file doesn't contain any looping code inside it. If I open it in any flash player it animates only one time. Writing "stop();" in code stops all other animations which I don't want.
Code:
var J:Loader=new Loader();
addChild(J);
J.load(new URLRequest("Logo.swf"));
J.x = 275;
J.y = 25;
[code].....
View 1 Replies
Sep 10, 2010
I am trying to loop my external video with flash cs5, I know little about actionscript 3.0 . Haven't be able to get anywhere it uses a component called FLVPlackback. I started off with a flash template that I have tweaked to my needs Here is the .fla file I am adding the video I want to loop the the photos page
View 3 Replies
Apr 19, 2011
I'm building an Air application (straight AS3 no flex) that embeds and displays a .swf file. [code]Not only does this not add the .swf file to the display list like I want it to but it seems to run over and over again. "hello" fills up the output window from the trace statement like it's running every frame.The code loads a .jpg just fine so it must be a problem specific to flash files. I would think I would get some kind of security error if there was a conflict not this strange looping constructor. Does anybody have any ideas what is causing this behavior?So I think what was happening is that because both flash files shared the same application domain and they both had "Main.as" as the main class file it was running the constructor over and over again.I've updated my code above to show my unsuccessful attempts to load the external .swf with a different application domain.
View 1 Replies
Feb 2, 2010
The issue I am running across is this: I encoded and embedded a movie clip to act as the background. There are other animations that can and will loop, as the movie resets itself. But there are some elements that I only want to run once and not repeat once the embedded movie loops (link introductions, where objects fly in and transition into the button). How can I set the one time animations to fire just once, while keeping the embedded animation on a loop?
View 1 Replies
Feb 2, 2010
I am fairly new to Flash and I am constructing a website. The issue I am running across is this: I encoded and embedded a movie clip to act as the background. There are other animations that can and will loop, as the movie resets itself. But there are some elements that I only want to run once and not repeat once the embedded movie loops (link introductions, where objects fly in and transition into the button). How can I set the one time animations to fire just once, while keeping the embedded animation on a loop?
View 1 Replies
Oct 16, 2009
I have created a conversation/script class for a game, but I need help with one little thing. I'm loading the scripts from external XML files, and I want to insert variables like player name, item names etc to the XML, like this.
Code:
<DIALOG SPEAKER="Brian">
<LINE>Are you sure, {playerName}?</LINE>
</DIALOG>
[Code]...
View 3 Replies
Dec 19, 2004
I'm working with Flash MX 2004. I have a funtional monthly calendar that does not use external variables - all variables are contained within the timeline. I am now trying to control it with external variables using:
loadVariablesNum("visualControl.txt",0);
The contents of the text file are:
&InitialMonthVisable=dec&
[code]....
View 3 Replies
Feb 20, 2009
I am trying to control some of the global variables in my script through an external text file.I have a variable called "_global.scrollOrNot", which determines whether I want flash to use the text window with a scroll-bar or the one without a scroll-bar. I am trying to control that through an external text-file called "ScrollCommand.txt". Here is my code:
the external txt states:
&sb1WindowScroll=yes
frame1:
_global.scrollOrNot;
[code]....
this is were I have a problem. It will always choose "MCtextFeldSB1noscroll". I have tested the whole thing with other variables, which were not changed by any LoadVars function and it works just fine then. As soon as I change the variable using the LoadVars function it will not work any more.
View 2 Replies
Feb 4, 2009
I have a flash form. When the send button is pressed, I need to access a php file from another server that sends the email. I need to access the php file like this: [URL], writing the 2 variables, var1 and var2 in the link. I tried like this:
Code:
var sendData:LoadVars = new LoadVars();
link = "[URL]" + value1 + "&var2=" + value2;
sendData.load(link);
This works when I test my file from Flash. But when I upload it to a server, it doesn't work anymore. Why is that?
View 1 Replies
Aug 12, 2009
When loading an external SWF file, can you actually use some of the variables from the loaded SWF file in the parent SWF file?
View 1 Replies
Jan 26, 2004
I had a question about loading external variables. Is it possible to load external variables from a different server other than the one that the flash site is hosted on?And if so, what would that command look like?For instance, if you load a variable from the site's own server it might look like this;loadText.load("TEXT1.txt");Would loading it from a different server look something like this;
View 1 Replies
Jan 29, 2003
Okay i have a problem where I am reading an ASP page into my flash. It works fine when I am reading into the dynamic text fields but when I want to use a variable for something in the actual flash nothing is working.I am reading a Database and everything is working just great, except that there are no more records to read! I have a variable named last which is displayed during the last record set so that i could use it to end the display of the records.I tried setting it up in an if statement...
if (last =="yes")
{
counter = 0;
}
my program pretty much just ignores this statement but when i read the variable last into a dynamic text field on the last record set it will display yes
View 4 Replies
Dec 11, 2007
accesing the movieclips/function/contents of a extenal swf.I used movieclip loader to load the swf.i have two files.. preview.swf and main.swf preview.swf loads an xml and renders its content. the xmlpath is embedded in preview.swf. when i play the file directly, it seems to load the content. however when i load preview.swf into main.swf with a moviecliploader, it does not load or render the xml.i cant even access the functions / variables in the file preview.swf.
View 3 Replies
Jun 23, 2008
I have an MovieClip on Stage with instance name main_mc. I am loading an external game.swf in that main_mc. I want to access variables of root through game.swf. I have used loadMovie() to load the external swf.
View 5 Replies
Jan 13, 2002
I want to load an additional movie into a first one (using loadmovie), and this one has to use variables from an external file (like data from a mysql database or whatever)If I only load the additional swf without the first one everything works fine, but if I try to play the whole thing it ist not.
View 5 Replies
Mar 4, 2011
I have a php page which outputs the following:
DisplayValue=%3cfont+face%3d%27Arial%27+color%3d%2 7%23FFFFFF%27+size%3d%2730%27%3eGambling+Hotline+1
[code].....
View 1 Replies
Mar 2, 2004
WHy o why in the world doesnt this work? I've done this quite a few times at home on my PC, but now I'm on-site with a client who has nothing but Macs. "Sure, no problem" I told my AD, "I can do that...".I'm trying to load variables from an external .txt file into Flash MX and this is the code I'm using:
links = new LoadVars();
links.load("assignLinks.txt");
links.onLoad = function(success){
[code].....
View 10 Replies
Dec 22, 2003
I understanding how to add, multiply, etc. external, standalone numerical variables:
var salBase = new LoadVars();
salBase.Sal = new Number();
salBase.MA = new Number();
[code]....
View 4 Replies
Sep 30, 2004
I have an mp3player that loads an external mp3 file and plays. It works just fine if the url/location is hardcoded in the swf file. However, I need to be able to have the url passed to the flash externally so that a number of users may utilize this single swf build.
Example:
Current location need to be filename.mp3 or [URL]. However, I need this location to be edited per use of the swf. In php i know I could call it such as:
$myLocation = "123";
[URL]
or
$myLocation = "[URL]";
(The "123" is what changes for each page use)
Here is the code i have that is working just fine. Until I need to use a full url that changes for each page the swf is use on.
onClipEvent (load) {
if (playing!=true) {
playing=true;
soundIsLoaded=1
myMusic=new Sound();
myMusic.loadSound("myMusic.mp3",true)
}}
Limitations:
1. Because of the server set up, I am always required to call items using full absolute urls/paths.
2. php, cfm, xml etc are not available for use with this. -- the goal is to be able to give an webmaster a copy of the swf and the code to embed it on their html page... and that's it.
View 7 Replies
Aug 14, 2009
I have a class to load some XML and build the data into an array but I can't get the timeline to see the array. [code]...
View 4 Replies
Jul 2, 2010
I'm trying to debug my movie, but the variables in the debugger are greyed out and I can't expand them. It also doesn't show the progress through the code. I think it's related to having loaded an external swf.
View 1 Replies
Jan 23, 2011
How to load variables from an external source? For example, Lets say I have a movieclip that contains 6 keyframes, and I want flash to load the proper keyframe when the main swf is opened. Flash knows what the proper keyframe is, because that variable is stored in a MySQL database, or txt file, or xml file, or whatever. Also, how could i have flash write to an external file, so that i can save the changes.
View 2 Replies
Apr 1, 2012
I have created a loader class that retrieves variables from an external text file. I call the loader class and all works well but I cannot figure out how to retrieve and use the variables in the Main class.
[Code]...
View 3 Replies
Dec 10, 2007
My flash project is structured as follows, with the nested external swfs being loaded to clip holders using loadMovie():
home.swf
|--sponsors.swf
|--educators.swf
In home.swf, I've defined a text box with instance name contentWindow_txt, and assigned its path to _root.cw_txt. Now, when I type the following anywhere in home.swf:
Code:
_root.cw_txt.htmlText = "testing!";
The dynamic text box contentWindow_txt will display "testing!" when the swf loads. Unfortunately, when I make the same call in sponsors.swf, I get nothing. Is there something about external swfs or variable inheritance I don't know?
View 9 Replies