Variable in Path

  • vinid3
  • Novice
  • Novice
  • vinid3
  • Posts: 17

Post 3+ Months Ago

Hi everybody!

Im having trouble with a path to create a textfield

here is the scene:

In my level0, I have a movie clip with as instance name 'blablou'

I have it's adress transmitted to a function blablabla...

basically: this is the content of the 'destination' variable: "_level0.blablou" (verified with a trace)

wath i try to do is:

Code: [ Select ]
_level0.blablou.createTextField(instance,100+i,coordX,coordY,boxwidth,boxheight);

this works...
but _level0.blablou must be dynamic of course... so I thaught I would write:

Code: [ Select ]
[destination]createTextField(instance,100+i,coordX,coordY,boxwidth,boxheight);
_root[destination][instance].text = contenttext;
  1. [destination]createTextField(instance,100+i,coordX,coordY,boxwidth,boxheight);
  2. _root[destination][instance].text = contenttext;


first line creates the textfield, second one fills it in..
strangely enough, this looks to work, BUT the textfields are created in the root, not in the destination movieclip :(

how can I get this to work?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • vinid3
  • Novice
  • Novice
  • vinid3
  • Posts: 17

Post 3+ Months Ago

Yes! got it to work..

for records: this is the solution:

eval([destination]).createTextField(instance,100+i,coordX,coordY,boxwidth,boxheight);
eval([destination+"."+instance]).text = contenttext;
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Glad you got it working. Dynamic instance names are a pretty big mess in Flash so thank you for posting your solution. I'm sure may other people will find it useful.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.