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




Looping Variables



I have 10 variables located on the first frame on the first layer. I also have an include statement for an .AS file. I am coding a "for" loop to display the text inside a textfield inside a movieclip.

text1="text1";
text2="text2";
text3="text3";
text4="text4";
text5="text5";
text6="text6";
text7="text7";
text8="text8";
text9="text9";
text10="text10";
#include "actionscript.as"


//File name: actionscript.as
var i;
for(i = 1; i <= 10; i++){
var text_mc:Object = "text" + i + "_mc";
var text_txt:Object = "text" + i + "_txt";
var textText:Object = text[i];
var text_mc:MovieClip = this.createEmptyMovieClip(text_mc, _root.getNextHighestDepth());
text_mc._x = 10;
text_mc._y = 10 + (i * 20);
var text_txt:TextField = text_mc.createTextField(text_txt, 1, 0, 0, 515, 50);
text_txt.wordWrap = true;
text_txt.autoSize = true;
text_txt.multiline = true;
text_txt.background = true;
text_txt.backgroundColor = 0xff0000;
text_txt.text = textText;
}



I have successfully created the multiple textfield and movieclips, but I am having trouble getting the text into the loop. The best I get is "undefined". I know it has to be the variable calling for text[i], just can't figure it out.




View Complete Forum Thread with Replies

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

Looping Over ASP Variables
I am trying to pull in Images dynamically with the Loader Component in conjunction with the pBar Component as well.

Here is my code:


Code:
myData = new LoadVars()
myData.load("loadvars.asp")
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
this.ref["imageLoader"+i].autoLoad = false;
this.ref["imageLoader"+i].contentPath = this["image"+i];
this.ref["pBar"+i].source = ["imageLoader"+i];
this.ref["imageLoader"+i].load();

}
} else trace("Error loading data")
}


for some reason is just isnt working with the [+i] for using multiple instances of a movie clip.

i can get it to work with the following code:


Code:
myData = new LoadVars()
myData.load("loadvars.asp")
myData.onLoad = function(succes){
if(succes){
imageLoader0.autoLoad = false;
imageLoader0.contentPath = this.image0;
pBar0.source = imageLoader0;
imageLoader0.load();

imageLoader1.autoLoad = false;
imageLoader1.contentPath = this.image1;
pBar1.source = imageLoader1;
imageLoader1.load();
} else trace("Error loading data")
}


but this is silly to do it this way. any help is appreciated!

peace.

Looping Variables
OK, I did a search on this and couldn't really find anything that I could use. My problem is with my for loop. I'm displaying a list of games from and XML file. Tracing the loop goes fine, I assume that my text boxes must be replacing each other because the 'last' set gets displayed.

Also, if I take the loop out and manually copy/paste the code a couple of times it works (spacing out the text boxes too).

I've tried several ways to increment the variable names, often times getting script errors though. So basically.. I'm at a wall. Using Flash MX Pro 2004.

Any help would be appreciated.


Code:
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = myFunction;
myXML.load("NFL_LIVE.xml");
function myFunction(success:Boolean):Void {
if (success) {
var numGames = myXML.firstChild.firstChild.childNodes[3].childNodes.length;
trace("numGames: "+numGames);
var level = 1;
var textPosition = 20;
for (i=0; i<numGames; i++) {
trace(textPosition);
trace(level);
_root.createTextField("visitingTeam", level, 5, textPosition, 60, 20);
visitingTeam.text = myXML.firstChild.firstChild.childNodes[3].childNodes[i].childNodes[7].firstChild.attributes["alias"];
trace(myXML.firstChild.firstChild.childNodes[3].childNodes[i].childNodes[7].firstChild.attributes["alias"]);
visitingTeam.border = true;
visitingTeam.background = true;
_root.createTextField("homeTeam", level+1, 5, textPosition+20, 60, 20);
homeTeam.text = myXML.firstChild.firstChild.childNodes[3].childNodes[i].childNodes[8].firstChild.attributes["alias"];
trace(myXML.firstChild.firstChild.childNodes[3].childNodes[i].childNodes[8].firstChild.attributes["alias"]);
homeTeam.border = true;
homeTeam.background = true;
var level = level+2;
var textPosition = textPosition+40;
}
} else {
//display error
}
}

Looping Using Variables
Hi.
My problem is this: I want to use an array to loop through movieClip instances and get their positions on stage.
Why doesn't this work?

aMovieClips:Array = new Array("movie1","movie2");

for (i:Number=0; i<aMovieClips.length; i++) {
trace(aMovieClips._x);
}

Could anyone help me with this I sure would be grateful.

Regards

