A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: dynamic Text effect!

  1. #1
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357

    dynamic Text effect!

    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:

    Code:
    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
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    If you use a Contentpane instead of the textfield you can use transistions when loading content.

  3. #3
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    ehhh... ok... how do i do that?
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  4. #4
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    Hi

    1.
    2.
    3.

    hope that will help

  5. #5
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    thanks alot!
    Last edited by xzerox_xzerox; 08-19-2006 at 12:58 PM.
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  6. #6
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    you welcome. pleasure was all mine :]

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

  7. #7
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    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... Take a look at http://www.vmgcomputers.com/h75

  8. #8
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    damn! This Contentpane destroys my layout... isn't there a way to do this effect on textfileds?
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  9. #9
    Polak Maly ant_Z's Avatar
    Join Date
    Jul 2006
    Location
    Poland
    Posts
    440
    i dont know, but you can freely custiomize contentpanes. Search this forum for contentpane :] there are tens of posts about it.

  10. #10
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by xzerox_xzerox
    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.

  11. #11
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    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
    Code:
    on (release) {
    loadVariables("home.txt","_root");
    }
    in my buttons inside my movieclips.
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  12. #12
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    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.

  13. #13
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    ok... brants... and how can i contral the alpha with ColorMatrixFiler class?

    I'm a noob u see
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  14. #14
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    His name is Wilbert BTW. If you choose "About Koolmoves" in your help menu...this is who he is:


  15. #15
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    That's right Chris

    Anyway, here's a flash 8 code example of a crossfade every time you load a new text.
    Code:
    // 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.
    Last edited by w.brants; 08-20-2006 at 03:16 PM.

  16. #16
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    thank you so much Wilbert. I didn't know u have programed koolmoves. Nice work!!!!
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  17. #17
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by xzerox_xzerox
    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.

  18. #18
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    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.

  19. #19
    Senior Member
    Join Date
    Sep 2005
    Location
    Gothenburg, Sweden
    Posts
    357
    aha i see... My name is Richard by the way, Chris... I'm gonna test the code now...
    /xzerox... Take a look at http://www.vmgcomputers.com/h75

  20. #20
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Nice to meet your Richard!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center