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




Dynamic Variable



Hi, found this a bit hard to forumlate, hence the difficulties googling for help which is my normal way to go..anyway, I got a loop by using "for" and it creates a bunch of TextInputs, and I want each of them to have a seperate variable attatched to their Text value.Now this doesnt work, but maybe someone will understand what I want to do._root.variable(j)ok the variables are setup with a number on the end, and I want to use another variable (j) to represent that number, so on every loop it will put the next variable in there.. ex:_root.variable1_root.variable2_root.variable3 etcAnyone know how to do this?



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 09-08-2005, 04:46 PM


View Complete Forum Thread with Replies

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

How Do I Make A Variable Store A Variable? - Dynamic Input Stuff ...
Hey, I got a little problem which I've usually been able to work around but in this particular case there really isn't another way. I want to give in a variable, say "x+x" and then use it as "x+x" and not as their assigned values ...

my result should be that I can alter the course of a loop like this ... for example:

input in text field = x+x

for(x=0,x<=50,x++){
...

y[x]=x+x

...
}

and if I give in 2*x it would make y[x]=2*x

I have no idea if there's a way in flash to accomplish this but if there is I'd sure like to know, thanks for any help I receive, I'll check back here soon.

Dynamic Text Field Is Calling The Variable Name Instead Of Variable Content
I'm having a problem getting something to work. I'm sure it has something to do with string variables and my syntax, but can't figure it out.

I have variables named cust1, cust2, cust3, etc. that are being loaded from a text file (these are customer names that will display in a text ticker).

I want a dynamic text field to display the customer names in incremental order, so I created a variable that consists of the string "cust" + a numeric variable called custNumber. At the end of each pass of the movie, custNumber is increased by 1.

var custNumber = 1;
var custName = "cust"+custNumber;

I want the dynamic text field to call the variable custName, but I can't get it to work. It keeps displaying custName as a string ("cust1", "cust2", etc.).

So I created a new variable called scrollText for the dynamic text to call, and made scrollText = custName;. But it does the same as above.

How do I get my dynamic text to call the variable that I create with another variable?

I want my dynamic text field to display the variable cust1, cust2, cust3, which would be "Jones Plumbing," "Smith Electric" etc., but all I'm getting is "cust1", "cust2", "cust3" etc.

Thanks,

Thom

How To Store A String Plus A Variable In A Dynamic Text Variable?
Hi,

I've got a dynamic text field with the instance name rightAnswer_txt.

I declare the variable in the frame it resides in, with the following code var rightAnswer_txt:String = "";

Then, when I want to populate it using the following code:

rightAnswer_txt.text = "You scored " + rightAnswers;

the script comes out with an error saying ...

**Error** Scene=Scene 1, layer=actions, frame=7:Line 15: There is no property with the name 'text'.
rightAnswer_txt.text = "You scored " + rightAnswers;

Any idea what this means anyone please?

Dynamic Text Box Variable = Other Variable, No More Scroll
So I have this textbox. And I want it to display some text. And I want the text to scroll and I want the text to change when you click a button. W007 I did it I am done. But I have a little problem, and I do hope you can help.

I loaded variables from a text file into flash, gave the variables different names, and then I set the buttons that can be clicked on to set the dynamic text box variable to equal one of the loaded variables. Ít wouldn't scroll after that. Whats up wit dat.

I can get you the FLA if you want it, but I am hoping someone will just say oh ya, common mistake, you gotta check a box or something.

Dynamic Text Variable Variable
Hello,
I have a movie which loads data from a text file into flash (-no problem there).
The twist to this is that one of the fields in my movie loads text into fields from a text file which looks similar to the example below:
myText_district=109
&myText_Ian=189
&myText_Dave=8
&myText_Ray=14

If I select a specific field in my flash movie and put for example" myText_Ian" as my Var in the properties panel I have no problem getting the "109" to echo at runtime.

But what I would like to do is specify the Var in the properties panel as something like:

"myText"+_root.managername

