A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Want to trigger a function from a certain frame

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    3

    Want to trigger a function from a certain frame

    Hi this is my first post. I'm sure my problem is simple but I've been looking all over the forums and the internet for the answer with no luck. So...

    I really just want to know how to trigger a function when my movie hits a certain frame.

    I made a very simple flash show to try to illustrate my problem a little more clearly. I have a green and a gray button. Using the 'switch_buttons' command I turned the gray button invisible at the beginning. What I then want to happen is that on the 10th frame the green button will become invisible and the gray button will appear. But I haven't had any luck. It seems like I need to call a function to switch the buttons somehow.

    I am just getting into coding with Flash and would really appreciate any help. I have attached my flash file to the post if you would like to look at it.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    You can place the function call in the frame where you want the action.

  3. #3
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Or try this:

    PHP Code:
    onEnterFrame = function () {
        if (
    _currentframe == 30) {
            
    your_function_name();
        }
    }; 

  4. #4
    Junior Member
    Join Date
    Oct 2009
    Posts
    3
    Thanks ilike2,

    I'll give it a try.

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