|
-
AS2: Hard - Type effect in a dynamic textfield in whose html = true
I only found on the boards how to make it on normal dynamic textfields. But I wanted to use it in dynamic textfields that renders text in html format.
I started 4 hours ago.. and I think I'm gonna stop first. It's a bit tiring and it looks like it's going to be very tough to do this using if else's.
I wanna know if any one here has attempted to do such a thing?
How I pictured the program to go through a given text, such as:
<P ALIGN="CENTER"> HELLO<MAN<What's your name </P>
First, it will write the tags on a new string:
<P ALIGN="CENTER"></P>
But, it will remember where the non-tag portion is (location 18 to 46), then what it does is sets the textfeild.htmlText to <P ALIGN="CENTER"></P>
Second, it will slowly write in the non-tags, probably through an interval.
a: <P ALIGN="CENTER"> </P>
b: <P ALIGN="CENTER"> H</P>
c: <P ALIGN="CENTER"> HE</P>
etc..
it should work, and it allows the person to use html tags.
But... hehe it's a lot of work for such a simple effect.
-
Senior Member
This is it using onEnterFrame, you easily convert it to an interval if necessary
code:
mytextbox.html = true;
mystring = "HELLO THERE";
ind = 0;
this.onEnterFrame = function() {
ind++;
mytextbox.htmlText = "<P ALIGN=\"CENTER\">" + mystring.slice(0, ind) + "</P>";
//if you want to repeat
if(ind == mystring.length) {
ind = 0;
}
}
-
yup, that I got But thank you anyway!
What I mean is.. given any html tag, it will automatically know what the html tags are and just type in the normal text.
So that means it has to go through the given string first - find out what the html tags are, and write them on a new string, while remembering where the non tags are. So, when it starts typing, it inserts the strings in the respective areas.
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
|