Edward Posted June 19, 2008 Share Posted June 19, 2008 Hi, I am using a flip book in a flash movie. I have another movie which stores printable versions of all of the pages. When the user clicks on 'print page', I want my print movie to go to a specific frame label to print the currently viewed page. I am puttign the currently viewed page in a variable called page_to_print, like so: var page_to_print = 'p'+myBook.rightPageNumber This bit works fine, as I've displayed the variable in a text field (above would display p0) The problem is, when I try and use the variable in a gotoAndPlay label command, it doesn't work: gotoAndPlay('page_to_print'); Does anyone know why? Is it searching for a label called page_to_print, rather than its value, p0? Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/110888-using-a-flash-variable-in-a-gotoandplay-command/ Share on other sites More sharing options...
Edward Posted June 19, 2008 Author Share Posted June 19, 2008 I think I should simplify what I’m trying to achieve. Rather than do this: gotoAndPlay(‘test_label’); How do I do it with a variable? What I am using (below) doesn’t seem to work. var my_label = ‘test_label’; gotoAndPlay(‘my_label’); I think the timeline is searching for a label called my_label, rather than the value of this variable. Thank you. Link to comment https://forums.phpfreaks.com/topic/110888-using-a-flash-variable-in-a-gotoandplay-command/#findComment-568991 Share on other sites More sharing options...
ILYAS415 Posted June 22, 2008 Share Posted June 22, 2008 instead of doing smoething like... gotoAndPlay('variablehere'); try using.... gotoAndPlay(variablehere); Notice i got rid of the semi quotations. Link to comment https://forums.phpfreaks.com/topic/110888-using-a-flash-variable-in-a-gotoandplay-command/#findComment-571463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.