and still get the same result. You see, I want to define the variable "managername" at runtime in a field so that if I type for example "Dave" in the field the movie will substitute "Dave" in place of the variable "managername" all throughout my actionscript and thus retrieve only info applicable to "Dave".
The biggest problem for me is that I am stuck with the property panel because I can't apply actionscript directly to a dynamic textfield.

Is there a syntax that I can use in the Var field of the property panel to get the result I want; to get the variable equivalent to "myText"+_root.managername?

OR

Is there an example somone can show me on how to load variables from a text file into a SPECIFIC dynamic text field completely in action script?

Any help is greatly appreciated.

Arrrrrrg Dynamic Objec With Dynamic Variable
I'dont know how to sort this out.
I want to create a new dynamicly named Object and set a dynamicly named variable's value into that object, but i don't know how to trace them (this, eval, idontknowwhatelse,...)

this is a little example


Code:
var objectName:String = "Object_number_0";
var varName:String = "var_name_0";

this[objectName] = new Object();

this[objectName].varName = "Value_number_0";///Here is the problem

trace(Object_number_0.var_name_0);///It should trace "Value_number_0" but it doesn't

stop();
Thanx in advance

Dynamic Variable Name
Hello there,

I'm trying to use an IF statement through a function the following way:

function snapBack (objName) {
//trace (objName);
if (objName add ".myPos" = "A") {
trace ("OBJECT IS OBJECT A");
if (getProperty(objName, _x) != aX or getProperty(objName, _y) != aY) {
// PERFORM ACTION I'D LIKE TO BE PERFORMED....
}
}
}

I'd like to check the variable myPos in the movieclip with the instancename send by the movieclip by the function (objName). If I trace objName I get the right name, but when I use it to compare the variable myPos with the character A it does not work.

What am I doing wrong?

Greetings,

Dynamic Variable Name Value.
Hi

I am trying to check a list of variables that I load at the beginning of the
movie. The variables are called "MAIN_CATEGORY" plus a number starting at 0.
I assembled the string for the name of these variables but I cannot get the
values...

currentVar = "var" add i;
currentCatStr = ("MAIN_CATEGORY" add i);
set (currentVar, currentCatStr);


Set a number that will increase by 1 at each loop
set var1 to the value of MAIN_CATEGORY1
add 1 to 1 which becomes 2
set var2 to the value of MAIN_CATEGORY2

and so on and so on.

the problem is: i cannot get the value of MAIN_CATEGORY1 to be var1 var 1
becomes the string MAIN_CATEGORY1

thanks

George

Set Variable To Dynamic MCs
hi

i have a button that manipulates attached MCs on the stage like so:

on (release) {
_root[name+"height"] = _root[name]._height;
_root[name]._height += 10;
}

which adds to its height by 10. what i want to do is make the MC it manipulates dynamic, meaning the MC that is manipulated is different depending on which one the user clicked on last. can anyone tell me what code i need to put on the MCs on the stage to make them 'selected'? something like:

on (press) {
set (_root[name] , this);
}


or similar? thanks for your help!

justin

Dynamic Variable
Say when a person goes to my site, they are asked what their name is. It then goes to another scene, and i would like for the variable to be in a dynamic text field or whatever is necessary. How would i accomplish this? Would an array work? If yes, how would i setup something like this?

Dynamic Variable
Say when a person goes to my site, they are asked what their name is. It then goes to another scene, and i would like for the variable to be in a dynamic text field or whatever is necessary. How would i accomplish this? Would an array work? If yes, how would i setup something like this?

Is This Variable Dynamic ?
Is "myinstance._x" a dynamical variable?.

I mean, if I dragg myinstance on the movie test,
correspondingly "myinstance.x" get new values?.
If it not, how can I get that?.

Dynamic Variable
I have a variable that I want to create according to what is in another varible and then set my first variable = to something else. But I am not clear on this. Here is my attempted code:


