joanalemos Posted March 27, 2012 Report Share Posted March 27, 2012 Olá pessoal, Estou a fazer um slideshow, em que ja esta todo pronto excepto o botão de prev. Botão Next-- on(release){ frame= frame+ "A"; BTPausa._visible=true BTPlay._visible=false play(); trace(frame); if (frame=="frameAAAAAAA"){ frame="frame" gotoAndPlay(frame); } else{ gotoAndPlay(frame);} } Botao Prev -- on(release){ var tamanhopalavra= frame.length; var numletras = tamanhopalavra-1 BTPausa._visible=true BTPlay._visible=false play(); if (frame=="frame"){ frame="frameAAAAAAA" gotoAndPlay(frame); } else{ gotoAndPlay(frame);} } A minha duvida é como no botão prev consigo ao calcular o tamanho actual da string e retirar um ( que e para ficar menos um A ) que é para ele reconhecer o rotulo anterior. Por exemplo estou na : frameAAA Que tem de Length 8 Quero retirar ao 8 1 ( esta parte ja esta feita ) Quero que fique a palavra como sento frameAA ( aqui é a minha duvida :s ) Penso ser possivel Abraços 😁 Link to comment Share on other sites More sharing options...
Little Posted April 30, 2012 Report Share Posted April 30, 2012 Olá! Você já tentou usar a função substring? Ficaria algo assim: var sub:String = frame.substring(1, numletras); Abs! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now