Workaround
jverbal and I, both slightly not quite sober, try to work through an ActionScript exercise…
jverbal: ok i have a string “jon2”
Portnoy: What’s the problem?
jverbal: i want to remove “jon” from the string and just return the number
jverbal: im stuck
jverbal: that enough info? im kind of hi :)
Portnoy: ROFL
Portnoy: In your string, are you always wanting to capture the last index?
Portnoy: Or will that vary?
jverbal: i want the last letter
jverbal: always
Portnoy: and it could be a letter or a number?
jverbal: always a number
jverbal: i tried to split it and turn it into an array but it kept returning “,2”
Portnoy: Is it always going to be a number, or does there need to be a check?
jverbal: couldnt get rid of the comma
jverbal: will always be
Portnoy: I’ve done this before, but it’s been AGES
Portnoy: k
Portnoy: I also am more familiar with Kerman’s book (which is at work).
Portnoy: Leafing through moock right now
Portnoy: <--2 beers into the night with no food
jverbal: :)
Portnoy: I’m close to where you are sorta
jverbal: food is for wimps
jverbal: lites joint
Portnoy: or people who want to dampen their buzz
Portnoy: I love this – youre high and I’m kinda drunk
Portnoy: and we’re both trying to work on actionscript
jverbal: :)
Portnoy: When are you trying to get this number (frame? button? mc?)
jverbal: on click
jverbal: mc
Portnoy: alright –
Portnoy: this is a crappy workaround, but it may meet your needs
Portnoy: Let’s say that bob is your string
Portnoy: :)
jverbal: hehe
Portnoy: var a = _root.bob.length;
showme = (_root.bob.charAt(a-1));
Portnoy: Does that work for you?
Portnoy: There’s probably a better way with substring or something like that…
Portnoy: I can dig some mroe
Portnoy: more
jverbal: ohh nice
Portnoy: Not terribly elegant
jverbal: works though
jverbal: ROCK THANKS
Portnoy: wow – I’m able to help YOU out?
jverbal: ive been spazing out
Portnoy: You MUST be high!
Portnoy: :D

This Post Has 0 Comments