A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 29

Thread: stupid scroll menu i cant get it to work damit

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    10
    i am having way to much troble loading dynamic text with a scroll button
    what are the quickest steps to do this
    also can you change the scroll bar to make it look different?
    plzz i have a huge headache
    i need quick steps plz

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This question must be asked 3 or 4 times a day at least!
    You could check out other threads...
    But tell me this:
    Dynamic text loaded from a text file?
    Dynamic text written as a variable in AS in the main movie?
    Dynamic text with html tags?
    Dynamic text with embedded fonts?

    Guess I'll set up a .fla with all possibilities!
    What do you want?

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    10
    Dynamic text with embedded fonts that sounds good i guess
    thanks
    my site is at http://www.members.cox.net/keith5885/ if you wanna see
    anyway thanks
    i suck at actionscript and i am trying to cram my self with info

  4. #4
    Junior Member
    Join Date
    Mar 2002
    Posts
    14

    Post

    Hi there,

    I'm making a site for someone and at the first page I wanted to make a "welcome". So I asked the person to write something and came up with a whole story. So I firstly thought "let's see if I can make a piece of text, which you can scroll within a textfield. But that seemed more complicated than I thought. Now I just made 3 "pages". But I'm still wondering how that is possible. I've seen it at others', so I know it is possible
    After I've read this thread I would like to join the class and start to learn a bit more of Flash's ActionScripting and this "Dynamic Text".
    Oh and eh...I have no experience with Java whatsoever
    Thanks in advance.

  5. #5
    Member
    Join Date
    Mar 2002
    Posts
    46

    Voyons, oldNewbie.. tu deviens professeur ici! Ces questions tant repetees malgre tous nos efforts sont un peu ennervants, non? Au moins, ceux que vous aidez ne chicanent point avec vous...

    heh
    nig

  6. #6
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Use the new LoadVars object to load dynamic text...

    Create a text file that looks something like this, and save as "myfile.txt":

    stuff=hey now

    Next, open a new flash movie and draw a dynamic text filed on the stage. Give it a name of myText. Then, on the first frame of the timeline, ad this code:

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

    // define function to execute once it has finished loading
    lv.onLoad= function (){
    _root.myText.text=this.stuff;
    }

    // load text file
    lv.load("myfile.txt");

    Save the flash file to the same directory as the textfile and test.

    HTH,

    K.


  7. #7
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Sorry for annoying you, but could you be a little bit more specific?

  8. #8
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    That is pretty specific...

    What else do you want to know?

    K.

  9. #9
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Okay.... I'll create a dynamic text FIELD...and when I select it, I get the Action-Menu.... and then? I copy-paste that script of yours into the actionscript window?
    And what izz LoadVar?

  10. #10
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Select the first frame of the main timeline, than paste that script into the actions window...

    Load Vars is an object that handles loading of external variables...

    K.

  11. #11
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Okay... (using Flash 5)

    -I draw a Dynamic Textfield and I give the Variable the name myText . I give it wordwrap, because in the future it will contain more text, and it will be non-selectable.

    -In the first key frame of the layer of that text field I paste:

    // create loadvars object
    lv = new LoadVars();
    // define function to execute once it has finished loading
    lv.onLoad = function () { _root.myText.text = this.stuff;};
    // load text file
    lv.load("mytext.txt");

    -I create a mytext.txt file containing: stuff=hey hello

    I export it and run it.. but no text appears... :-/
    [Edited by Wicked Mouse on 03-28-2002 at 04:55 PM]

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    If you're using Flash 5, the name of your textfield variable should be the same as the one in your text file, thus not myText but stuff since your text file says:

    stuff=hey hello...

  13. #13
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Okey.. zo.. the textfield gets the Variable: stuff
    and the script?.. stays like that?

  14. #14
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Yeah, the method I posted won't work in Flash 5, it's specific to Flash MX (you did post to the MX forum, after all...)

    For F5 follow oldnewbie's advice- name your text field "stuff" (to match the text file), then, on the first frame of the main timeline put:

    loadVariables("myfile.txt",this);

    Sorry for the confusion,

    K.




  15. #15
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    I'm a newbie, so...
    Couldn't you just say it STEP-BY-STEP? Not just wave your hands in the air like that like you're some Jedi.
    Say it just like I said it... please. Otherwise I won't follow it...

    Sorry for annoying you like this..

  16. #16
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    OK, your textfile looks like this:

    stuff=hey now

    Saved as "myfile.txt".

    Open a new flash movie. Draw a dynamic text field, and give it the name "stuff".

    Select the first frame of the main timeline. Paste this code into the Actions window:

    loadVariables("myfile.txt",this);

    Save to the same directory as the textfile and test.

    That's it.

    K.

  17. #17
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    Alright!! THAT's what I'm talking about!!

    And NOW.... I want to scroll the HUGE text, 'cos it doesn't fit in that field

  18. #18
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    For a continuous scroller, the easiest way is to place two buttons on the stage. Select the first (down button) and add the code:

    on(press){
    _root.scrolldown=true;
    }
    on(release, releaseOutside,rollOut, dragOut){
    _root.scrolldown=false;
    }

    On the second button (up) put:

    on(press){
    _root.scrollup=true;
    }
    on(release, releaseOutside,rollOut, dragOut){
    _root.scrollup=false;
    }

    Now, create a new movie clip symbol. You don't need to put any graphics in it (unless you want to). Place an instance of this clip on the stage. Select it, and paste this into the Actions window:

    onClipEvent(enterFrame){
    if(_root.scrollup){
    _root.stuff.scroll--;
    }
    else if(scrolldown){
    _root.stuff.scroll++;
    }
    }

    HTH,

    K.

  19. #19
    Junior Member
    Join Date
    Mar 2002
    Posts
    14
    I did as you told... but it won't scroll....
    How does that script say which or what to scroll?

  20. #20
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Ok, try this to start with (we'll get more complex later...). You can delete the buttons and movieclip from the example above for now...

    So- you've got your dynamic text field (named"stuff") on stage, loading text from an external file.

    Place a button on stage. Select it, and give it the code:

    on(press){
    _root.stuff.scroll++;
    }

    This should scroll the text one line everytime it is pressed.

    Lemme know if this works, then we'll move on...

    K.


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