Welcome, Guest
  • Author Topic: What is the code for auto pressing button!  (Read 1928 times)

    cliffcc

    • Server what's that
    • *
    • Posts: 23
      • View Profile
    What is the code for auto pressing button!
    « on: 11/18/10, 10:16 »
    I create a button

    b1.onRelease = function(){
       sizeWindow(holder_mc1, 55,60);
    }


    I want to ask what is the code for auto running the button without pressing it!

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: What is the code for auto pressing button!
    « Reply #1 on: 11/19/10, 02:27 »
    Just rewrite your code a little:

    Old code
    Code: [Select]
    b1.onRelease = function(){
       sizeWindow(holder_mc1, 55,60);
    }

    new code
    Code: [Select]
    b1.onRelease =b1_buttonpress;

    function b1_buttonpress(){
       sizeWindow(holder_mc1, 55,60);
    }

    then you can call b1_buttonpress(); whanever you like.
    « Last Edit: 11/19/10, 02:28 by Ronald Wernecke »
    happy flashing
    8)
    Ronald

    cliffcc

    • Server what's that
    • *
    • Posts: 23
      • View Profile
    Re: What is the code for auto pressing button!
    « Reply #2 on: 11/20/10, 09:33 »
    Thank you very much! This is what i want!

    cliffcc

    • Server what's that
    • *
    • Posts: 23
      • View Profile
    Re: What is the code for auto pressing button!
    « Reply #3 on: 11/21/10, 03:57 »
    I still don't know how to call the function since i am a beginner in actionscript.   After pressing "Ctrl + Enter" in flash. I want to resize the pics automatically. But I still don't know how to  call the button function. Can you provide me the code !  :)

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: What is the code for auto pressing button!
    « Reply #4 on: 12/13/10, 06:42 »
    The code is fine, I guess probably your function is not working. or is not on the same timeline as your button

    Jorge

    cliffcc

    • Server what's that
    • *
    • Posts: 23
      • View Profile
    Re: What is the code for auto pressing button!
    « Reply #5 on: 12/13/10, 09:09 »
    yes you are correct! Now it work. Thanks!

    jockygerald

    • Server what's that
    • *
    • Posts: 1
    • save water save life
      • AOL Instant Messenger - jockygerald
      • Yahoo Instant Messenger - jockygerald
      • View Profile
      • Email
    Re: What is the code for auto pressing button!
    « Reply #6 on: 01/19/11, 02:40 »
    what is the function for Hover effect such that it changes back color of button when mouse hover on it?

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: What is the code for auto pressing button!
    « Reply #7 on: 01/19/11, 04:37 »
    you have to fetch the "over" and "out" events.
    happy flashing
    8)
    Ronald