Thord Linde

Looping, Variables, Tell Target...
I've had one problem sorted out (thanks Tony!) but I have run into sticky water again. This loop goes through and goes to a specific frame, names "road" in 131 movie clips, named "g1", "g2" all to "g131":


Code:
Set Variable: i = 1
Loop While (i <= 131)
Set Variable: "i" = i+1
Begin Tell Target ("/g" & i)
Go to and Stop ("road")
End Tell Target
End Loop


I would now like this to change so that instead of going to "road", the frame label is dynamic. In the main timeline I have 131 variables loaded in, named "g1", "g2" etc which correspond to the movie clip of the same name. The value for each of these variables is a valid frame label name within the 131 movie clips.

CHanging the "Go to and Stop" line in the code above, how can I make it go to and stop on the frame eq the value of the variable with the same name?!

I tried it like this, but it didn't work:


Code:
Set Variable: i = 1
Loop While (i <= 131)
Set Variable: "i" = i+1
Begin Tell Target ("/g" & i)
Go to and Stop ("g" & i)
End Tell Target
End Loop


I've also fiddled with the line as being


Code:
Go to and Stop ("_level0:g" & i)


But that does not work either.

Any help, please?
Thanks!!

Looping With Inserted Variables
I have a heap of lines like:

_root.Grid.s1.gotoAndStop(4);

and I'm wanting to loop through the same line like 30-40 times only changing the 's01' part through a variable ie

for(x=1;x<=30;x++) {
_root.Grid.s[x].gotoAndStop(4);
}

any help?

[Flash MX on Mac]

Looping Through External Variables [AS 2]
Hey peeps,
I'm going bananas over here! Please help!
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.

Thanks in advance to anyone who can help me.
Steve

Looping External Variables
I have a dynamic external .cfm file with some variables. It outputs a lay out like this:
&news1=this is the first news story&news2=this is the second news story&news3=this is the third news story&news4=this is the fourth news story&EOF=true

I want to load each of these variables into a dynamic text field in my flash file.. However, I want it done intermittently i.e. add news1 wait 10 or so seconds and then append news2 etc. etc.

The other factor I have to consider is that the number of variables is not fixed i.e. sometimes I may have 4 news stories other times 10

What would be the best method to go about doing this?

Looping Variables Out Of Flash To Asp
i'm having a problem sending data out of flash through a loop.  there're several arrays that i need to scope through and retrieve in asp, and i can't seem to send in a loop (or retrieve in asp in a loop were the truth known! but that's less of a problem). here's the code which pixl8r helped me with a few days ago:

CODEfunction sendGameInfo(){
    loadInfo= new LoadVars();
    loadInfo.records = 11
    looper = 0;
    for (looper=0; looper<11; looper++) {
        v1 = eval("loadInfo.bat"+looper);
        v1 = batpos[looper];
        v2 = eval("loadInfo.batruns"+looper);
        v2 = batruns[looper];
        trace(v1+" "+v2);
    }
        /*loadInfo.bat0 = batpos[0];
        loadInfo.bat1 = batpos[1];
        loadInfo.bat2 = batpos[2];
        loadInfo.bat3 = batpos[3];
        loadInfo.batruns0 = batruns[0];
        loadInfo.batruns1 = batruns[1];
        loadInfo.batruns2 = batruns[2];
        loadInfo.batruns3 = batruns[3];
        */
    
    loadInfo.onLoad=function(success){
        if (success) {
            trace("the value returned from ASP is " + loadInfo.returnValue);
        }else{
            trace("there was an error " + loadInfo.returnValue);
        }
    }
    loadInfo.sendAndLoad("http://localhost/senddata.asp", loadInfo,"POST");
}

