|
-
Angkor-What?
path and variable names... why can't I get this one straight
I always have trouble with this, but this time I realy can't figure it out:
Code:
myButton.mySubback.createTextField(mainMenu[i][c][0]+'_text', menu_startDepth, myButton._x, menu_Ystart+myButton.tekst._height*c, 0, 0);
with (myButton.mySubback[mainMenu[i][c][0]+'_text']) {
How do I 'reach' mainMenu[i][c][0]+'_text'] nested in MC myButton's child mySubback?
Cheers
MX 2004 Pro - Oops I did it again!!!
SWF, it's a journey... not a destination
-
Senior Member
Code:
with(_root[myButton][mySubback][mainMenu[i][c][0]+'_text'])
should do it.
zlatan
-
Angkor-What?
No avail Any other solutions?
Like your sketch app though
MX 2004 Pro - Oops I did it again!!!
SWF, it's a journey... not a destination
-
All 1s and 0s
Hi,
The easiest way is to assign the text field path to a temporary variable when you create it. Using the createTextField method returns a path to the newly created field:
var newField:TextField = myButton.mySubback.createTextField(mainMenu[i][c][0]+'_text', menu_startDepth, myButton._x, menu_Ystart+myButton.tekst._height*c, 0, 0);
newField.text = "Some Text";
If that doesn't work, you've most likely made a mistake in your code. Make sure myButton.mySubback exists, and make sure mainMenu[i][c][0]+'_text' is returning a string. I'm not sure what menu_startDepth is, but make sure that it is defined and that nothing else exists at that depth.
Hope this helps.
-
 Originally Posted by dmonkey
The easiest way is to assign the text field path to a temporary variable when you create it..
Unfortunately, that will only work in Flash 8...in earlier versions createTextField() does not return a reference to the newly created text field...
K.
-
All 1s and 0s
Oh! Thats a bit annoying. If your code above isn't working, then the text field probably isn't being created in the first place. Do some debugging.
-
Angkor-What?
 Originally Posted by dmonkey
Hi,
The easiest way is to assign the text field path to a temporary variable when you create it. Using the createTextField method returns a path to the newly created field:
I've tried that. It's the same way as I created myButton. didn't understand why it didn't work for textfield, do no though. Thanx Deadbeat!
I'll try to do some debugging and let you guys know!
Cheers
MX 2004 Pro - Oops I did it again!!!
SWF, it's a journey... not a destination
-
Angkor-What?
Had to remove myButton as mySubback was create like this:
Code:
mySubback = myButton.createEmptyMovieClip(mainMenu[i][0][0]+'_subback', menu_startDepth);
Thanx u guys!
Cheers
MX 2004 Pro - Oops I did it again!!!
SWF, it's a journey... not a destination
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|