Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsI want to create a "credits roll" effect on my TextField.
How do I do this?
Here is my current code:
private function introduction()
{
addChild(text01);
text01.x = 20;
text01.y = 400;
addEventListener( Event.ENTER_FRAME, scrollText);
function scrollText()
{
//WHAT TO PUT HERE?
}
}
Thank you for helping.=)
-What is that thing called?
-That thing is called.
Simply use a tween engine, (TweenLite for example).
No reason to reinvent the wheel.
You want to tween the scrollV property, possibly to its maximum value, which can also be acquired from the TextField object
Most simple solution would be to just move the textfield. If you don't want it to disappear at the top of the screen but sooner for example, use a simple mask (in simplest form just a movieclip thats higher on the depth scale). So yeah:
//WHAT TO PUT HERE
text01.y -= 5;
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.
@ProfessorFlash
I did the your advice but the problem is my text is so long that the TextField only displays the first parts of the paragraph. It seems I have exceeded the maximum lines displayed by the TextField. Moving the TextField by increment works fine but doesn't display all of the text in the TextField.
@Milchreis
Your idea is exactly the one in my mind I'm experimenting but I have no clue as to how to put it dynamically (using Actionscript). How do I go about it?
Thank you to all of you.
-What is that thing called?
-That thing is called.
At 10/12/12 07:43 PM, inquisitorlee wrote: @ProfessorFlash
I did the your advice but the problem is my text is so long that the TextField only displays the first parts of the paragraph. It seems I have exceeded the maximum lines displayed by the TextField. Moving the TextField by increment works fine but doesn't display all of the text in the TextField.
That's because the default setting on a textfield is "singleline". Look at the properties of your textfield and change it to "multiline". You should then have no problem displaying your credits, unless you are thanking the whole world :).
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.
@ProfessorFlash
I went with your solution. It's already in Multiline. I have expanded the TextField to its maximum size and still it wasn't able to contain all my text. I have to cut the text into several TextFields. Though I was stubborn in sticking to one TextField, I finally gave up and decided not to complicate my work further.
Thanks again.
-What is that thing called?
-That thing is called.
At 10/13/12 01:48 AM, inquisitorlee wrote: @ProfessorFlash
I went with your solution. It's already in Multiline. I have expanded the TextField to its maximum size and still it wasn't able to contain all my text.
Just out of curiosity, how much text you got? I tried it with 15 paragraphs of lorem ipsum and it showed fine. You trying to make a book in flash? :)
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.
At 10/13/12 02:28 AM, ProfessorFlash wrote:At 10/13/12 01:48 AM, inquisitorlee wrote: @ProfessorFlashJust out of curiosity, how much text you got? I tried it with 15 paragraphs of lorem ipsum and it showed fine. You trying to make a book in flash? :)
I went with your solution. It's already in Multiline. I have expanded the TextField to its maximum size and still it wasn't able to contain all my text.
I'm making a long reading on the anatomy of Mega Man X. It's about 2 legal pages long in hard copy. I can place all text in the TextField and a RED BOX appears indicating that there are still more texts that are not displayed. I expanded the TextField all way down to show them without scrolling. I even zoomed out so I can expand it. When I can no longer zoom out I can no longer expand the TextField also. About 80% of the text cannot be displayed unless I break the texts into 5 smaller TextFields.
Is it possible to show the whole texts of the Bible using only 1 TextField? Some people told me to work on the scrolling property of the TextField and not its Y-coordinate. I get the idea but I do not know how to implement it. The "text.scrollV" syntax doesn't seem to work even if it doesn't return an error.
=(
-What is that thing called?
-That thing is called.
Erm, why don't you just adjust the height of the textfield with code?
At 10/13/12 04:29 AM, inquisitorlee wrote: Some people told me to work on the scrolling property of the TextField and not its Y-coordinate. I get the idea but I do not know how to implement it. The "text.scrollV" syntax doesn't seem to work even if it doesn't return an error.
What did you try? Post the code! ("it doesn't work" is never helpful on its own)
At 10/12/12 07:43 PM, inquisitorlee wrote: but I have no clue as to how to put it dynamically (using Actionscript). How do I go about it?
Are you familiar with a tweening engine?
If not, read, try and understand that:
http://www.greensock.com/get-started-tweening/
Now tween the right property to scroll the text field (see post above)
At 10/13/12 04:55 AM, PSvils wrote: Erm, why don't you just adjust the height of the textfield with code?
Damn you're dead on right! Why did it not occur to me? I'm so stupid. Thanks man. Basic things....=)
@milchreis
Wow! The add-on code is useful! Lots of my animations could have been done easier and simpler with it. Thanks!
My simple problem was solved in two ways and I get to learn TweenLite! Thanks guys!
-What is that thing called?
-That thing is called.