Setting Variables Within A Looping Mc
I have a movie clip which is constantly looping from the first key frame to the second, I want to set variables in this key frame from the timeline. Because the movie is looping, the variables are constantly being reset (the first key frame has: variables = ""). Is there a way I can create a new variable within a movie clip from the main time line? (doing this, I won't have to put in variables = "" and thus no reset will occur). Or is there a different way of doing this?

Looping Arrays & Variables In Same Frame
Hello,

I am editing a multi-column list that is placed into Flash and the variables are loaded from ColdFusion.

Due to the number of items I have, I want to place 10 names on a page and then click a button that will show me the next 10 names and so on.

I have the code so now it only shows 10, but when I click the button the loop seems to start over.

Here is my code:

Frame 1

loadVariablesNum ("variables1.cfm", 0);
i = 0;
screenno = 1;
depth = 0;
pageno=0;

Frame 2

stop ();
_root.next_button._visible = false;
// split up the array by looking for the commas
if (depth < 1) {
Name_array = Name_list.split(",");
Age_array = Age_list.split(",");
// depth
depth = 1;
}
// hide the origional clips
Name._visible = 0;
Age._visible = 0;
// get the length of the array
Name_length = Name_array.length;
Age_length = Age_array.length;
// set the start y position (x position depends on where you put it on the screen)
yposition = 38;
// set i
// looping everything
for (i=i; i<screenno*10; i+1) {
// Name
duplicateMovieClip (Name, "Name" add i, depth);
setProperty ("Name" add i, _y, yposition);
// Name.Name = Name_array[1];
set ("Name" add i add ".info", Name_array[i]);
depth++;
// Age
duplicateMovieClip (Age, "Age" add i, depth);
setProperty ("Age" add i, _y, yposition);
// Age.Age = Age_array[1];
set ("Age" add i add ".info", Age_array[i]);
depth++;
// Set the y position plus 30
yposition = yposition+30;
var i = i+1;
}
if (Name_length>screenno*10) {
_root.next_button._visible = true;
}

Button action

on (release) {
with (_root) {
gotoAndPlay (2);
var screenno=screenno+1;
var pageno=pageno+1;
}
}

Create Variables By Looping Thru An Array
I am using this to generate some variables to pass to a backend script:

Code:
//this is the hard coded version that works
function go() {
a0 = _parent.m****ay[0]["name"] + "_" + _parent.m****ay[0]["count"];
a1 = _parent.m****ay[1]["name"] + "_" + _parent.m****ay[1]["count"];
a2 = _parent.m****ay[2]["name"] + "_" + _parent.m****ay[2]["count"];
a3 = _parent.m****ay[3]["name"] + "_" + _parent.m****ay[3]["count"];
a4 = _parent.m****ay[4]["name"] + "_" + _parent.m****ay[4]["count"];
a5 = _parent.m****ay[5]["name"] + "_" + _parent.m****ay[5]["count"];
getURL("http://localhost/update.asp", "", "POST");
}

//this is the loop I am using to be more efficient
function go() {
for (n=0; n<_parent.m****ay.length; n++) {
"a"+n = _parent.m****ay[n][""name""] + "_" + _parent.m****ay[n][""count""];
}
getURL("http://localhost/update.asp", "", "POST");
}
I've been messing around with the quotes, but this is my error:
Left side of assignment operator must be variable or property.
"a"+n = _parent.m****ay[n][""name""] + "_" + _parent.m****ay[n][""count""];

p.s. whats with the ****'s

Variables From A Text File; Looping Vs. Go To
I've read a few of the tutorials that deal with reading variables from a text file. My problem is that in the ones i've read, it is always recommended to go to and play a particular frame (and then another and another perhaps), which will then check to see if all the variables have been loaded before proceeding to use them. I am new to flash, but experienced with director and lingo. I am a huge fan of sticking to one frame and having all the 'action' occur there through scripts. So attempting to load files, i run a loop to check for the final variable of my file, but unfortunately this loop slows flash and eventually freezes the program before uncovering any variables. Is there no other way but to use 'go to' in checking for my variables?

~julia using flashmx

Looping Question-variables, Conditions?
hi, this may have been awnsered a thousand times, but the search came up empty.
I did a banner on a timeline. All i need it to do is to play the timeline twice and then stop. how can i do this?
i have looked in every book writen about flash and no book tells you how to do it. instead they talk about the 3 different looping variables and stuff that i dont know.
please help a newbie out
thanx

FlashMX: Setting Variables, Looping And Sound
Hi all - new to the board!
We are trying to enable a little flash app that will display words to a chant in synch and allow users to select to listen to this chant once or to repeat it multiple times. I had the loop function mostly working in Flash 5, and synched by hand, but now it isn't synching nor is it looping!

hehe love that emoticon

Anyway, here's my code:

Frame 1:

Quote:




stop();






Frame 2:

Quote:




play();






Frame 1590:

Quote:





if (learn="true") {
gotoAndPlay("Om_Swasti");
} else if (learn="false") {
gotoAndStop("Stopped");
}






Button values:

Click to Play:

Quote:




on (release) {
set (learn,'false');
gotoAndPlay ("Play");
}






Loop:

Quote:




on (release) {
set (learn,'true');
gotoAndPlay ("Play");
}






Stop button - which appears only after Frame2:

Quote:





on (release) {
stopAllSounds();
gotoAndStop(1);
learn="false"
}






By the way, I've named frames "Stopped," "Play," and "Om_Swasti."

I have audio set to stream so that the words will stay in synch. Each text phrase is on the same layer, divided out by keyframes. Text isn't dynamic.

I was thinking to pull in the MP3 as an outside file, but then how to keep in synch with the narration.

I've done all kinds of things like change the syntax of how I'm setting the variables. Stuck, stuck, stuck. Any help greatly appreciated.

Edit: I forgot! The current state of this app can be viewed here:

http://www.palyul.org/eng_hh_longlife.htm

Yep, long load there. Gotta figure that out too - but first thing's first!

Looping Over Private Variables In Document Class
I want to 'reset' all my private vars in my document class, basically set them all to null. Is there a built-in method to loop over them? If not, is there a way to do this?

Thanks.

Looping Over Dynamic Variables And Creating Dynamic Mcs
Hello. I have a flash app I'm working on where I'm loading in content from an xml file, then dynamically creating mcs to create an mc for each item in the xml results. Then loading images in to the mcs.

If I don't do a loop and just do it manually, repeating every command but just changing the name of the mcs and variables.. it works.

But when I try to loop over it, its not displaying the mcs. I get no error message. And I've stepped through the code and can't see where its going wrong.

Below is the as for the looping movie that isn't working. If you need me to I can post the as for the non-looping movie if it would help see what I'm doing wrong.


Code:
//---------------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;

for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}

