Hi, everyone

I found this script online awhile back and would like to make a class file from it since I use it a lot. I'd love to just be able to pass a few variables for the different strings to shuffle.

I've tried making the class file but I'm not so great with class construction.

Any help would be great!

Thanks,
Dave



btnChange.onRelease = function(){
        prev_text = text;
text = "This is the text to fill in. How are you today? We hope you're doing well.";
        reset();
        };


this.onLoad = function() {
        tf = "";
        // shadow
prev_text = "Hello everybody. How are you today? We hope you're doing well. Things are looking on the up and up for us over here. The weather is nice and we're all having a blast!</font>";
        // end shadow
text = "Sven-Goran Eriksson this afternoon described as 'a pity' Rio Ferdinand's exclusion from Saturday's Euro 2004 qualification decider in Turkey.\r\nThe Football Association insisted it would be 'inappropriate' to select Rio Ferdinand for the match in Istanbul because of the player's failure to take a drugs test last month. ";
        _root.tf_max = text.length;
// Set whatever speed you like! The function below takes care of any problems. If the speed wacks it out, the tf is set to the text string without error.
        // you don't notice anything becuase the text is moving fast anyway.
        speed = 6;
        // shadow
        num = 2;
        // end shadow
};
this.onEnterFrame = function() {
        if (_root.tf_max<=1) {
// This sets the tf to the text string. This is the fix for it wacking out the first words in the text becuase of the max length.
                output = substring(text, 1, -1);
                tf = output;
                tf2 = output;
                break;
        } else {
                tfLength = _root.tf_max-speed;
                _root.tf_max = tfLength;
                output = substring(text, tfLength, speed);
                // shadow
                tf2 = output+tf;
                tf2 = tf2+" "+"<font color=\"#999999\">"+prev_text;
                num = num+Math.round(speed/2);
                grab = _root.tf2.length-num;
                new_tf2 = substring(_root.tf2, 1, grab);
                tf2 = new_tf2;
                // end shadow
                tf = output+tf;
        }
};
MovieClip.prototype.reset = function() {
        tf = "";
        // shadow
        tf2 = "";
        // end shadow
        // Reset the tf_max to allow it to "retype" the text
        _root.tf_max = text.length;
        // shadow
        _root.num = 2;
        // end shadow
};

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to