Code:
//I want to create a variable that is a combination of
//the sting "note" and another variable, noteID. I then
//would like that variable I create to be equal to a note
//Field variable(noteField). And last of all I want to add
// my original variable to an array. What am I doing wrong?

var "note" + _root.noteID = _root.noteWindow.noteField
myArray[_root.noteID] = var "note" + _root.noteID ;

Set A Value To A Dynamic Variable
Hi all,

my problem is that i don't know how to set a value to a dynamic variable, when the name of the MovieClip (which contains the variable) has been created dynamically.

This is my code :

/// The Movie Clip contains :
jText (the dynamic variable)

/// The Scene contains :
// One instance of the Movie Clip, it's named t0

nMax = 3;
while (n < nMax) {
// i create a new instance
duplicateMovieClip(_root.t0, "t"+n, n);
// i place it on the scene
setProperty("t"+n, _y, random(200));
// i set the alpha
setProperty("t"+n, _alpha, 20);
// i want to set a text value to the jText variable
//setProperty("t"+n, jText, "Triangle_"+n);
n++;
}
But the line /*setProperty("t"+n, jText, "Triangle_"+n);*/ fails at compilation, the debugger says "Property name expected in GetProperty."

How can i set a value to jText variable ?
Is it a 'setVariable' or something like that ?

thanks in advance,
remi

Dynamic Variable
I have the following code in a button. I have several buttons on the page. when you click on the buttons it opens an new swf in a new window. Is there a way to if say I click on the button that says dave to send the variable with the name dave stored in it to the new window so i can load a specific variable into my dynamic textfield?

Code:
on (release) {

getURL ("javascript:NewWindow=window.open('toss.swf' ,'newWin','width=560,height=420,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");

}
Any help is appreciated
thanks
Robert

Dynamic Variable Name
Hello all,

I need to combine a the content of a variable defined in an external file (txt) and in this case, "eventdate1" to create a new variable name.

Basically, to summarize, this is what I need to happen:

- lastevent being the variable name pulled from a text file would return "n"
- the lastevent data ( in this case "n" ) when combine with the text "eventdate1" to create a new variable, now called "neventdate1" and I would then use "neventdate1" as the variable name for dynamic text -- as there's a variable in the text file with that name.

I need to dynamically change the letter at the beginning of "eventdate1" because there are 2 event types, and I want it to dynamically know which even happened last ( determined by "lastevent" ).

I'm having a really hard time explaining this. Let me know if I just totally confused you.

Thanks MUCH for your help!

Dynamic Variable
example:

i=1;
item1=5;
tekstveld=("item"+i);



The outcome is of tekstveld is "item1". What do i have to do to make it work? So the outcome of tekstveld would be 5.

I tried so many divirend thinks, but non of them worked. it looks so simple too.
i hope you can help me out.

Dynamic Variable
Hi all, i have a problem, i would like assigning a dynamic variable to a property, but i can't get the correct syntax..

i want:

_root.example _level0.idexample ._visible = true;

but i don't know how to syntax correctly _level0.idexample...

i tried with

_root.example[+_level0.idexample]._visible = true;
but i didn't work

Please help
Thank you

E.

Dynamic Variable
I am using a inertia scroller I found on flashkit but I am having problem adding more than one scroller to my movie without adding the code to each frame. Below is an extract from the code:

acPos = this.text_mc._y;

Is there anyway to have something like the following where I would pass the name of the text movieclip I want use to variable textvar:

acPos = this.textvar._y;

Have tried this but just get errors. Any ideas appreciated!!

Dynamic Variable Name
Yeah, drawing a blank here and was hoping someone could refresh my memory.

look at this and you will see what I mean.


ActionScript Code:
bleh = new Object();
bleh.doSomething = function(a1,a2) {
bleh.a1 = a2;
}

How do I get the a1 variable name to be the value of a1?

web

Dynamic Variable
Ok, I have a _root variable called _root.Color1photo (&Color1photo is in the variable text file and well defined).

Now, this variable must be loaded as such: loadMovie(_root.Color1photo, img);

