Results 1 to 2 of 2

Thread: Flash getFrame() method?

  1. #1
    Join Date
    Jan 2010
    Posts
    34

    Flash getFrame() method?

    I am trying to make some heavy modifications to an open source Flash-based graphing utility called FusionCharts Free.

    For my particular application, I need a way (in ActionScript) to access the last frame of the animation, and get at the actual image file/pic that was used for that last frame. I am not an ActionScript developer, and all my attempts to find an answer on my own have been futile. The closest methods I was able to find were gotoAndPlay(scene,frame) and gotoAndStop(scene, frame). Both return nothing and simply advanced the playhead to a specific scene or frame.

    To reiterate, let's say I have 100 images that I want to put into a Flash animation (.SWF file) at the rate of 10 fps (with their being a 1:1 image:frame ratio, of course). Then we would have a 10-second animation, with 10 fps, and in the first second we might see the following images "scroll through":
    1. ./images/frame00.gif
    2. ./images/frame01.gif
    3. ./images/frame02.gif
    4. ...
    10. ./images/frame09.gif

    In this example, we might expect the last frame to be ./images/frame99.gif (the 100th image in the 100th frame). I need a way to get at that frame99.gif in ActionScript!

    Because I'm not an ActionScripter, here is some pseudo-code that summarizes what I need to do; I'm not really worried about the semantics/syntax of AS right now as I'm confident I can figure the mechanics out once I know what methods to call:

    Code:
    // Obtain the image file
    var imageFile = getLastFrame();
    Thanks for any suggestions or input - thanks!

  2. #2
    Join Date
    Mar 2010
    Location
    England
    Posts
    1,144
    You can calculate the number of frames, with just this:
    Code:
    var total_frames = _root._totalframes;
    And then use some appropriate code to build the script. Only thing im unsure about is how to go about doing it, because im yet to see your code.

    How are the images being inserted to the flash? are they dynamically added via XML or something, or have they been hard-coded in.?

Similar Threads

  1. Please Review Flash Games Website
    By shanerichard in forum Website Design Reviews
    Replies: 0
    Last Post: 26 Feb 2009, 11:21 PM
  2. Replies: 0
    Last Post: 04 Jul 2008, 04:44 AM

Posting Permissions

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