Wrox Home  
Search P2P Archive for: Go

  Return to Index  

flash_programming thread: =?iso-8859-1?Q?RE=3A_=5Bflash=5Fprogramming=5D_RE=3A_=5Bflash=5Fprogram? =?iso-8859-1?Q?ming=5D_RE=3A_=5Bflash=5Fprogramming=5D_=BF=BF=BF=BF=BFfor? =?iso-8859-1?Q?_loop_problem=3F=3F=3F=3F=3F?=


Message #1 by "John Walborn" <Jwalborn@m...> on Wed, 29 Jan 2003 10:22:56 -0700
Great!

The principal behind using variables to create object arrays (which is 
what you've done) is that brackets, "[]", denote you're using a variable 
to refer to the object. Also of note, when you're using brackets, you 
don't need the first period.

For example, if "i" equals "1", this:

_root.Box1 =3D "YaddaYadda"

Becomes this:

_root["Box" + i] =3D "YaddaYadda"

Note the use of a literal to establish the first part of the object 
name. We use this method to populate tabular rows all the time.

Peace!

-----Original Message-----
From: Thomas, Charles [mailto:CThomas@D...]
Sent: Wednesday, January 29, 2003 10:11 AM
To: Flash Programming
Subject: [flash_programming] RE: [flash_programming] RE:
[flash_programming] =BF=BF=BF=BF=BFfor loop problem?????


John, you are a life saver!!!!  It worked like a charm. ;o)

Thanksamil,

-Charles

 -----Original Message-----
From: 	John Walborn [mailto:Jwalborn@m...]
Sent:	Wednesday, January 29, 2003 10:44 AM
To:	Flash Programming
Subject:	[flash_programming] RE: [flash_programming] =BF=BF=BF=BF=BFfor 
loop
problem?????

Here is what I would suggest... This may be a simple matter of 
methodology,
but I am limited to speaking from personal experience.

-----

Replace:

eval("_root.UnitCompareClip.TXT"+i)

With:

_root.UnitCompareClip["TXT" + i]


-----Original Message-----
From: Thomas, Charles [mailto:CThomas@D...]
Sent: Wednesday, January 29, 2003 8:03 AM
To: Flash Programming
Subject: [flash_programming] =BF=BF=BF=BF=BFfor loop problem?????


Hello all.  I am having trouble getting a simple loop to work correctly. 
 I
have 2 text boxes and I want to change the color to red via the code, 
but I
do not get the desired results.  Here's my code:

onClipEvent (data)
{

_root.UnitCompareClip.TXT1 =3D TXT1;
_root.UnitCompareClip.TXT2 =3D TXT2;


for (i=3D1; i<3; i++) {
	tmpVal =3D eval("_root.UnitCompareClip.TXT"+i);
		tmpVal =3D "<font color=3D'#FF0000'>"+tmpVal+"</font>" ;
		}
}

As you can see, I am trying to concatenate the value in "i" to "TXT" to
prevent literally writing if statements for each text box.  What am I 
doing
wrong???

Thanks in advance,

-Charles Thomas

 -----Original Message-----
From: 	Jay Hadley [mailto:LonerJayJ@n...]
Sent:	Monday, January 27, 2003 11:08 PM
To:	Flash Programming
Subject:	[flash_programming] Re: create flash MX  website hit counter

this is great. It's just what I was looking for. I am so excited to try
it. 










  Return to Index