Re: [Flashcoders] >> While and Var

2006-03-21 Thread Roman Blöth

Laurent CUCHET schrieb:

1) I  create dynamic textfield with while option
I try to create dynamic border and content without success

/
var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
dtd = "var"+dt;
spa = dt*5;
spa1 = (dt*15)+45;
_root.createTextField(dtd, dt, 0, spa1, 100, 15);
  

Call

   dtd = _root.createTextField(dtd, dt, 0, spa1, 100, 15);

before calling

dtd.text=spa1;
dtd.border=true;
dtd.selectable=false;
dt++;
}
  

Since else "dtd" IS NOT your textfield, but simply a string.


Best regards,
Roman.

--

---
gosub communications gmbh | fredersdorfer str. 10  | 10243 berlin
t [030] 29 36 39 1 - 43 | f [030] 29 66 88 84 | http://www.gosub.de
---

___
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] >> While and Var

2006-03-21 Thread Arul Prasad
Dunno why I copy pasted 2 times!

The only changes were in the three lines where I replaced dtd with
_root[dtd]

You could use _root. dtd as well.

Of course you will have to optimize the code.


var dtd;
var spa;
var spa1;
var _txt:TextField;
var dt = 0;
while (dt<=99) {
   dtd = "var"+dt;
   spa = dt*5;
   spa1 = (dt*15)+45;
   _root.createTextField(dtd, dt, 0, spa1, 100, 15);
   _txt = _root[dtd];
   _txt.text=spa1;
   _txt.border=true;
   _txt.selectable=false;
   dt++;
}

Reason why it didnt work in your case - when you said "dtd.text" you were
actually trying to access a text property of the string dtd. And it silently
failed ( coz dtd was not strictly typed)

You would've caught these kinda issues if you had used strict data typing :)

~Arul Prasad.




On 3/21/06, Arul Prasad <[EMAIL PROTECTED]> wrote:
>
> var dtd;
> var spa;
> var spa1;
> var dt = 0;
> while (dt<=99) {
>dtd = "var"+dt;
>spa = dt*5;
>spa1 = (dt*15)+45;
>_root.createTextField(dtd, dt, 0, spa1, 100, 15);
>_root[dtd].text=spa1;
>_root[dtd].border=true;
>_root[dtd].selectable=false;
>dt++;
> }
>
> note: var dtd;
>
> var spa;
> var spa1;
> var dt = 0;
> while (dt<=99) {
>dtd = "var"+dt;
>spa = dt*5;
>spa1 = (dt*15)+45;
>_root.createTextField(dtd, dt, 0, spa1, 100, 15);
>_root[dtd].text=spa1;
>_root[dtd].border=true;
>_root[dtd].selectable=false;
>dt++;
> }
>
> ~Arul Prasad
>
>
>
> On 3/21/06, Laurent CUCHET <[EMAIL PROTECTED]> wrote:
> >
> > Good morning,
> >
> > 1) I  create dynamic textfield with while option
> > I try to create dynamic border and content without success
> >
> > Have you got a tips to done it
> >
> > Thank you
> >
> > /
> > var dtd;
> > var spa;
> > var spa1;
> > var dt = 0;
> > while (dt<=99) {
> > dtd = "var"+dt;
> > spa = dt*5;
> > spa1 = (dt*15)+45;
> > _root.createTextField(dtd, dt, 0, spa1, 100, 15);
> > dtd.text=spa1 ;
> > dtd.border=true;
> > dtd.selectable=false;
> > dt++;
> > }
> >
> >
> >
> > ___
> > 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] >> While and Var

2006-03-21 Thread Adrian Lynch
You're reference to the new text field is off, try storing the reference
like this:

dtd = _root.createTextField(dtd, dt, 0, spa1, 100, 15);

So the working code is:

var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
trace(dt);
dtd = "var"+dt;
spa = dt*5;
spa1 = (dt*15)+45;
dtd = _root.createTextField(dtd, dt, 0, spa1, 100, 15);
dtd.text=spa1;
dtd.border=true;
dtd.selectable=false;
dt++;
}

Adrian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Laurent
CUCHET
Sent: 21 March 2006 11:29
To: Flashcoders mailing list
Subject: [Flashcoders] >> While and Var


