No
- Started
- Last post
- 7 Responses
- CyBrainX
There cannot be anything wrong with this code:
countDisplay = function(limit, whichType) {
if (whichType == 1c) {
this.text1c.text= i++;
}
}
_global.typeCount = function(limit, whichType) {
setInterval(countDisplay, 1000/31, limit, whichType)
}but I get this nonsense as an error:
**Error** Scene=Scene 1, layer=actions/labels, frame=1:Line 2: ')' expected
if (whichType == 1c) {**Error** Scene=Scene 1, layer=actions/labels, frame=1:Line 4: Unexpected '}' encountered
}Total ActionScript Errors: 2 Reported Errors: 2
I need help. I'd rather not punch things, but I'm running out of options.
- CyBrainX0
I don't know why but all references to 1c have to be changed to "1c".
Don't ask my why.
- acescence0
because "1c" is a string?
- noquo0
Is that a "1"(numeric one) or a "l"(alphabet value)?
If it's a numeric 1, you can't declare a variable with a number first...
Does that help?
- toastie0
yeah, what the hell is 1 c supposed to be?
- fusionpixel0
Dont start variables with numbers.
new code:
countDisplay = function(limit, whichType) {
if (whichType == c1) {
this.text1c.text= i++;
}
}
_global.typeCount = function(limit, whichType) {
setInterval(countDisplay, 10)
}
- CyBrainX0
1c was going to be a variable I was going to use to recognize a movie clip, but using "1c" was sufficient.
I forgot about numbers starting off variable names. Thanks for the tip.
- fusionpixel0
cool, but in that case what you can do is hold the MC number or ID or whatever in another variable and compare. Somewhat like this:
mcID = "1c";
countDisplay = function(limit, whichType) {
if (whichType == mcID) {
this.text1c.text= i++;
}
}
_global.typeCount = function(limit, whichType) {
setInterval(countDisplay, 10)
}you can also pull the name of the MC by just callin its name:
trace( this._name)
gl