Results 1 to 9 of 9
-
October 5th, 2004, 09:59 PM #132Registered User
postsdynamic _y for text field as per previous text field's height
i have xml text i read into a MC with 3 text fields. i create a new MC for different XML nodes with attachMovie and position these MCs on stage with a FOR loop. This all works great
my problem is that one of the text fields in the MC will have varying length and so the _y of the following MC will depend on that. i've tried a few things but can't get it to work
Does anyone know how to approach this? How can you read the height of the text field, well, not the field but the vertical space used by the dynamic text?
thanks very much, any help/tips/etc would be fantastic!
-
October 5th, 2004, 11:44 PM #232Registered User
poststhis is my loop by the way....
txt3 will have varying height.
--------------------------
for (var i = 0; i<news.length; i++) {
item = Container.attachMovie("newi", "newi"+i, i);
item.txt1 =this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
item.txt2= this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
item.txt3 = this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
item._x = 80;
item._y = ???????;
}
----------------------------
... in case it can clarify things a bit
Still no joy!
Cheers!
-
October 6th, 2004, 01:02 AM #3
Hi,
You can give properties like:
yourTextFieldName.multiline = true;
yourTextFieldName.autoSize = true;
yourTextFieldName.wordWrap = true;
and then insert your text inside the textField.
MovieClip_Name.yourTextFieldName.text = this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
Thats it !!!!
------------
aShIsH
Originally Posted by Mona
-
October 6th, 2004, 01:26 AM #432Registered User
posts
Thank you for your reply aShIsH!!
I have thought well about what you've said - so I don't reply foolishly but there is no guaratee of that!
My text fields are loading well, so that's not the problem. Where i am having difficulty is in positioning each MC (which is made up of the 3 text fields) underneath each other, and considering the vertical space that the one above needs (the one created in the previous iteration of the loop).
So as item.txt3 could have 3 lines, or 7 lines, I have to position the next ITEM MC accordingly (in the next iteration of the loop). And I can't figure out how to assign the _y property of the ITEM for this.
Does this make any sense at all???
Thanks lots for your help!
-
October 6th, 2004, 02:26 AM #5
Hey Mona,
Got u now
here is attached one smaple file for u, i hope this may give some hint....if not let me know...
---------
aShIsH
You must be loading your MC sequetially. Assuming that I would suggest
Originally Posted by Mona
-
October 6th, 2004, 03:12 AM #632Registered User
postsThank you aShIsH !!!
But it seems to be a F2004 file, is it? I am working with FMX
Is there a way to Save As MX from 2004 - if you haven't used any particular 2004 features?
thanks!
(sorry, I should have specified that earlier...)
-
October 6th, 2004, 03:20 AM #7
Hey Mona,
I should be sorry for that not you, since i am loging into mx forum and sending u file of mx 2004
Here is ur MX version file:
----------
aShIsH
Originally Posted by Mona
-
October 6th, 2004, 03:39 AM #832Registered User
posts
you're DA BOMB!!
What you've sent makes sense, I am going to make some changes to my file and hopefully it should work! Although I had used ._height before but didn't manage to do it.
I'll let you know how I get on...
THANK YOU!!
-
October 6th, 2004, 04:39 AM #9
Hey,
Thanks and wish you the best
luck
----------
aShIsH
Originally Posted by Mona

Reply With Quote

Bookmarks