But, there are more that one variable that has to change depending on the number (Color1photo, Color2photo, Color3photo, etc). The word "Color" and the number are called from two _root variable: _root.collection which is Color and _root.activeStyle which is the number. So my question is, why can't I call loadMovie(_root.eval(_root.collection + _root.activeStyle + "photo")) nor can I call loadMovie(_root.concat(_root.collection + _root.activeStyle + "photo"))....but when I concat the variables in one (var test = _root.collection + _root.activeStyle + "photo"; test comes out as Color1photo) it works...

More importantly, how can I call the _root variable that is made of the two other _root variables concat with "photo"

Thank You

Dynamic Variable
Hi everybody,
First post, because first time trying to make some AS3 stuff..
I was on AS2 before and to make some for loops, I used to do this :

ActionScript Code:
for(var i=0; i<5; i++)
{
    _level0.attachMovie("mc","mc"+i,i);
    _level0["mc"+i]._x = ....
}

but in AS3 I need to declare the variables, and I can't do :

ActionScript Code:
var ["mc"+i]:MovieClip=...

So... How to make some dynamic variables ?!

Dynamic Variable
Code:
function resetSection () {
for (i=1;i<6;i++) {
if (i==_root.nav.startNav) {
_root.content.restartRequest[i]=true;
}
}
}
this line of code is wrong, how can I attach i to the end of

_root.content.restartRequest[i]=true;

when I trace it I get "undefined"

muchas gracias

Dynamic Variable Name...
Hi all,

Having a problem with dynamic variable names at the moment. Basically I need the random number to be concatinated onto the end of my variable so that it bring the correct sentence back out.

Here is the code:


Code:
function randomNumber(low:Number=NaN, high:Number=NaN):Number
{
var low:Number = low;
var high:Number = high;

if(isNaN(low))
{
throw new Error("low must be defined");
}
if(isNaN(high))
{
throw new Error("high must be defined");
}

return Math.floor(Math.random() * (1+high-low)) + low;
}

trace("Random Number : " + randomNumber(1, 5));

//set up sentences for level 1

verbs.data.sen1 = "Jack ___ up the hill";
verbs.data.sen2 = "Jill ___ up the bucket";
verbs.data.sen3 = "Fred ___ the ball to Mark";
verbs.data.sen4 = "Jim ___ to the shops";
verbs.data.sen5 = "Penelope ___ over the rope";

var a = randomNumber(1, 5);
trace(verbs.data.sen+a);
The randomNumber works fine which is indicated by the top trace. However i need to trace back the varaible with the concatinated extension (be it 1-5).

There must be a way to do this but so far it has eluded me!

Any help will truly be welcome - Thanks Alot!

Dynamic URL From ASP Variable
Have a movie within an ASP page.
SWF has button to "on (release) getURL.......".

I'd like to get the URL dynamically. I have the data on the details.asp page and want to load the URL into the movie.

ASP coded URL:
details.asp?ID=<%=iOffice%>&PG=<%=iPage%>

The page opens but with the text like above, I want this instead:
details.asp?ID=12&PG=HOTEL

any insight appreciated,
g

A Dynamic Name Of Variable
I always name variable manual. And today I'd faced necessity do it by AS3 code. And I couldn't do it. How it's done?

Dynamic Variable Name
I am just trying to dynamically name some variables and I am having some troubles.

var i:String = "One";
var ["hey" + i] = "test";
trace(heyOne);

This is the error message I keep on getting.

1084: Syntax error: expecting identifier before leftbracket.

If anyone could help it would be appreciated.

Thanks
Jeff

HELP How To Get Dynamic Variable From URL?
I'm sure by now, you've all seen this page:

http://you.youarelame.com/
(replace YOU with any name)


And in this flash movie, in a text area, it shows whatever you type in before the string ".youarelame.com".

How was this done?


Is it possible to pass a variable to a Flash Movie thru the URL?

