A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Page numbers in a flash file

  1. #1
    JJ79
    Join Date
    Oct 2003
    Location
    London
    Posts
    133

    Page numbers in a flash file

    Hi,

    Is there any easy way to put the page number at the bottom of a page within a movie?

    page 1 is on frame 1 etc and so on
    ;-)

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    Sure. You would make a dynamic text field, give it an instance name (example: page). Now on each frame in your timeline put a bit of code like:
    page.text = _currentframe;

    or something like this:
    page.text = "Page: " + _currentframe;
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Member
    Join Date
    Sep 2009
    Location
    UK
    Posts
    40
    Yes you can do that, something like this:

    Set up a listener to call a function on every frame:

    Code:
    thisMC.addEventListener(Event.ENTER_FRAME, pageNumber);
    Then use a function like this to update a dynamic text field, pageNumberText, with the current frame:

    Code:
    function pageNumber(evt:Event):void
    { 
      pageNumberText.text= thisMC.currentFrame; 
    }
    Hope that helps!

    Billy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center