firstImage();

} else {
content = "file not loaded!";
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("fplayer_data.xml");
/////////////////////////////////////

p = 0;
dCounter = 1;
this.onEnterFrame = function() {

for(i=0; i < 4; i++) {
picture0.duplicateMovieClip("picture" + dCounter, dCounter);
this[picture + dCounter]._x = this[picture + i]._x + 55;

filesize = picture0.getBytesTotal();
loaded = picture0.getBytesLoaded();
preloader._visible = true;

if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (this[picture add i]._alpha<100) {
this[picture add i]._alpha += 10;
}
}
dCounter++;
}

};

function firstImage() {

for(j=0; j < 4; j++) {
if (loaded == filesize) {
this[picture add j]._alpha = 0;
this[picture add j].loadMovie(image[j], 1);
this[desc_txt add j].text = description[j];
}
}


}

Looping Sound And Looping Animation Sync
I'm working on a navagation interface for a new site, and I'm running into a few issues.

1) when you click on a button, it activiates an MC. within that MC, the first frame is the initial "off" state, and clicking on a button triggers the rest of the clip to play, from frame 2. I have a sound that starts in frame 2, and I set up an animation of a VU meter that is supposed to be synced very closely to the music. In the last frame of the MC is an action, gotoandplay, that sends it back to frame 2. The idea here is that once the button is pressed, the music loops and the animation loops with it.

When I test the movie, do a publish preview, or view the swf file in the flash player, the animation seems to be synced to the music for the first few times it loops, but then the animation drifts ahead of the music, getting progressively further out of sync with each loop. The other real problem here, is that when viewing the swf in any web browser, the animation is immediately behind the music, and seems to be running much slower than it should.

you can see the swf here:

http://www.lsrdigital.com/flash/index.html

Does anyone have any ideas about how to get this to work the way I am trying to get it to?

the .fla file is here if you want to look at it as well:

http://www.lsrdigital.com/flash/LSR.fla

2) The other problem I'm having is that the stage is set to be 680 pixels wide, and the graphic that fills the background is 680 pixels wide, BUT Flash MX publishes the movie at only 679 pixels wide! You can see the line of white pixels on the right side of the movie here:

http://www.lsrdigital.com/flash/index.html

I've double checked the html file and the table cell holding the movie element is 680 pixels wide. You can also tell that Flash is cutting off the last column of pixels because the background image is visibly just missing the edge to the right of the screws.

Any ideas on that one?

Looping External Mp3 Not Looping Perfectly
Hi there

I have a looping external mp3 file playing in the background of my flash (Flash MX 2004) movie.

Unfortunately it does not loop perfectly even though I know the mp3 file loops perfectly in sound editing programs.

There seems to be a slight delay.

Here is my code

function Play_Background_Audio() {
myMusic.loadSound(audioFile,true);

myMusic.onSoundComplete = function() {
myMusic.loadSound(audioFile,true);
};

};

audioFile = "home.mp3";
myMusic = new Sound(myMusicMc);
Play_Background_Audio();

Any help would be much appreciated.

Thanks

Paul

Looping & Non-looping Components In Same Movie
I'm new to using Flash MX, and would be grateful if someone could give me some advice for this animation I'm trying to do.

I'm making a banner for a website that is being designed by someone else. The background consists of four photos that fade in and out continuously (I think "looping" is the correct term) as soon as the animation (movie?) opens up. That part wasn't too hard!

