View Full Version : Tweened text problem
schmemmm
07-03-2008, 07:19 AM
Hi guys,
I have a problem which has been ongoing. What I am doing is basically like a credit roll like you would do in premiere, but in flash.
The problem I have is that if I put all the text to be tweened/scrolled in the same static text box, when I play it, it looks fine. When I export it, its like it has grabbed half the text and put it over the top of the other text, so its just a big jumbled mess.
My solution to fix this was to break the text into sections, so say put half the text in one text box and then half in another and basically line the animations up in the timeline so that there is no break in the credit roll and it is all at the same speed. However this did not work. What happened instead is after it got to about 50 lines of text in, it simply stopped displaying the text at all so it was essentially animating nothing, just blank space.
To solve this I had to put the text in lots of 50 lines per text box. This is mega annoying because it means each time I had a line (one name per line) because it is an alphabetical list, I have to move all the names around in each of the text boxes otherwise it throws out the timing.
Can anyone offer any solutions or thoughts on why on earth it would be having a problem with this? Why will it only display 50 lines at a time in the smaller boxes, or why in the huge long list all in one box does it basically stuff it when I export it?
:(
If anyone wants any further clarification, let me know.
Please help!
kbtdk
07-03-2008, 01:17 PM
are you trying to do something like "produced by whoever", "directed by whoever" type of credits that scroll from bottom to top and fade off the screen as they scroll?
schmemmm
07-03-2008, 02:46 PM
Yeah its actually an honor board; you can view it here (http://www.bssc.edu.au/applications/public/Old_Gold_Centenary/pages/WWRolls_of_honour/flash/flash.html).
It's just that its not so good to have to update each of the names divided into lots of 50 names per text box. Its cumbersome to edit, when it should be really simple. Due to the nature of the project, I wanna make it as efficient as I can.
Someone suggested I try and read the names in from an external file, but even if I change the text box to dynamic that just makes it worse, because then nothing shows up at all.
kbtdk
07-03-2008, 03:11 PM
you could use an xml file for the text and have it scroll using 1 dynamic textbox. u could also create a mask as you have, yet make the mask alpha out as they scroll in and scroll out. i could show you an example later on tonight, if you like. it would be in a zip file containing the fla and xml file. this way you only have to update the xml file, and not the fla. let me know.
schmemmm
07-04-2008, 12:07 AM
yeah that would be awesome, thanks :)
kbtdk
07-04-2008, 03:30 PM
here is a sample
the text scrolls the contents of the xml file. when the text reaches the top of the mask it resets itself and loops the scroll. hope this helps. let me know
schmemmm
07-08-2008, 01:30 AM
Thanks man, you are a legend!
I am still having trouble understanding the mask and how it deals with the text. Even though autoSize is set to true in the text box, with the mask there it will cut off the text at a certain number of lines, and I am wondering how one can allow it to dynamically accept more lines of text.
Thanks for all your help, you rock!!!
kbtdk
07-08-2008, 03:20 AM
it will automatically except more lines of text when more names are added to it. if the are 10 names i.e 10 nodes in the xml file, then the text will autosize itself to show just those 10 frames, if you want elongate the text box size, just add a blank node to the xml, or just remove the autoSize line from the script and make the text box long enough manually to hold all the text (nodes). i added the autoSize so once the final fla is created, you won't have to touch it anymore. as far as the mask it will mask only what it sees. if the textbox is a certain length and the mask is a set length, the mask will show whatever it covers, and fade it in from the bottom as it scrolls. hope this explains it a bit. let me see what you have so far with the xml and we'll see what's what, and go from there. i'm here to help you, and not just partially.
schmemmm
07-08-2008, 03:47 AM
Thanks :D That's what I thought it was supposed to do, but when we tested your code by adding more names to the xml and it refused to scroll through them all, it just stopped randomly on the same line number every time. That's why I assumed that the autoscroll was not working. So we tried changing the text box by asking it to calculate the height based on the number of lines, but that didn't work either it just cuts off.
Does it run through fully for you if you say, copy those then people and put them in there 4 or 5 times? For me it gets to about person 18 then it stops.
I have another copy of your code that I am testing without your mask and so far it seems to display all those names, unless I add a text filter such as drop shadow at which point it displays all the way up to the second name and then cuts out displaying nothing further even though it continues to scroll through. So it is still scrolling but the names become invisible.
On the one with the mask I haven't added any text filters so that doesn't explain why that cuts off, and to be honest I wasn't aware that a filter should cause an error anyway. Its all very odd.
kbtdk
07-08-2008, 03:59 AM
let me try something cause i didn't try with more than 10 or so that i had. brb.
kbtdk
07-08-2008, 04:17 AM
ok, i'm back. if you take a look at mine, the one i sent. on the root timeline where the script is. replace that entire script with this;
xmlmc.setMask(tmask);
xmlmc._y = tmask._height+tmask._y;
xmlmc.onEnterFrame = function() {
xmlmcHeight = this.myText._height;
myY = tmask._y-xmlmcHeight;
this._y -= 1;
if (this._y<=myY) {
this._y = tmask._height+tmask._y;
}
}; this will take into account the height of the textfield holding the xml so it will repeat the scroll regardless the size of the xml file, so if you add more names (nodes) to the xml it will adjust for the addition and repeat the scroll. hope this helps. let me know, please.
schmemmm
07-08-2008, 04:20 AM
Thanks, just going to lunch but will check it after lunch and let you know.
schmemmm
07-08-2008, 05:54 AM
Its very close. It does work until it gets to name no. 155. If there are more than 155 names then it basically ignores the mask altogether and just scrolls normally as if there were no mask. At current count I have 338 names plus whatever text goes before the names.
I've also noticed that the more text the slower it gets no matter what the framerate of the project is set to. It does appear to be reading all the names in on the one without the mask though, so without a doubt that is a million times better than my previous version with the names cut up into sections. :D
kbtdk
07-08-2008, 01:49 PM
what you can to keep it steady is split this whole thing into parts. the main reason it lags is resources. the more text you give flash to slower it processes them. if you could break that down to maybe 34 names per movieclip with buttons to go from movieclip to movieclip, it would use as many resources. i know using a lot of text, or lots of alpha eats up resources. give this some thought and get back to me. BTW, what time zone are you in?
schmemmm
07-10-2008, 06:23 AM
Thanks, yeah I'm in GMT+melb,canberra,sydney.
I'll have a go at keeping it as one doc and see how it goes as its not going too slow with what I've entered so far, thanks for all your help :)
kbtdk
07-10-2008, 01:26 PM
you can up your fps to about 30 if it's not there already.
schmemmm
07-11-2008, 07:47 AM
It is all done and updated. I rewrote part of it so that it would read in different items for formatting purposes.
Thank you so much for all your assistance, without your help I would have struggled immensely with this, as it has been a long time since I did any flash stuff.
Many Blessings to you :D
kbtdk
07-11-2008, 01:55 PM
you're welcome. let me know when it's up. i would lke to see it.
schmemmm
07-14-2008, 01:26 AM
Sure check it out here (http://www.bssc.edu.au/applications/public/Old_Gold_Centenary/pages/WWRolls_of_honour/flash/flash.html)
It was doing a few buggy things on first load in Internet Explorer from home, but when I reloaded it, it was fine and its loading fine here, so it must be coping all right with that many names.
kbtdk
07-14-2008, 01:53 AM
looks fine. 2 points though.
1. if you look to the very top of the movie, you can see the scrolling.
2. the scroll is too slow for me, but if that's how you want it, it fine.
schmemmm
07-14-2008, 05:44 AM
Oh you are right, that should be fixed now.
Yeah the speed is just as slow as the previous version and that's the kind of speed they wanted. It really can't go any faster with that amount of data and who knows they might decide in the future to do something completely different such as searchable database like the one in Canberra.
There is also a PDF version so they can quickly look up names if they want to.
It did chugg in my firefox at home on a 256 connection, but it was fine in Internet Explorer and considering the demographic, I think they are most likely to be using IE.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.