My radio buttons aren't letting me select only one, but are selecting each individually when clicked.
I was having troubles the other day when adding some radio buttons to a form. Since I don’t use them that often I had forgotten to make them work the way I needed.
Typically a radio button’s function is to allow a user to pick one choice from a list, and that choice will have a green mark in the radio button.
But when I was working with my radio buttons, there were two of them, when I previewed the file and tried clicking either button, the both stayed clicked. I couldn’t remember why that was, and then I figured out why. Because of the idea behind a radio button, where a checkbox is for a list of choices that a user can pick more than one, you need to label the buttons accordinly.
The radio buttons must have the same name in order to be clickable one or the other, like this;
Last Name – Rothe <input type=”radio” name=”name” />
Chapman <input type=”radio” name=”name” />
This code will spit out these two radio buttons and if you try them, by setting the “Name” to the same value, only one is clickable at once.
Last Name – Rothe Chapman
How to I change a variable to a Boolean Value? What is a Boolean Value?
A Boolean is a value that is either True or False.
Translate True and False into numbers and you get False = 0, and True = 1.
Flash had a built in Method that will change a variable to a Boolean. Here is some sample code on how to implement that;
var myVariable:Boolean = Boolean(myValue);
This converts the value of “myValue” into a Boolean and stores it as a Boolean value in a variable called myVariable.
Now, what if the value of the variable “myValue” is a string? Well that will store “NaN” in myVariable. NaN translates into “Not a Number”. A string value can’t be change into a Boolean value.
Here are a couple more examples;
var mySample:Boolean = Boolean(123);
var mySample:Boolean = Boolean(0);
The first value evaluates to “True” because any number greater than one will evaluate to “True”. The second value will evaluate to False.
You may notice when I am defining these variables, the format looks like this – var mySample:Boolean. But you don’t know why you are adding a “:Boolean” after the name of the variable. This is data typing. You are defining the type of variable data that can be stored in this variable.
I hope to explain this in a little more depth in the near future.
What is an .afm extension / file?
A .atm file stands for “Adobe Font Metrics”. Here is a definition that I found on this site called faq.org. Basically an .atm file is for storing readable data about the font metrics that a regular person can understand. Kind of like a structural guideline for how the makeup of the font should appear.
Here is what that link says…
AFM is Adobe’s ASCII-based file format used for storing font metric data as human-readable data. AFM is the standard Adobe font file format. This format is also known as the Adobe Multiple Font Metrics (AMFM) and Adobe Composite Font Metrics (ACFM) file formats.
In fact, AFM, AMFM, and ACFM are actually three variations of the same format. AFM files contain base or composite font information. One AFM file is used per master design of a font. AMFM files store control and global font information for a group of AFM files.
And ACFM files contain the global metrics of the composite font program. The specification for the AFM format is: Adobe Font Metrics File Format Specification (Version 4.0), Adobe Developer Support, 14 February 1992, P/N LPS5004. This document available via FTP as a Tech Note in PostScript format, or as hardcopy when obtained directly from Adobe (see the PostScript section for information on how to contact Adobe Systems, Inc.).
What is a pin script in Flash MX 2004?
That is what I also did not know until today. A pin script really is nothing more than a marker to come back to.
When you are writing actionscript, you may want to come back to a certain frame during development. All you need to do is;
1. Click in the frame.
2. Open your actionscript panel. Window > Actions.
3. Click the pushpin icon at the bottom.
You will notice an additional tab appear at the bottom of the actionscript development window. You can click on any one of these tabs at any time and jump back to that frame that you want to work on again. In case you forget where that pin script is located, the tag will display the name of the layer, and the frame number like the following;
Layer 1:1.
So in summary, pin scripts are like markers during your actionscript development between frames so that you can keep your place. Tune in for more this week on things I have read specifically about Actionscript 2.0 and Flash MX 2004.
Posted by jerothe in