However, the client wants a name (in white text) to gradually fade in on top of the looping background, and stay visible and static for as long as the looping animation plays. As well, after the white name fades in and becomes static, she needs another name (in gold text) to gradually appear and start fading in and out below it.

So the sequence is:
- Looping background begins to play.
- The name (in white text) gradually fades in (say at around frame 50) and stays visible (alpha at 100%) while the background is looping.
- Around frame 100 a second name (in gold text) fades in and then starts fading in and out continuously in synch with the looping background.

I can't figure out how to do this. Do I need multiple time lines? Or triggers in various frames? Or different scenes?

I have a sinking feeling that I'm going to have to use Actionscript for this, and although I'm perfectly willing to learn, I haven't a clue where to start. Could anyone help, please?

Music Looping And Looping And.....
Hi all, thanks for taking a look at this.
I have made an Audio off/on button which I have added to the main scene, it has 2 frames, first one with the stop(); script and the second frame with
stop();
stopAllSounds();
but when i am navagating through the main scene the music loops onto itself till u end up with a god awful noise.

Help?!!



btw, I am using flash MX

EXTREMELY URGENT - Creating Global Variables Using Names Of Other Variables...
I have variables xtile and y tile within a movie, and I need to create a global variable that will tell all other movies that this particular movie is situated on tile [xtile][ytile], so I need to know how to create the global variable: _root.objectmovie_xpos_xtile_ypos_ytile = true;

I know how to create global variables, and how to have other movies read them, but how do I actually create a VARIABLE with this name? I tried set ("_root.objectmovie_xpos_" + xtile + "_ypos_" + ytile") = true, but that doesn't work (which I kinda knew already but thought I would give it a shot)
any ideas peeps?
please help, its vital to a project I am doing

cheers all

My Variables Load With LoadVars...how Do I Execute A Loop To Assign Variables?
I have 52 (one for each week) duplicated MCs, a loadVars(), and variables "sermonTitle" and "airDate," which I'm trying to assign with the following:

this.airDate=_root.loadContent["airDate" + sermonDate];
this.sermonTitle=_root.loadContent["sermonTitle" + sermonDate];

which is placed in an onClipEvent (enterFrame) handler of the button which is duped . The vars load when I click Video > 2001.

The vars loaded have values named sermonTitle1, sermonTitle2, etc. and the same for airDate. The numbers attached reference the sermonDate which has already been assigned though my duplicateMovieclip loop:

num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
trace(this["b"+n].sermonDate);
n = n + 1;
}

I've tried attaching the assign code to the dupMovieClip loop:

num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
this["b"+n].airDate = "airDate" + n;
this["b"+n].sermonTitle = "sermonTitle" + n;
trace(this["b"+n].sermonDate);
n = n + 1;
}
setProperty("b", _visible, 0);

and it works - as far as assigning the correct value to the correct button, but it does not associate the loaded vars with them.

The SWF is VERY sluggish, though, which makes me think the onclipEvent is not the best way of assigning vars. I get the trace(this) showing all of the variables loading, so I know that's not the problem.


Does anyone know how to best assign these? I have been advised to use a loop for it. How would I go about executing a loop for this, as I will have navs loading in different text files - Thanks

Link to SWF:
HERE

Virtual Student Yrbook: Variables>Arrays>Variables? SOMEBODY RESCUE ME
Hello, All.

I am totally stumped. I am creating a student virtual yearbook, which displays students names with pictures. I cant find a totally understandable tutorial that teaches me how to extract variables from an array. So I created an asp file that writes out all of the student records to different variable names, and load them using loadvariablesnum(). Using this ASP file works, but once I click the exit button to take me back to the front page, it is as if all of my other variables are erased.

I dont completely understand levels when it comes to loading variables, so everything is loaded like this

loadVariablesNum("http://10.0.1.2/tp/tpod/processGet_studentInfo.asp", 0, "GET"); --- "POST" gives me the same results...

To view the pictures you would click a button on SCENE 4, and it takes you to "VIEW STUDENTS PICTURES" - SCENE 11. 'EXIT' sends you back up to Scene 4, which runs an ASP file which simply grabs a message that is updated every 30 minutes. What Level would I use here??? I have tried many.

Everything works beautifully until I exit the VIEW STUDENTS PICTURES page from Scene11

I've written a pretty sizeable file that uses lots of variables.

I am pretty sure that the problem is with the ASP file: "processGet_studentInfo.asp" - because when I comment it out, the application works fine.

::::::::::::SUPPORTING INFO BELOW:::::::::::::::

