Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Rewriting a statement that works!



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Flash Forum
View previous topic :: View next topic  
Author Message
mjhood



Joined: 05 Jan 2007
Posts: 2

PostPosted: Sun Jul 22, 2007 2:11 am    Post subject: Rewriting a statement that works! Reply with quote

Hello all,

When I try to use the following code in Flash I get an error:

_root.("textfield"+textfieldcount).text = currenttext+newtext;

What I'm trying to do essentially is target the textfield called "textfield1" (where the number on the end is the variable "textfieldcount") and add more text to the end of whats already there.

I attempted to make the ("textfield"+textfieldcount) a variable, but instead of targeting the actual textfield with that instance name to perform the function on, Flash attempts to target the variable itself and not the textfield, resulting in nothing happening. If i simply replace ("textfield"+textfieldcount) with "textfield1" it works fine, but that doesnt help later when the textfieldcount variable is increased to 2 and beyond.

Is there a way I can structure the above statement to function how it is meant to?

Many thanks, Mj
Back to top
View user's profile Send private message
tkgd2007
50+ Club


Joined: 15 Nov 2007
Posts: 82

PostPosted: Sun Feb 10, 2008 1:11 pm    Post subject: Re: Rewriting a statement that works! Reply with quote

Code:
var mc = orderform['l'+n];
mc.qty = cart[n].qty;


that is a code used in a paypal cart system... I can't figure out where the orderform array is declared though, so I don't think that will help you much Sad

Umm, couldn't you just have each dynamic text box have a variable set in the "Var:" field?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Flash Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap