A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Newbie Needs HELP Trying To Display News in Flash.

  1. #1
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21

    Newbie Needs HELP Trying To Display News in Flash.

    Hi, all!

    In this template, the News scene displays some text that comes from a file called text.txt. And there's some buttons on the right, but they do nothing.

    I want each button to be a different news article, as I think that's what the template was designed for.

    Here is .fla
    Here is .txt

    please tell me what i can do.

    ps. I liek donuts.
    Last edited by Brinnie; 07-09-2005 at 04:07 PM.

  2. #2
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    ooops, my URL's were'nt working.

    okay, all fixed now!
    Last edited by Brinnie; 07-09-2005 at 04:09 PM.

  3. #3
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    what you want to do is attach code to each button to load a different text file into the dynamic text box. such as
    code:

    on(release){
    this.loadVariables("newtext.txt");
    }
    on(release){
    this.loadVariables("newtext2.txt");
    }


    then you just need to make sure you start each text file with the appropriate variable so it displays in the box.... so start each .txt file with text=.

    hope that helps...

  4. #4
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    that helps

    Would you be so kind as to give me the steps to do this?

  5. #5
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    i gave them to you in the post.... just click on each button that you have created a text file for..... and add the actionscript i wrote above to each button...just change the name of each .txt file to reflect the text file you create for each news item...

  6. #6
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    I did that.

    I highlighted the button and put in the actionscript code and created the corresponding text file and got nothing.

    Did you even look at my fla?

  7. #7
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    yes i did look at your FLA.... i'll have another look and see if i can get it to work for you...

  8. #8
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    ok... it's fixed.download the file from here text files should be named text.txt
    Code:
    content=omg, text!
    testing text
    looking good. :)
    In this template, the News scene displays some text that comes from a file called text.txt. And there's some buttons on the right, but they do nothing.
    I want each button to be a different news article, as I think that's what the template was designed for. 
    In this template, the News scene displays some text that comes from a file called text.txt. And there's some buttons on the right, but they do nothing.
    I want each button to be a different news article, as I think that's what the template was designed for. 
    In this template, the News scene displays some text that comes from a file called text.txt. And there's some buttons on the right, but they do nothing.
    I want each button to be a different news article, as I think that's what the template was designed for. 
    
    -Brinnie
    and text2.txt:
    Code:
    content=what you want to do is attach this code to each button to load a different text file into the dynamic text box. such as this..
    actionscript:
    on(release){
    this.textPane.loadVariables("text.txt");
    }
    //
    on(release){
    this.textPane.loadVariables("text2.txt");
    }
    //
    on(release){
    this.textPane.loadVariables("text3.txt");
    }
    then you just need to make sure you start each text file with the appropriate variable so it displays in the box.... so start each .txt file with "content="... that is the NEW variable name i assigned to the text box...
    hope that helps...
    if you create those two files and save them into the same directory as your fla....it will work fine.

  9. #9
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    Thank you.

    i'm going to try and see if I can duplicate the changes in which you have made now.

  10. #10
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    Thank you, madzigian.

    Is there any other edits you made besides adding action script? Because on my copy I can't do it.

    On your copy, I can add text files all day long. But the one I'm working with now has been heavily modified since I posted for help.

  11. #11
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    yes... i made a few changes.... first go to the dynamic text box in the news section. now delete the actions attached to the movieclip containing the dynamic text box. put this in the actions layer (top layer)
    Code:
    stop();
    this.textPane.loadVariables("text.txt");
    now click on the movieclip containing the text box.... and give it the instance name "textPane" (i assume you're using at least Flash MX)
    now edit the movie clip containing the text box...... in your property inspector, change the variable name from what ever it is ("text" i think).... to "content" (without the quotes).

    that should be it.....

  12. #12
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    thank you, it worked!

  13. #13
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    glad i could help... good luck with the rest of your project!!!

  14. #14
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    Well, maybe you can help with that too.

    My next mission is to get it to accept html. I really only want to add links and stuff.

    After I learn that, I want to learn how to make it accpet php includes, so I can syndicate my news... Kinda sucks having to update the swf every day. :-\

    But first things first, do you know how do HTML on this?

  15. #15
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    this scroller will load an html txt file in for you...
    there is no need to update the swf every day... just change your external text file. once you publish your swf.... leave it. just update your text file. if you just want to add links... why not use a list box? or, check out this.

  16. #16
    WEBMISTRESS
    Join Date
    Jul 2005
    Location
    LA
    Posts
    21
    Quote Originally Posted by madzigian
    this scroller will load an html txt file in for you...
    there is no need to update the swf every day... just change your external text file. once you publish your swf.... leave it. just update your text file. if you just want to add links... why not use a list box? or, check out this.

    What do you mean by list box?

    See in the end, what I want, is to have it to pull the latsest news topics from my forum.

  17. #17
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    that's getting a little over my head. I would ask one of the gurus how to accomplish such a task. there's more back-end stuff there than i would know how to handle.

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