Here are the variables that "processGet_studentInfo.asp" creates:
&varStudent1=Crystal&varImagePath1=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCrystal%2Ej pg&varStudent2=Brandy&varImagePath2=http%3A%2F%2F1 0%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrandy%2Ej pg&varStudent3=Angel&varImagePath3=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAngel%2Ejpg &varStudent4=Cathy&varImagePath4=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCathy%2Ejpg&v arStudent5=Destiny&varImagePath5=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FDestiny%2Ejpg &varStudent6=Amber&varImagePath6=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAmber%2Ejpg&v arStudent7=lester&varImagePath7=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Flester%2Ejpg&v arStudent8=paul&varImagePath8=http%3A%2F%2F10%2E0% 2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fpaul%2Ejpg&varSt udent9=Ginger&varImagePath9=http%3A%2F%2F10%2E0%2E 1%2E2%2Ftp%2Ftschool%2Fimages%2FGinger%2Ejpg&varSt udent10=Brittany&varImagePath10=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrittany%2Ejpg &varStudent11=chad&varImagePath11=http%3A%2F%2F10% 2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fchad%2Ejpg&v arStudent12=jaden&varImagePath12=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fjaden%2Ejpg&v arStudent13=Jami+Lynn&varImagePath13=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJami+Lynn %2Ejpg&varStudent14=kara&varImagePath14=http%3A%2F %2F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fkara%2 Ejpg&varStudent15=Cody&varImagePath15=http%3A%2F%2 F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCody%2Ej pg&varStudent16=darla&varImagePath16=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fdarla%2Ej pg&varStudent17=Jenna&varImagePath17=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJenna%2Ej pg&varStudentCount=17&varENDER=1

-----------------------------------------------------------

Here is the meat & potatoes of the ASP file that created this:
oRS.Open "SELECT * FROM STUDENTS", oConn, 2, 3

' Move to the first record
oRS.MoveFirst

'Loop to output all the query results to the document
do while not oRS.eof

' counter to give each record a sequential listing
counter=counter+1

Response.Write "&varstudentname" & counter & "=" & Server.URLEncode(oRS("studentname"))& "&varImagePath"& counter & "=" & Server.URLEncode(oRS("ImagePath"))

' move to the next record
oRS.movenext
loop

'LET FLASH KNOW THAT WE ARE DONE RETRIEVING
Response.Write "&varStudentCount=" & counter
Response.Write "&varENDER=finished"
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::

Please help.

Loading Variables From Text File. ( Not Fixed Variables )
i would like to know how to make my Flash werbby load variables like this automatically everytime i load my flash webby

(this is contained inside a text file) example:

&news[15462]=hello&
&news[14890]=uuuuuuuuuuuh :P&

but i won't be using fixed numbers. these numbers will be randonmize. but how do i tell my textfield to load allll variables that contain the word "news" and a value (number) ? or is there any other ways of doing this?
[Edited by xanbarian on 07-08-2002 at 12:56 AM]

Assigning Dynamic Text File Variables To Variables
Ok so I know exactly how to load variables from a text file and catching these variables in a dynamic textbox to show there string content. But I wanted to work with the string in the passed variable (ie from txt file) BEFORE I display the text in the dymnic text box. I seem to be having trouble assigning the passed .txt file variable to a newly created variable in my movie, it keeps saying "Undefined" when I run a trace().

<code>
//The contents of the text file looks like this
&textxxx=This is the text withing the text variabale

//1st frame, layer 2 in main
loadVariables("text.txt", _root)

//1st frame, layer 1 (below layer 2)
_root.strText = _root.textxxx

</code>

->So why does it say strText "Undefined" !? Does flash not allow variables to be assigned to variables?

If you help that would be fantastic

Return Variables From Php To Load In Flash Text Variables
Im having an issue using the kirupa flash login. I already have the actual login working with php and mysql but i need to change it up a little bit and i don't know enough about php to write it myself. But here's the situation.

Flash login is a basic script, I've already modified this part and it works great

What I need to know is how to modify it so when a user logs in, php captures the $_POST and returns the alternate variable fields that consist of ("co","fname","lname","cph","email") within the ID for user and pass

also i have already made a common loadMovie to load random variables i just need the php to point to the movie

Targeting Variables Or Loading Variables In An Array
Ok I need some help
I want to make an drop box button so I can just give it a name and load the variables onto the _root stage and then it will work. So I can make one and copy it to function differently. I also have made a loop that only creates a certain number of boxes depending on the number of entries.

