;

PDA

Click to See Complete Forum and Search --> : dynamic Text effect!


xzerox_xzerox
08-18-2006, 03:16 PM
Hi

I've got a textfiled in my movie named text and different buttons; Home, News, Audio etc etc. Check the link below:

www.vmgcomputers.com/cicero/main.html

I use this command to load text from the external .txt files named after the buttons. For the home button (who is in a mc by the way) i use this command:

on (release) {
loadVariables("home.txt","_root");
}

Now i want to ad some kind of cool animation to my dynamic text. Is there anyway how to do this? It would be cool the fade in the text for example when i load the external text into the dynamic textfiled.

Thanks in advance.

Please tell me what u think about my page so far :)

blanius
08-18-2006, 05:33 PM
If you use a Contentpane instead of the textfield you can use transistions when loading content.

xzerox_xzerox
08-19-2006, 07:06 AM
ehhh... ok... how do i do that?

ant_Z
08-19-2006, 09:09 AM
Hi

1. http://img81.imageshack.us/img81/9900/1od0.jpg
2. http://img151.imageshack.us/img151/8212/2fg2.jpg
3. http://img207.imageshack.us/img207/2196/3ha0.jpg

hope that will help

xzerox_xzerox
08-19-2006, 01:55 PM
thanks alot!

ant_Z
08-19-2006, 01:59 PM
you welcome. pleasure was all mine :]

BTW: http://e.domaindlx.com/xzerox/v4/ this is not working...

xzerox_xzerox
08-19-2006, 02:59 PM
what???!?!?! it works fine for me! But the server has ads now that destroys my layout.

Please check my new site made in koolmoves and do a review :)

www.vmgcomputers.com/cicero/main.html

xzerox_xzerox
08-19-2006, 03:04 PM
damn! This Contentpane destroys my layout... isn't there a way to do this effect on textfileds?

ant_Z
08-19-2006, 03:48 PM
i dont know, but you can freely custiomize contentpanes. Search this forum for contentpane :] there are tens of posts about it.

w.brants
08-20-2006, 02:39 AM
damn! This Contentpane destroys my layout... isn't there a way to do this effect on textfileds?
In what way does it destroy your layout ?

The contentpane internally uses a dynamic textfield so yes, it's possible to do this on textfields with some scripting. Depending on what effect you want it can be a bit complicated to create.

xzerox_xzerox
08-20-2006, 08:39 AM
hi... thanks for all the relpepys... If i'm gonna use a Contentpane i want it to look as my textfiled does... Look at www.vmgcomputers.com/cicero/main.html

I fade in effect would be nice... :) I guess it could be done with alpha? The problem is that i want every new text fade in and that is maybe a bit complicated because i use on (release) {
loadVariables("home.txt","_root");
} in my buttons inside my movieclips.

w.brants
08-20-2006, 01:26 PM
That text shouldn't be a problem for a contentpane if you don't mind the fact that a contentpane normally has a solid color background.

Setting _alpha for a dynamic textfield only works if you are using embedded fonts otherwise you have to control the alpha with the ColorMatrixFilter class.

xzerox_xzerox
08-20-2006, 03:05 PM
ok... brants... and how can i contral the alpha with ColorMatrixFiler class?

I'm a noob u see

Chris_Seahorn
08-20-2006, 03:19 PM
His name is Wilbert BTW. If you choose "About Koolmoves" in your help menu...this is who he is:

http://actionscript.hobby-site.com/examples/namedrespectfully.jpg

w.brants
08-20-2006, 04:10 PM
That's right Chris :)

Anyway, here's a flash 8 code example of a crossfade every time you load a new text.// create a new LoadVars object
lv = new LoadVars();

// assign the textfield we want to load the text into
lv.textField = txt1;

// crossfade function
lv.crossFade = function(){
this.alpha += this.step;
this.textField.filters = [new flash.filters.ColorMatrixFilter([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,this.alpha,0])];
if (this.alpha <= 0){
this.step *= -1;
this.textField.text = this.newText;
} else if (this.alpha >= 1){
clearInterval(this.intervalID);
this.intervalID = 0;
}
}

// onData handler
lv.onData = function(v){
if (v != undefined ){
this.newText = v;
if (!this.intervalID) this.intervalID = setInterval(this,'crossFade',50);
this.alpha = 1;
this.step = -0.1;
}
}

// load the external text
lv.load('myText.txt');Edit:
What I meant was a fade out and in again. I used the word crossfade in the wrong way since it's not fading out the old one while fading in the new one. That would require two dynamic textfields.

xzerox_xzerox
08-20-2006, 06:25 PM
thank you so much Wilbert. I didn't know u have programed koolmoves. Nice work!!!!

w.brants
08-21-2006, 01:21 AM
I didn't know u have programed koolmoves.
I haven't. Bob it the programmer.

I'm just a registered user who contributed some actionscript code just like some other users like for example Hilary or Joe who contributed code or fun files.

Chris_Seahorn
08-21-2006, 01:25 AM
I meant no disrespect to the amazing work of Bob Hartzell or the Lucky Monkey team. I just wanted xzerox_xzerox to understand who he was addressing and your importance to the KM team.

xzerox_xzerox
08-21-2006, 11:47 AM
aha i see... My name is Richard by the way, Chris... I'm gonna test the code now...

