[Flashcoders] TextFileds not receivign data?

2007-04-30 Thread John Trentini

Hi guys,


I want to create as many text fields (which eventually I would like to 
turn into buttons) as the length of an array. I also want to use the 
content of the array to populate the text of the fields created 
dynamically. I have tried everything I know but all I seem to get is 
one filed with the lasat item in the array, sheesh!


I've gone absolutely mad on this one (newish to actionScript, I am!) but 
can anyone tell me what  I am doing wrong here? I could do with a 
helping hand or seven =:-)




var myTxt:Array = new Array(branding, news, about us, print, 
marks, contact);

var myX = 430;
var menuArray:Array = new Array();
var ySpacing:Number = 90;
//

/*create  textFields**/
//
//

for(i=0; imyTxt.length; i++) {
   _root.createTextField(mytext+[i], 1, myX, 0, 100, 30);
   myId = _root[mytext+[i]];
   myId._y = ySpacing;
   ySpacing += 40;
   //   
   trace(myTxt[i]);//the trace works, it list all tyhe 
lements in the array but
   myId.text = myTxt[i];  // this one in not producing the appropriate 
results

   //
   myId.border = false;
   myformat = new TextFormat();
   myformat.font = Verdana;
   myformat.size = 14;
   myformat.bold = true;
   myformat.color = 0x55;
   myformat.align = right;
   //
   myId.selectable = false;
   myId.setTextFormat(myformat);
   //myId.text = myTxt[i];  //tried putting it at the end but no dah!
   //
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


SV: [Flashcoders] TextFileds not receivign data?

2007-04-30 Thread Pierre Eklöf
Looks like you´ve created the textfields on the same level. Create the
fields like this instead: 
_root.createTextField(mytext+[i], this.getNextHighestDepth(), myX, 0, 100,
30);

Cheers
Pierre
(first post, wahey!)

-Ursprungligt meddelande-
Från: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] För John Trentini
Skickat: den 30 april 2007 13:07
Till: chattyFig
Ämne: [Flashcoders] TextFileds not receivign data?

Hi guys,


I want to create as many text fields (which eventually I would like to 
turn into buttons) as the length of an array. I also want to use the 
content of the array to populate the text of the fields created 
dynamically. I have tried everything I know but all I seem to get is 
one filed with the lasat item in the array, sheesh!

I've gone absolutely mad on this one (newish to actionScript, I am!) but 
can anyone tell me what  I am doing wrong here? I could do with a 
helping hand or seven =:-)



var myTxt:Array = new Array(branding, news, about us, print, 
marks, contact);
var myX = 430;
var menuArray:Array = new Array();
var ySpacing:Number = 90;
//

/*create  textFields**/
//
//

for(i=0; imyTxt.length; i++) {
_root.createTextField(mytext+[i], 1, myX, 0, 100, 30);
myId = _root[mytext+[i]];
myId._y = ySpacing;
ySpacing += 40;
//   
trace(myTxt[i]);//the trace works, it list all tyhe 
lements in the array but
myId.text = myTxt[i];  // this one in not producing the appropriate 
results
//
myId.border = false;
myformat = new TextFormat();
myformat.font = Verdana;
myformat.size = 14;
myformat.bold = true;
myformat.color = 0x55;
myformat.align = right;
//
myId.selectable = false;
myId.setTextFormat(myformat);
//myId.text = myTxt[i];  //tried putting it at the end but no dah!
//
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] TextFileds not receivign data?

2007-04-30 Thread Jim Robson
Just took a quick look, but I think that this line may be giving you 
trouble:


myId = _root[mytext+[i]];

You may want to try this instead:

var myId = _root.createTextField(mytext+[i], 1, myX, 0, 100, 30);

HTH
Jim

On Mon, 30 Apr 2007 21:06:49 +1000
 John Trentini [EMAIL PROTECTED] wrote:

Hi guys,


I want to create as many text fields (which eventually I would like 
to turn into buttons) as the length of an array. I also want to use 
the content of the array to populate the text of the fields created 
dynamically. I have tried everything I know but all I seem to get 
is one filed with the lasat item in the array, sheesh!


I've gone absolutely mad on this one (newish to actionScript, I am!) 
but can anyone tell me what  I am doing wrong here? I could do with a 
helping hand or seven =:-)




var myTxt:Array = new Array(branding, news, about us, print, 
marks, contact);

var myX = 430;
var menuArray:Array = new Array();
var ySpacing:Number = 90;
//

/*create  textFields**/
//
//

for(i=0; imyTxt.length; i++) {
   _root.createTextField(mytext+[i], 1, myX, 0, 100, 30);
   myId = _root[mytext+[i]];
   myId._y = ySpacing;
   ySpacing += 40;
   //   
   trace(myTxt[i]);//the trace works, it list all tyhe 
lements in the array but
   myId.text = myTxt[i];  // this one in not producing the 
appropriate 
results

   //
   myId.border = false;
   myformat = new TextFormat();
   myformat.font = Verdana;
   myformat.size = 14;
   myformat.bold = true;
   myformat.color = 0x55;
   myformat.align = right;
   //
   myId.selectable = false;
   myId.setTextFormat(myformat);
   //myId.text = myTxt[i];  //tried putting it at the end but no 
dah!

   //
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] TextFileds not receivign data?

2007-04-30 Thread Amandeep Singh
Hi,

Seen you code. Just change the following line of code:

_root.createTextField(mytext+[i], 1, myX, 0, 100, 30);

To this one:

_root.createTextField(mytext+[i], i, myX, 0, 100, 30);

**

The problem with your code is that you are giving the same depth to all the
textfields. In flash you cannot assign the same depth to different objects
else it will remove the first object and place the new object on the same
depth.

Amandeep Singh,
Senior Flash Engineer,
Synapse Communication Pvt. Ltd.
F-18, Sector 11, NOIDA, UP
www.synapse.co.in
Mobile: +91 92161 03894
Office: +91 120 4330500 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John
Trentini
Sent: Monday, April 30, 2007 4:37 PM
To: chattyFig
Subject: [Flashcoders] TextFileds not receivign data?

Hi guys,


I want to create as many text fields (which eventually I would like to 
turn into buttons) as the length of an array. I also want to use the 
content of the array to populate the text of the fields created 
dynamically. I have tried everything I know but all I seem to get is 
one filed with the lasat item in the array, sheesh!

I've gone absolutely mad on this one (newish to actionScript, I am!) but 
can anyone tell me what  I am doing wrong here? I could do with a 
helping hand or seven =:-)



var myTxt:Array = new Array(branding, news, about us, print, 
marks, contact);
var myX = 430;
var menuArray:Array = new Array();
var ySpacing:Number = 90;
//

/*create  textFields**/
//
//

for(i=0; imyTxt.length; i++) {
_root.createTextField(mytext+[i], 1, myX, 0, 100, 30);
myId = _root[mytext+[i]];
myId._y = ySpacing;
ySpacing += 40;
//   
trace(myTxt[i]);//the trace works, it list all tyhe 
lements in the array but
myId.text = myTxt[i];  // this one in not producing the appropriate 
results
//
myId.border = false;
myformat = new TextFormat();
myformat.font = Verdana;
myformat.size = 14;
myformat.bold = true;
myformat.color = 0x55;
myformat.align = right;
//
myId.selectable = false;
myId.setTextFormat(myformat);
//myId.text = myTxt[i];  //tried putting it at the end but no dah!
//
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com