Hi,
I am new to flash and having playing around to figure out what I can on my own, but this problem is really bugging me and I can't seem to solve it. I am trying to make an animation with three seperate buttons that when clicked on make one set of text disappear and new text appear in its place. My code so far looks like this:
stop();
//---Bio Button Text---\\
go.addEventListener (MouseEvent.CLCIK, bioplay);
function bioplay event:MouseEvent) :void {
}
Everything plays fine until I add the "go.addEventListener (MouseEvent.CLCIK, bioplay); function bioplay event:MouseEvent) :void { }." When this bit of code is added I get the error message:
ReferenceError: Error #1065: Variable TCMText is not defined.
I don't know what this means and I can"t seem to figure it out on my own so any help would be much appreciated.
Thanks,
Nick
Those two typos that I showed to you are critical to your code working. You've specified a mouse event in your listener, there is no CLCIK event, so Flash will throw an error. Additionally, that missing opening parenthesis will cause Flash to throw an error. The Error #1065 may be erroneous and may be the best that Flash can give you based on the two typos that I listed.
There may indeed be a problem with a TLFText field in your movie, but if you don't fix everything, including the Actionscript, you'll never know. A simple solution is to comment out the code and see if you still get an error.
If you fixed those two typos and you are still getting an error, then the only thing left is to find out if the object "go" in available in the same frame as the code. Your function has nothing in it so there's nothing there to cause an error.
If your code is in frame 1, then you need to have the object with the instance name of "go" also in frame 1, for instance.
I moved the actionscript to the same layer as the button which I want to cause the animation to go to the specified frame and play, and I am still getting the same error message. My text is all still set to classic and those two typos are fixed. I am wondering no if I am realy using the right code for what I want to do. I want this button to cause the animation to go to a specified frame, then play a few frames, and stop on a specified frame. Is this the right code to do this?
The code that you show in the first message doesn't really do anything. The body of the function is empty. I have seen this error message about TLFText fields many times. If you place a TLFTextField on the stage and don't set it up correctly, in this case by not giving the object an instance name, you will get this error. Even if you change the existing text field to a classic text field, the error can persist.
You may need to either start over with a fresh new movie, or, delete all of the existing text fields in the movie and place new text fields.
Ok I tried embedding my text and that did not solve the error so I have linked the .zip file to www.nichbdesigns.com. The .fla file that is in the .zip is the original file with embedded TLF text and the lines of code that are being problematic commented out so you can see what I want the animation to do in the beginning. The bad code is on the layer with the biography button.
The title NICK BREITWIESER, BIOGRAPHY, CONTACT, GOAL are all TLFTextFields. All of the characters in NICH B DESIGNS are all still TLFTextFields.
One of the problems is that you made all of the animations out of many, many, keyframes. Since you didn't use movieClips in a lot of those animations, each of the objects in each of those keyframes is unique. This means that you have to go into each keyframe and change the textField from TLF to classic.
You will be far ahead if you just throw this movie away and start over with a fresh new movie using Classic text.
Ok, I finally had time to finish re-making the animation. The scene is complete and redesigned a little, but it still has the same basic concept. Now I just need to write the actionscript to make a white screen fade in and then text to fade in on top of that when each of the buttons is clicked. Can somebody help me with this?
Sounds like you got it fixed, but for future reference, to embed a font: Open up the properties panel for your text box. Under the "Character" tab, there is a button next to "Style". If you click on that button, Flash pops up a window, there you can select the font you want. The font that was previously selected is default. There are several checkboxes, check only the ones you will be using in your application. It then shows up in your library, done!
North America
Europe, Middle East and Africa
Asia Pacific