Like, for example, if I were to do something like this:
www.mywebsite.com/myflashmovie.swf?USERNAME=th3Phallex

could I process the "USERNAME" variable with some code somehow and get it to return my USERNAME back to me in the Flash movie?

Can A Variable Be Dynamic
I am using the var call in a button like this:

var menuPage = menuTxt

I then have other buttons that have a command like this:

1st button
menuPage = "m1"

2nd button
menuPage = "m2"

The result right now is if I select the button with menuPage = "m1" the var call still equals:

var menuPage = menuTxt

I would like it if it would equal

var m1 = menuTxt

Can this be done?

Dynamic Var From A Variable?
Hi, I'm completely stuck trying to get this code working, I need to include the variable 'newSection' in a Var that specifies which text to display in a text field, I think I'm nearly there but my code refuses to work. Any ideas on how to fix it?



ActionScript Code:
_root.technology_btn.onPress = function() {
    _global.newSection = "technology";
    newText();
    trace(newSection);
}
 
function newText() {
        _root.textBase_mc.textContent_mc.title_txt.htmlText = _root["contentLoad." + newSection + "Title"];
        _root.textBase_mc.textContent_mc.body_txt.htmlText = _root["contentLoad." + newSection + "Text"];
}

Dynamic Variable
Hey Guys, I'm calling in variables from an ASP output.

I've got the ASP to first do a record count, followed by the variables as follows.

count=3&name1=me&name2=you&name3=them

The count gives me a value to use for my loop.
I convert the count=3 to a number as it is a string coming in, and I get this to work in my loop - so I get 3 text fields to apear.

Problem is the variables.

My loop goes along the lines of - ok place a text field here and set the variable as "name"+i - this is giving me the values name1 name2 name3 - which looking at it makes sense as its adding a number to a string.

How do I get the script to work to say ok - I have a value called name1 put me here - if I hardcode it it works textfield=name1.

I just need to know how to get the variable to be dynamic so that name+i actually means get the variable name1 or name2 etc.

is it something like [name]+i or ["name"+i] its hurting my brain

Much appretiated.

Dynamic Variable Help
I am making a pong like game and am having trouble with my score variable. I have a dynamic text box linked to the variable "score". Name of the box is "characterscore". In my first frame, I use an init function to set score to zero. I start the game and every time my ball goes past the enemy paddle, my score variable does not increase by one. I used a trace value to see if it is recognizing me going past and it does. Just keeps score value at 0.
<pre>
function charscore(){
if(ball._y <= 0){
score = score + 1;
}
}

function init(){
score = 0;
}
</pre>

_root.(dynamic Variable)
I know this is simple, but I must be easily confused:

_root.button:

on (press) {
n = "CustID_" + _name;
_root.CustID = eval (n);
}

but this looks for _root.button.CustID# when the variable is at _root.CustID#

How do I reference it?

Dynamic Text Without Variable
Hi there,

is it possible to change the content of a dynamic text field without assigning a variable name?

The problem is:
I have a movie clip in my library and in that movie clip is a dynmaic text field. Now I create a number of instances of this movie clip with attachMovie. How can I dinstinguish the dynamic text fields?

thank you!

bye!
Dominik

Dynamic Variable Calls
Hooowdy! I want to call different variables depending on what section I am in. I've tried variations of this:

Code:
current_section = 1;

section_1_total = 16;
section_2_total = 12;
section_3_total = 9;

total_in_current_section = "section_" + current_section + "_total";
...but no luck. I'm sure I've just got the sytax wrong. How can I pull this off? Thanks!

Displaying Variable In A URL For Dynamic MC
How do I display a variable at the end of a URL...

Example: someone types their User ID # 8898 into an input field. I want to pass that on the end of a URL like so... userid.cfm?userID=****

I have an input box with the variable name set to user_id and can display that just fine on the MC. Just need what the syntax is on the end of the URL to display that dynamic number...

Thanks a ton!!

Darb