So I have the dropbox,'fruit' and then the loaded variables
eg. _root.fruit1vari = apple, _root.fruit2vari = pear, _root.fruit3vari = tomato
(they're loaded into the level above so I don't need 20 different load variables for one page with 20 dropboxes.


so I want the first box which is a symbol made of a text field and a button to load the fruit1var. This symbol is copied for each drop box but upon creation is assigned a simple id of n = 1

I've tried making the variable link,

buttontext = _root.fruit add n add vari

or
thisclipaddress = getProperty(this, _target)
varaddress = thisclipaddress add n vari
buttontext = varaddress

the lines go together ok but the debugger and text feild shows the whole address line not the variable contained at that address.

Thanks if anyone can help
Caspa

P.S. All of this is eventually part of a database if there are any good tutorials out there please mention them. I haven't found any just yet and I'm getting desperate. Or even an explanation on how to get a cgi script to convert the data flash sends it into an SQL query.

Comparing Variables To Variables In A Text File
I am trying to make a login in flash and I would like to have a txt file with user names and one with passwords or have one file with both. When they click submit it will see if the user name and password they entered are in the text file if they are it will do one thing and if they are not it does another.

Split Variables Multiple Times Into Different Variables
say you have the string: "tilisamazing" - how would you split that into
var 1 = til;
var 2 = is;
var 3 = amazing;

i know you can do this with substr, but what if you dont know the starting and finishing points???
i have seen people split a variable with a comma... how would u do that for this?

Pulling URL / Get Variables OR Environment Variables
If I have a flash file being called from index.html with GET variables at the end ( index.html?next=nextfile.html ) how can I have flash ( i'm using flash mx ) parse these variables so I can use them?

Or is there a better way to pass it variables, maybe in the <param> tag?

I have a basic swf that needs to have a back and next. My back will be a javascript history back button, and my next needs to read a URL from _somewhere_... The easiest way for me would be to pass it in the url, or in a <param> tag.

Thank you, in advance, for your gracious help!

Have a great week.

Adding Variables To Variables In An If Statement
I have a variable named 'Position' which is collecting numbers from various positions, and changeing = 1,2,3 etc.

I want to add 'Position' with its value to other variables:
Sentence, SentenceAnswer ets as seen below.

I have tried as you can see, but it does not work, can anybofy help.

function CheckAnswer(){
if (Sentence+'Position'==SentenceAnswer+'Position'){
_root.Feedback+'Position'=Sentence+'Position'+Corr ect;

}



Cheers

lee

Help: Passing Variables (180 Variables) To Function
hi

if i have call function like this

Math.findMax(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10, app11);

but the values i have to app180

i don't want to write all this

Math.findMax(app1, ... , app180); //!!??

how i can to called the function from app1 to app180

Math.findMax(FROMapp1, ... , TOapp180);

thanx

Variables Holding Variables For ASP - Here's The File. HELP
Hey ALL,

I've created a real simple file to use as testing and have included it here. The basic idea is this.....

The green button in this file upon user click will assign the first variable [send_lv.param1] to be passed to an asp file as [active].

on(release) {
send_lv.param1 = active;
}

The second "red" button will assign a variable [stepVar] to equal "red" and then also trigger the function "yep" to execute.

on(release) {
stepVar = "red";
yep();
}


Yep simply makes [active] = [stepVar] with a trace for testing.


var myUrl_str:String = "mypage.aspx";
var send_lv:LoadVars = new LoadVars();
var load_lv:LoadVars = new LoadVars();
load_lv.onLoad = function(success:Boolean) {
if (success) {
// sendAndLoad processed successfully!
} else {
// sendAndLoad had an error
}
};

//send_lv.sendAndLoad(myUrl, load_lv, "POST");
function yep() {
active = stepVar;
trace(send_lv.toString());
}



The idea being there would be more than just "red" and a string of variables could be made active with more than one "green" button. I would than pass the whole string to an asp file that would accept them.

Thing is, this seems to work if the user clicks the sequence twice. Open the file test it by clicking the green button and then the red. The trace will come up empty the first time but will be correct if you click the green and then red the second.

Any help would be fantastic!!!!

Thanks
-jub-

Declare Variables AS2 Verses Variables AS3
Hello,
I am fairly familiar with Flash, however, I have just recently taken a class in ActionScript 2 as I had no experience whatsoever working with ActionScript. I now have a basic knowledge of how it works, however, I have Flash CS3 and so when I have tried declaring a variable with code like I learned from AS2, it doesn't work. I have perused through the "variables" section of AS forum files and have yet to figure it out. Is there something else that I need to add to the code? I realize you can still write AS2 code in CS3 but I'd like to learn AS3 as well.

For example...an instance of Circle called mcCircle1 is on the stage. So in my code, I write:

var mcCircle1:MovieClip;

When I trace mcCircle1 this is the error message that comes up in the "Compiler Errors":

1151: A conflict exists with definition mcCircle1 in namespace internal.

Am I just missing something simple here?? I'm confused... :$

Thanks,
Terri

Load Variables, Remembering Variables
I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.

While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.

How do I that? Isn't AS3 wonderful? :(

John







Attach Code

var urlRequest:URLRequest=new URLRequest("index.as3.txt");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);

var sspColourBG;

function urlLoader_complete(evt:Event) {
trace("During: " + urlLoader.data.extColourBG); // returns correct value
}

trace("After: " + sspColourBG); // returns undefined

LOOPING MC.....
Hey Guys,

I was wondering what the actionscript was to loop a MC..

for example i have a MC half way through my flash movie and wanting to loop it 3 times...

If anyone can help me out it would be a great help

Cheers
mdesign

Looping ?
Hello evry one, first time here

I hope i am in the good section

I am really unable to figure out how to do looping action

What i'm am trying to do is a scrolling text field that begin to scroll with a button mouse over and stop scrolling at mouse out or at maxscroll

can anyone help me??????????6
pleeeease

HELP On LOOPING
Hey Thanks for Readin this,

Im done making my 1st flash item and it displays fine in the test view but when I upload it and test it on the REAL internet, as soon as it's done it starts all over. How do i prevent this from happening? Thanks
CJ

Looping...
I want to be able to loop only a certain object within my movie. I want everything else to remain static while a couple words fade in and out. Thanx for the help.

Chase

Looping
I am useing swish. I wont to stop the looping. I unchecked the loop ,but in the browser it's still looping. This is what I have done. [I made a line ,I used the move effect Y postion - move up by 123 ,and x angle - rotate ccw by 180. this is good for me ,but I can not stop the loop. can you help.


Thank You
leecs2northrock.bm

Looping
Does or anyone did have a problem with looping? I turned off the loop and saved it then when I tried it in my browser(ie 5) it would keep looping.... any quick suggestions or is this a bug with swish?

Thank in advance...

Looping
Ok, Obviously since I am in here I must be pretty new at this so just bare with me because I have a few questions.
1. How can I make a movie clip in one layer loop continously without looping the rest of the movie?

2. Why is it that when I preview my site in a browser everything is so much bigger? Do I have to make my movie that small to get it to fit in a browser?

3. What is the standard size width for a web browser? The height I'm not concerned with because the user can scroll down?

4. And last (for now) Is there any way to make a standard type frame using Flash 5? Just so that I might keep things seperated on my page.

Thank you

Brian.

Looping
I have an animation consisting of a few seperate movie clips.
I need it to loop 3 or 4 times and I want to do it using actionscript. Does anybody know how?

Looping
I'm trying to get some understanding here.

amount = 10;
while (amount>0) {
duplicateMovieClip("mc", "mc"+counter, amount);
amount = amount-1;
}
stop();

Why would you need to take away 1 (or whatever) from amount??
If I don't have that command, flash crashes.

Please, help me.

Thanks

Looping A MC
I have a Movie and I want it to play to frame 18 then loop back to frame 16, eight (8) times

Is this possible If you could give me some insight I feel very dumb right now, (it seem that it would be really easy to do but I can't do it?)

Looping
How do I prevent my flash from looping?

Also I tried making my flash automatically jump to my url but it does not work. I right clicked in my last frame and chose action - go to URL - am I missing something?

Looping Through Different MCs?
Hi everyone. I'm trying to make a movie clip that acts the following way, and I'm pretty stuck:

I'd like the movie clip, call it BigMovie, to play over and over again. Each time it plays, I'd like BigMovie to take another MC, call it MiniMovie_1, from the Library and play an instance of that. However, once BigMovie finishes and loops back to its beginning, I want it to grab the next MC, called MiniMovie_2, and play that instead of MiniMovie_1.

I have around a dozen MiniMovies, all labeled 1 thru 12, and I'd like to have them all play in order each time BigMovie loops around.

I've been trying to use attachMovie but I don't think I'm using it correctly because none of the movies are getting grabbed and played. Any advice? Thanks in advance.

Looping
how to make a loop from 1 to 30 then back to 1, loop and loop

Keeps Looping
Hello all
Alright, I got this button..... hehe, and I make sure that "Loop" is not checked...... but when I view it in my browser, it still loops..... while there... I go to "Control" on top, and notice that Loop is checked... Is it a default in my Flash Player? If so... how do I fix it? And if not, lol, how do I fix THAT???

Any help would be great

Sad

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