Chris_Seahorn
08-21-2006, 12:00 PM
Nice to meet your Richard!

xzerox_xzerox
08-21-2006, 12:06 PM
thank you Chris... Nice to meet you to... In fact, all of you here in this forum are very freindly!! thats a plus!!!! :D

xzerox_xzerox
08-21-2006, 12:25 PM
hum... the script is awsome!!!

But why does not my html tags work even if i've got html enabeled in the textfiled?

w.brants
08-21-2006, 12:28 PM
But why does not my html tags work even if i've got html enabeled in the textfiled?
Change
this.textField.text = this.newText;
into
this.textField.htmlText = this.newText;

xzerox_xzerox
08-21-2006, 12:45 PM
works fine :)

Chris_Seahorn
08-21-2006, 01:02 PM
hum... the script is awsome!!!

We're quite fond of him around here :)

xzerox_xzerox
08-21-2006, 05:09 PM
hehe thank you chris... i know this hasn't anything to do with the dynamic text effect but willbert helped me alot today by giving me some other code... And here is the result:

http://www.vmgcomputers.com/uk/

The page is in swedish and it's unfinnished... Translated menu buttons: "News", "The Boat", "Offshore Races", "Crew", "Team Sponsors", "images" and "links"

Chris_Seahorn
08-21-2006, 06:55 PM
You know what man....I really like that unfocused to focus effect on the menu items. It just different enough and just eye catching enough to keep you wanting to click. Great job :thumbsup:

blanius
08-21-2006, 09:02 PM
I like it too but I would speed it up just a bit. Especially when the content loads.

xzerox_xzerox
08-22-2006, 11:08 AM
thanks guys

ant_Z
08-25-2006, 03:42 PM
hey... and can You tell me, how to... so, ive got little textfield. Its used like a button :] Its name is button1. And i would like to: on (release) button1 start this effect. iv tried _root.button1.onRelease { code }, but the effect runs without clicking. How to do that?

xzerox_xzerox
08-25-2006, 03:53 PM
well just do as willbert told you?

First add this to the movie actions: Set "txt1" to your textfileds name!



// create a new LoadVars object
lv = new LoadVars();

// assign the textfield we want to load the text into
lv.textField = content;

// crossfade function
lv.crossFade = function(){
this.alpha += this.step;
this.textField.filters = [new flash.filters.ColorMatrixFilter([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,this.alpha,0])];
if (this.alpha <= 0){
this.step *= -1;
this.textField.htmlText = this.newText;
} else if (this.alpha >= 1){
clearInterval(this.intervalID);
this.intervalID = 0;
}
}

// onData handler
lv.onData = function(v){
if (v != undefined ){
this.newText = v;
if (!this.intervalID) this.intervalID = setInterval(this,'crossFade',50);
this.alpha = 1;
this.step = -0.1;
}
}


and then ad this to a button

on (release) {
_root.lv.load('test.txt');
}

ant_Z
08-25-2006, 04:41 PM
hm... and if i would like to use textfield instead of button? it may confuse, but button1 isnt a name of button, but of my textfield :)

ant_Z
08-25-2006, 06:08 PM
i usually use 60 FPS and i eventually change number of tweens, but i almost always use 6.

xzerox_xzerox
08-25-2006, 06:19 PM
hm... and if i would like to use textfield instead of button? it may confuse, but button1 isnt a name of button, but of my textfield :)

what do you mean? Do u want to use a nother textfiled as a button? i don't get it?

Well if you wannt to use a nother textfiled as a button. Create a button over it and make it 100% trasparent then ad the code i've told u to it.

ant_Z
08-25-2006, 06:53 PM
yeah, ive tried this way, but the button doesnt want to move right - textfields are just sliding from left, and button slides too far... and the next problem is, that the lenght of textfields can be different. I wanted do let people change button values, and textfields with specified effect looks very nice. But i dont know what will be lenght of these textfields...

ant_Z
08-25-2006, 06:55 PM
and yes, i want to use textfield as a button.

ant_Z
08-25-2006, 07:07 PM
allright, ive made it :] ive just put buttons into MC, add _root to code and now it works. but the lenght is still a problem...

xzerox_xzerox
08-26-2006, 06:05 AM
glad u made it... i don't know how to change length of textfield though

ant_Z
08-29-2006, 11:39 AM
Change
this.textField.text = this.newText;
into
this.textField.htmlText = this.newText;
at mine it doesnt work. im attaching sample text (content3) file and my fun...

xzerox_xzerox
08-29-2006, 01:53 PM
well first i don't think flash supports the headline tag <h> but im not sure of that:

Try with just a bold text or somehing <b>

Don't make a contentplane just a textfiled. And make sure to name it correct:


// assign the textfield we want to load the text into
lv.textField = content;
The name of my textfiled here is content

ant_Z
08-29-2006, 02:00 PM
mine is content too :] now it works, but its strange... i remember that html in flash is reduced to simple - style tags... so <span style> should work... hm, strange, really strange.

thanks :]

ant_Z
11-11-2006, 09:10 AM
hello again, its been a long since ive visited this topic. So... is there a possibility to make similiar effect but with flash 6? without blur, font just can change color to more transparent.

Changing color form current to background color wont work, cause ive got html in my textbox and there are different fonts with different colors.

Any ideas?