Good morning,

1) I  create dynamic textfield with while option
I try to create dynamic border and content without success

Have you got a tips to done it

Thank you

/
var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
dtd = "var"+dt;
spa = dt*5;
spa1 = (dt*15)+45;
_root.createTextField(dtd, dt, 0, spa1, 100, 15);
dtd.text=spa1;
dtd.border=true;
dtd.selectable=false;
dt++;
}



___
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] >> While and Var

2006-03-21 Thread Arul Prasad
var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
   dtd = "var"+dt;
   spa = dt*5;
   spa1 = (dt*15)+45;
   _root.createTextField(dtd, dt, 0, spa1, 100, 15);
   _root[dtd].text=spa1;
   _root[dtd].border=true;
   _root[dtd].selectable=false;
   dt++;
}

note: var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
   dtd = "var"+dt;
   spa = dt*5;
   spa1 = (dt*15)+45;
   _root.createTextField(dtd, dt, 0, spa1, 100, 15);
   _root[dtd].text=spa1;
   _root[dtd].border=true;
   _root[dtd].selectable=false;
   dt++;
}

~Arul Prasad


On 3/21/06, Laurent CUCHET <[EMAIL PROTECTED]> wrote:
>
> Good morning,
>
> 1) I  create dynamic textfield with while option
> I try to create dynamic border and content without success
>
> Have you got a tips to done it
>
> Thank you
>
> /
> var dtd;
> var spa;
> var spa1;
> var dt = 0;
> while (dt<=99) {
> dtd = "var"+dt;
> spa = dt*5;
> spa1 = (dt*15)+45;
> _root.createTextField(dtd, dt, 0, spa1, 100, 15);
> dtd.text=spa1;
> dtd.border=true;
> dtd.selectable=false;
> dt++;
> }
>
>
>
> ___
> 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] >> While and Var

2006-03-21 Thread Janis Radins
createTextField() returns refference to textfield object only since flash 8

2006/3/21, Arul Prasad <[EMAIL PROTECTED]>:
>
> var dtd;
> var spa;
> var spa1;
> var dt = 0;
> while (dt<=99) {
>dtd = "var"+dt;
>spa = dt*5;
>spa1 = (dt*15)+45;
>_root.createTextField(dtd, dt, 0, spa1, 100, 15);
>_root[dtd].text=spa1;
>_root[dtd].border=true;
>_root[dtd].selectable=false;
>dt++;
> }
>
> note: var dtd;
> var spa;
> var spa1;
> var dt = 0;
> while (dt<=99) {
>dtd = "var"+dt;
>spa = dt*5;
>spa1 = (dt*15)+45;
>_root.createTextField(dtd, dt, 0, spa1, 100, 15);
>_root[dtd].text=spa1;
>_root[dtd].border=true;
>_root[dtd].selectable=false;
>dt++;
> }
>
> ~Arul Prasad
>
>
> On 3/21/06, Laurent CUCHET <[EMAIL PROTECTED]> wrote:
> >
> > Good morning,
> >
> > 1) I  create dynamic textfield with while option
> > I try to create dynamic border and content without success
> >
> > Have you got a tips to done it
> >
> > Thank you
> >
> > /
> > var dtd;
> > var spa;
> > var spa1;
> > var dt = 0;
> > while (dt<=99) {
> > dtd = "var"+dt;
> > spa = dt*5;
> > spa1 = (dt*15)+45;
> > _root.createTextField(dtd, dt, 0, spa1, 100, 15);
> > dtd.text=spa1;
> > dtd.border=true;
> > dtd.selectable=false;
> > dt++;
> > }
> >
> >
> >
> > ___
> > 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
>
___
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] >> While and Var

2006-03-21 Thread Laurent CUCHET
Good morning, 

1) I  create dynamic textfield with while option
I try to create dynamic border and content without success

Have you got a tips to done it

Thank you

/
var dtd;
var spa;
var spa1;
var dt = 0;
while (dt<=99) {
dtd = "var"+dt;
spa = dt*5;
spa1 = (dt*15)+45;
_root.createTextField(dtd, dt, 0, spa1, 100, 15);
dtd.text=spa1;
dtd.border=true;
dtd.selectable=false;
dt++;
}



___
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