A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Scrolling Dynamic Text String Automatically

  1. #1
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127

    [F8] Scrolling Dynamic Text String Automatically

    Hey, I have an Mp3 player which gives the name of the song in a dynamic text field, however I don't want the field very long which means the name of the song extends far past the actual field. I was wondering the best way to go about making the text field rotate the song title inside of the textfield so the entire song name can be read. Heres the actionscript for the mp3 player:

    code:
    stop();
    playlist = new XML();
    playlist.ignoreWhite = true;
    playlist.onLoad = function(success) {
    if (success) {
    _global.songname = [];
    _global.songband = [];
    _global.songfile = [];
    for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
    _global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
    _global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
    trace(songname[i]+" "+songfile[i]);
    }
    }
    _root.createEmptyMovieClip("sound_mc", 1);
    _root.sound_mc.sound_obj = new Sound();
    _global.song_nr = random(songfile.length);
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    MovieClip.prototype.songStarter = function(file, name) {
    this.sound_obj.loadSound(file, true);
    this.onEnterFrame = function() {
    if (this.sound_obj.position>0) {
    delete this.onEnterFrame;
    _root.mp3Player.display_txt.text = name;

    } else {
    _root.mp3Player.display_txt.text = "loading...";
    }
    };
    this.sound_obj.onSoundComplete = function() {
    (song_nr == songfiles.length-1) ? _global.song_nr=0 : _global.song_nr++;
    _root.sound_mc.songStarter(songfiles[song_nr], songname[song_nr]);
    };
    };
    btn_play.onRelease = function() {
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    this.btn_stop.onRelease = function() {
    _root.sound_mc.sound_obj.stop();
    };
    btn_fw.onRelease = function() {
    (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    btn_rev.onRelease = function() {
    (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
    };
    playlist.load("playlist.xml");



    Thanks a lot!

  2. #2
    Pete Saia
    Join Date
    Nov 2004
    Location
    Bowie, MD
    Posts
    127
    http://rolldc.com/tnp/indexxx.php

    The mp3 player on the top right of the flash, see how it dosn't show the whole song...

  3. #3
    Member
    Join Date
    Nov 2003
    Location
    Ontario, Canada
    Posts
    80
    Use a mask and have it animate the dynamic text and repeat.

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