Dynamic Text Box And A Variable
Ok - I posted once and the answers made very little sense to me so maybe someone can spell it out.

Movie 545 x 420 in size

I have one movie clip of a rotating sphere -
A status bar movie clip which fills -

and the movie clip with some text and a dynamic text box which has a variable labled (percentloaded)

i want to pass the percentage of the total movie loaded to the dynamic text box so it displays as it loads.

The variable is again set to (percentloaded)

How is the percentage passed from the _root to the
dynamic text box?

Actionscript or not? Where do I need to place the commands....

Please help, and if you can spell it out for me -

Thanks!

Dynamic Content + Variable
hi, i have a menu with subsections which drops down when i click on a button. each subsection contains text which is divided in a number of pages. the amount of pages varies from section to section.
what i wish to do is this: when a subsection item has been clicked on, that the number of pages that it contains be shown on the page, under the text so that the reader can easily navigate. (for example: [1] [2] [3])
and since the site will need frequent updating, i was wondering if all this can be done with the use of variables.


thanks!!!!

LoadVariables(dynamic,variable)
hi

that the problem:
i want to read a variable via loadViariables(url, variable) in - the tricky thing is that the flash runs in an intranet, so there ist no static URL

Are there any possibilities to replace the url with a _url, _root or something else? or maybe with something like a url name tag between the <object> and <embed> tags?

thanx a million

psy

Dynamic Variable Names
Hello,

I can't remmeber for the life of me how to create dynamic variable names.

I have an if statement that I want the second part to be dynamic

if (eval(_root.button_1._droptarget) == _root.drop_1)

-----------------------------
So somewhere I set variables
var i = 2
var b = 3

and


if (eval(_root.button_1._droptarget) == _root.drop_1)
becomes:
if (eval(_root.button_1._droptarget) == _root.drop_i)

The 1 at the end is now variable as per the i in the second one.

Any thoughts?

Thanks.....Rob

Variable/Dynamic Functions?
Hey everyone,

Just wondering if anyone knows if it's possible to use variable functions? I'm not too sure if there's a technical term for it, but I mean calling a function whose name is store in a variable? So like:
var funcName;
then call funcName(); and have it execute whatever value funcName was holding, like:
var funcName="foo";
and funcName() would actually execute "foo()".

I hope this makes sense, and any help on this would be greatly appreciated. Thanks,
Andy

Can't Manipulate Dynamic Variable
Flash MX

this must be a basic question, but I couldn't find the answer via research, so I'm bugging you guys...

I'm getting a variable "mostRecent" from a PHP file, and need to manipulate it. Here's the code:

loadVariables("mostrecent.php", _this);

In a dynamic text box with the variable set to "mostRecent", the variable (an integer) shows up.

but trace(_this.mostRecent); gets me a fat undefined, and I can't do:

previous=mostRecent-1;

what's going on?

Dynamic Variable Names?
for (i=0; i<=numLots; i++) {
currentLot = "_root.vozi.L"+i;
if (("L"+i) == "sold") {
tellTarget (currentLot) {
gotoAndStop(2);
}
}
}


See what I am doing with this line:

