joanalemos Posted March 27, 2012 at 03:06 PM Report #445961 Posted March 27, 2012 at 03:06 PM 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 😁
Little Posted April 30, 2012 at 07:05 PM Report #452324 Posted April 30, 2012 at 07:05 PM Olá! Você já tentou usar a função substring? Ficaria algo assim: var sub:String = frame.substring(1, numletras); Abs!
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