Hi all! I've just started using Flash CS5 this July 4, 2014 and it's been really awesome!
A collaborator and myself are making a small comic featuring our roleplay characters doing a skit. He is in charge of the story, dialogue, coloring and design while I am in charge of drawing the lineart in photoshop (which he will color) and compiling everything into a flash movie.
The whole flash thing was my idea to keep our homepage 'clean' as we will be making a lot of comic panels. And we decided to use a simple typing/typewriter effect to make the flash movie look like a real rpg.
I've already searched flashkit but the codes I saw don't work for me Maybe they're already obsolete since most of them dated way back in 2005 to 2009-ish? Idk anything about scripting and I don't have any backgrounds whatsoever. But here is a code that's worked for me so far, with blahblah being the Dymanic Text's instance name and the only word I altered from the original post I got from the internet (from where exactly, I don't remember anymore)..
Code:
var effectTxt:String = blahblah.text;
blahblah.text = "";
var startEff:Number = 1;
onEnterFrame = function() {
if (effectTxt.length>=startEff) {
blahblah.text = effectTxt.substr(0, startEff);
startEff++;
}
};
I can't figure this thing out. It works really well on one frame but when I extend that frame above the Dymanic Text Layer, only the first frame plays out like a typewriter and the rest just appear static.
I would like to be able to post the code into one single frame which I can extend up to the end of the whole timeline just like what I can do with buttons so I wouldn't have to paste it on e-v-e-r-y frame where there's a dialogue, and maybe help get rid of a few more kb from the flash movie.
I've seen it work on tutorials and flash files that use AS3 (with addEventListeners, EVENT_FRAME, etc.) but I am hoping this can also be done in AS2 as I have already started our small flash movie using AS2, with an existing preloader, a mute button, a gotoAndPlay button, and also some music using attachSound.
Is it even possible? I hope it does! I've attached my sample fla for you to look at.
And please, please, please assume that I don't know anything about scripting since I've only started using Flash (and I really don't know anything at this point). Thanks a bunch!
So I used the script from your fla file and the first frame works. I placed it on an Actions layer and extended the said layer up to the end of the timeline. The first frame works perfectly but the second frame appears blank.
I wrote it like this:
Code:
var theMessage:String = "This is the text I want to see looking like it's being typed.";
var messageLength:Number = theMessage.length + 1;
var theSage:String = "Second frame containg text also being typed.";
var sageLength:Number = theSage.length + 1;
var addLetter:Number = 0;
var typeSpeed:Number = 40;
var typeInterval = setInterval(doType, typeSpeed);
function doType():Void
{
field1.text = theMessage.substring(0, addLetter);
addLetter++;
if (addLetter >= messageLength)
{
clearInterval(typeInterval);
}
}
{
field2.text = theSage.substring(0, addLetter);
addLetter++;
if (addLetter >= sageLength)
{
clearInterval(typeInterval);
}
}
doType();
The second frame appears blank and only the first frame works. I know I'm doing it the wrong way.