if (("L"+i) == "sold") {

I need the loop to go through L1....L72 and check the value of all. All variable values are being passed in from an external file - so I think an array is out of the question. How do I dynamically update the variable name?

How To Create Dynamic Variable Name
Hey guys,

i want to create a dyanmic variable name and assign a value to it. so i wrote this function:

function bookmark( sendingVar )
{
for ( var i = 0; i < sendListLength; i++ )
(
eval(sendingVar+i) = 'C';
}
getURL("bookmark.html", "_blank", "GET");
}

however, when i compile it, it says:
Left side of assignment operator must be variable or property.
eval(sendingVar+i) = 'C';

So i try to do this instead
eval(sendingVar+i+"= 'C';");

but doesn't seem to work? any idea?

thanks in advance

justin

Dynamic Use Of LoadVarsText.{variable}
Hi,

I am currently working on a dynamically loading menu, that derives it's main buttons and sub buttons from a txt file.

I think I am on the right track as the variables from the txt file are loading without problems or such.

However, I do have one slight problem, it doesn't automatically load the textparts for all the buttons. As it is now, I have the following code:

In the first frame:

Code:
loadVarsText = new loadVars();
loadVarsText.load("knop_text.php");
In the fourth frame:

Code:
for(i=0;i<amount;){
duplicateMovieClip (_root.buttonholder, "mc"+i, i);
_root["mc"+i].title.html = true;
_root["mc"+i].title.HTMLtext = loadVarsText.mbtn+i;
ButtonY = ButtonY+28;
_root["mc"+i]._y = ButtonY;
i++;
}
stop();
The issue is in this line:

_root["mc"+i].title.HTMLtext = loadVarsText.mbtn+i;

Rather than returning the textvalues from the txt file, the {i} variable value is returned (see picture).



How do I need to wite the mbtn+i part in order to get the textvalues from the textfile, rather than getting the {i} values?

Hope you can help me.

Thx in advance!

With kind regards,


RF

Dynamic Variable Names
how in god's name do I concantenate a variable name from a string and an array index. Here's what I've been trying (this is actionscript, not PHP)...


PHP Code:



var dragNames=new Array(5);
dragNames[0]="Drag1";
dragNames[1]="Drag2";
dragNames[2]="Drag3";
dragNames[3]="Drag4";
dragNames[4]="Drag5";

var targetNames=new Array(5);
targetNames[0]="Target1";
targetNames[1]="Target2";
targetNames[2]="Target3";
targetNames[3]="Target4";
targetNames[4]="Target5";

var i=0;
var thename="";

for(i=0;i<dragNames.length;i++){
    var (eval("dragName" + i)) = dragNames[i];
}

for(i=0;i<targetNames.length;i++){
    var (eval("targetName" + i)) = targetNames[i];
}




I'm trying to end up with a bunch of variables named "dragName1, dragName2,...etc.
I've tried every variation on the above that I can think of and nothing works. This is soooo easy to do in PHP, but not in ECMA script. Please help!

Dynamic Text Variable
Hi

Created a simple slide show type movie using Flash 5. Use dynamic text to show variable pic_number.

When my previous, next or jump-to buttons are used, I update pic_number and use GotoandStop based on the new value of pic_number.

Works great, but now I've added what I call fast forward. I want the ability to show each picture in an auto slide show like loop.

The fast forward button sets fast_fwd to true and a test on every frame checks fast_fwd. If true it carries out the increment pic_number automatically then uses GotoandPlay pic_number. When the pictures have looped a few times fast_fwd is set to false.

Although the pictures show and the looping loops correctly the dynamic text does not show pic_number changing. I guess there must be bit of crucial Actionscript I'm missing. Seems as though GotoandPlay shows the frame contents, but not the dynamic text.

If anyone can give me some pointers I'd be extremely grateful.

Thanks

flash - bang - Whollup

Using Dynamic Text As A Variable
Hi,

I have a dynamic text box that is being populated by an fscommand. (I have checked to make sure that the text box is being populated). This text box will be used as a bookmark. I am having trouble using the content of the dynamic text box as a variable and using that variable to go to a specific frame. Here is an ex. of what I'm doing:

on (release) {

var bookmarks = _root.bookmark1.text;

if (bookmarks == ""){
nextFrame();
}else{

gotoAndPlay("bookmarks");

}

Using Dynamic Text As A Variable
simple ? ,

I have a dynamic text field that is being populated with an fscommand. I would like to use the contents of the text box to either go to a frame or frame lable. Can I assign the contents of the dynamic text field as a variable... like this? (this code won't work... I was just wondering if I am way off base) - thanks!

on (release) {

var bookmark3 = _root.bookmark1.text;

if (bookmark3 == null){
bookmark3 = "two";
_root.gotoAndPlay(bookmark3);

}else{

_root.gotoAndPlay(bookmark3);

}
}

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