sirolivern
02-27-2008, 10:47 PM
hello everyone.. good day!
I have i problem with my page flip animation and i have this actionscript for the animation:
prevBtn.onRelease = function() {
var prevPage = _parent.offsetPages(_parent.page-1,_parent.removedPages);
if(prevPage>=-1) _parent.gotoPage(prevPage);
}
nextBtn.onRelease = function() {
var nextPage = _parent.offsetPages(_parent.page+2,_parent.removed Pages);
if(nextPage<=_parent.offsetPages(_parent.maxpage,_parent.remov edPages)) _parent.gotoPage(nextPage);
}
gotoBtn.onRelease = function() {
_parent.gotoPage(Number(pageNum.text)+1);
}
I am using Flash 8. The actionscript runs and do well. What my problem is I want to add the keypress function like when I pressed the ENTER key it will automatically flip the pages and go to the typed page number. ESCAPE for close. RIGHT arrow for next page. LEFT for previous page. I tried this code for ENTER :
pageNum.on (keyPress "<Enter>") {
_parent.gotoPage(Number(pageNum.text)+1);
}
But nothing happens. I knew there something wrong and I can't fix it..
I used flash for 5 years and still do not know all in the functions of actionscript. Specially now, FLASH is under ABODE.. By the way, pageNum is the name for INPUT TEXT.
Please help me on this.. thank you
I have i problem with my page flip animation and i have this actionscript for the animation:
prevBtn.onRelease = function() {
var prevPage = _parent.offsetPages(_parent.page-1,_parent.removedPages);
if(prevPage>=-1) _parent.gotoPage(prevPage);
}
nextBtn.onRelease = function() {
var nextPage = _parent.offsetPages(_parent.page+2,_parent.removed Pages);
if(nextPage<=_parent.offsetPages(_parent.maxpage,_parent.remov edPages)) _parent.gotoPage(nextPage);
}
gotoBtn.onRelease = function() {
_parent.gotoPage(Number(pageNum.text)+1);
}
I am using Flash 8. The actionscript runs and do well. What my problem is I want to add the keypress function like when I pressed the ENTER key it will automatically flip the pages and go to the typed page number. ESCAPE for close. RIGHT arrow for next page. LEFT for previous page. I tried this code for ENTER :
pageNum.on (keyPress "<Enter>") {
_parent.gotoPage(Number(pageNum.text)+1);
}
But nothing happens. I knew there something wrong and I can't fix it..
I used flash for 5 years and still do not know all in the functions of actionscript. Specially now, FLASH is under ABODE.. By the way, pageNum is the name for INPUT TEXT.
Please help me on this.. thank you