A Flash Developer Resource Site

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

Thread: Cool dynamic text scroller for txt file - but...

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    113

    Cool dynamic text scroller for txt file - but...

    This is a great bit of functional script that takes a txt file and updates the scroller to work. The only thing is that the original programmer didn't allow the variable on the third line of code (theMask._height = 100; ) able to change very much. I would like it to go to 193 pixels but around 150 it distorts the scroller. Anyone feel like downloading it and taking a peek. Welcome to use it, very useful I think.
    Attached Files Attached Files

  2. #2
    Really this is me..... mentaleruptions's Avatar
    Join Date
    Apr 2002
    Location
    WV, USA
    Posts
    1,114
    This was a simple one just a little trial and error with the code sorted it out.

    In the movie textscroller open the actions panel on the action layer and find:

    Code:
    dragger._height = theMask._height/scrollAmount;
    Once you have found it change it to:

    Code:
    dragger._height = 10;
    Now test the movie and u will see the scrollbar is now a tiny little box. Just edit the 10 to any number u like and that will set the scrollbars hight. Nice little file and im sure ill be able to use it if thats ok ??

    Enjoy

    My Flashkit Submited Movies:
    Guestbook: V.1.0 V.1.2 V.1.3 V.1.4 PHP Mail Form: V.1.0
    My Deviantart page: Link

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    thank you. an oversite on my part. the credit for this code goes to Billy T.

  4. #4
    Senior Member
    Join Date
    Mar 2002
    Posts
    113

    adding functionality to this code

    Hi again mentaleruptions

    I was wondering if it is possible to add HTML to the txt file so that you can have underlining and hrefs. I wasn't able to because I thought the textFormat function was preventing it.

    Any ideas on that? Any alterations to the code that you may know of?

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    anyone?

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Don't see why not... Didn't really check the .fla 'cause I don't like Billy's scrolling, but I have a similar one, and I can use html formated text, no problem... Just make sure you embed all the font's styles outlines (normal, bold, and italic) if wnating to use all of them...

    LINK EDITED OUT.
    Last edited by oldnewbie; 01-14-2005 at 12:11 PM.

  7. #7
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    I've embedded my fonts. That doesn't seem to be the problem. I've been reading a lot over the last couple days and I've learned a lot of people have had this problem with the delicate balance between HTML and textFomat and all the threads I've read come up empty with the posting user not receiving an answer to the problem. The main issue is determining how to marry the two so that you can format in AS and still be able to add href, bold, underline, etc in your txt file.

    If anyone has learned how to do this please post it because I've noticed this is a very common question which has gone unsolved.

    Thanks.

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I don't really understand your question. Can you attach your own .fla along with a text file (if one envolved...) zipped up and in a MX only format, not MX2004?

    You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    Here you go. I really think if someone could figure this problem out it would resolve a lot of textFormat questions regarding linking and editing within the txt document.

    Thanks for taking the time oldnewbie!
    Attached Files Attached Files

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Rather a simple fix in this case...

    Your textfield has to be html enabled, and you should use htmlText rather than text alone...

    Add or correct the 2 bold lines...
    code:

    loadData.onLoad = function(success) {
    if (success) {
    theTextBox.html = true;
    theTextBox.htmlText = loadData.theText;

    theTextBox.setTextFormat(myTextFormat);
    theTextBox.autosize ="center";
    } else {...



    That said, this should solve your present problem. But if you want to use the BOLD or the ITALIC styles (if available in the selected font...), you'd have to seperately embed their outlines, if you want the 3 styles to be available in the created textfield...

  11. #11
    Senior Member
    Join Date
    Mar 2002
    Posts
    113

    fantastic

    Thanks oldnewbie. I tried that before my last post but I must have been doing something wrong. I put your code in and it worked like a dream.

    Thx.

  12. #12
    Junior Member
    Join Date
    Oct 2004
    Posts
    20

    multiple instances

    Hello

    I would like to use this scroller in more than 1 section of an swf file. To do so, I realize that I need to declare unique instances but I am having problems figuring out how to do that and then apply new instances to the current AS code. For example if I change the target text file

    loadData.load("mytextfile.txt");

    in the instance "theText" Every instance in my swf that I am using this dynamic scroller gets updated.

    Can someone help me with this?

    Thanks.

  13. #13
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    My question is if anyone knows how to simply load the text scroller into a level.

    I tried it and just get the components of the scroller but no text.

    Could anyone take a peek?
    Attached Files Attached Files

  14. #14
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    I believe the problem to be with embedding the font but can't seem to make it work. Haven't been able to make a shared lib work on it either. Anyone?

  15. #15
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Not getting into shared librairies, but to quickly solve this problem, simply embed the exact same font in the exact same manner in the Library of your test.fla. It should then be loading the scroller on a level or in a container clip.

    Outside of embedding the same font in both movies, the problem with this method, is that it will be fairly complicated to use an html formated text file, since you will have to set up a different text format for each of the fon't styles you want to use, and hard code them in the .fla, rather than simply relying on the html tags in the text file.

    If not embedding the font in the Library, but using extra off-stage textfields where you embed whatever style, then the html tags in the text will take care of all formating much more easily.
    Last edited by oldnewbie; 01-20-2005 at 01:25 PM.

  16. #16
    Junior Member
    Join Date
    Oct 2004
    Posts
    20

    multiple instances

    Hello

    I would like to use this scroller in more than 1 section of an swf file. To do so, I realize that I need to declare unique instances but I am having problems figuring out how to do that and then apply new instances to the current AS code. For example if I change the target text file

    loadData.load("mytextfile.txt");

    in the instance "theText" Every instance in my swf that I am using this dynamic scroller gets updated.

    Can someone help me with this?

    Thanks.

  17. #17
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You have to duplicate the whole scroller mc in the Library and use different duplicates rather than different instances of the same scroller mc. Then you'll be able to edit each instance of each duplicate.

  18. #18
    Junior Member
    Join Date
    Oct 2004
    Posts
    20
    OldNewbie,

    Thanks, I appreciate it! It works perfectly.

  19. #19
    Senior Member
    Join Date
    Mar 2002
    Posts
    113
    jonocio, he is both our hero today.

    simply embed the exact same font in the exact same manner in the Library of your test.fla
    It adds unwanted file size to the parent SWFs but is an easy fix.

    Thank you oldnewbie.

  20. #20
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I'll try to work out a shared library version...

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