Solve the minor bug of the javastoflex source program-the failure to switch the last two pages of Page Control

Source: Internet
Author: User

In parsing the Igor Costa (http://www.igorcosta.org/) SourceProgram(Look at my http://www.cnblogs.com/wuhenke/archive/2009/11/12/1601535.html) on the basis of, solved the Left page control, movieclip last two frames can not switch between the problem. Here is my feedback:

"Hi Igor,
Thank you for your great work of solve loading the PDF's SWF file. after learning and running your programn, I find a small bug exists in face control. the bug is that you can't switch the last two frames from each other correctly. the currentframe property of movieclip can't equal with this movieclip. totalframes forever. of course maybe it's flash bug. I spent much time in removing this bug. Last I used a skill avoiding the bug.
What you need do is add "application. application. libmc. gotoandstop (E. currenttarget. pageNumber-2);" into the first line of function dispatchpage of pages. mxml. such:
Private function dispatchpage (E: mouseevent): void {
// Tips are used here to solve the problem that the last two pages cannot be switched.
Application. application. libmc. gotoandstop (E. currenttarget. pageNumber-2 );
Application. application. libmc. gotoandstop (E. currenttarget. pagenumber );
}
Maybe you can make your work more perfect! Thank you for you prework!

"

The cause is as follows:

The maximum value of the currentframe attribute of movieclip can only be the last frame of the totalFrames-1, not totalframes. However, you can use gotoandstop to switch from the last frame to the last frame, but the switch will become invalid. I checked a lot of information and did not have a solution to the related problems. I think it's movieclip's own bug.

 

Solution:

you only need to modify pages. add application. application. libmc. gotoandstop (E. currenttarget. pageNumber-2); here is a small trick, is to solve the last two frames cannot switch the problem. The tip is: first switch to the next two frames of the target frame, and then jump to the target frame.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.