AS2 How to make a button that moves every two seconds

How can I make a button that moves every two seconds by itself in ActionScript2?
At the moment, I have to use the on(press) command, but what I really need is for the button to be able to move randomly by itself every two seconds. For example:
(insert the code here) {
     bc1._x = random(250)
     bc1._y = random(250)
Thanks!

You can use the setInterval function to have a function repeated for specific time intervals.  Here is a link to a tutorial that explains how to use it...
http://www.republicofcode.com/tutorials/flash/setinterval/

Similar Messages

  • How to make a button appear on every slide.

    Hi there,
    I am a new user with Captivate 4. This seems like a silly question, but I haven't been able to find it asked before (except for Captivate 2) and can't figure it out on my own.
    In my project, I will not be recording software--I'll be doing an e-learning with activities like quizzes and branching. I do not want it to run like a movie--I want a forward and back button on each page that user clicks to go through the module. I figured out how to get rid of the play bar but how do I make a forward and back button appear on each page? Or do I have to do that myself by cutting and pasting?
    Many thanks!

    Hi there
    One way is to insert two buttons on one slide. Program one to go to the previous slide and the other to go to the next slide when clicked. Then you copy the buttons, select all the other slides and paste.
    The other way is to use the Perpetual Buttons Widget supplied by Captivate. Click Window > Widget, then locate and insert the widget on the first slide where you want the buttons to appear. Configure the widget to display for the rest of the project.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How can I make a button that on press the object appears and on second press the object to disappear

    Hello,
    I'm quite new to flash programing, and I don't know how can I make a button that will make the object appear and disappear.Till now I have this code for the appear:
    on (press)
        _root.top1.gotoAndStop(2);
        _root.topp.gotoAndStop(2);
        _root.mm1.gotoAndStop(2);
              _root.m1.gotoAndStop(2);
    but from here I'm stuck.
    Thank you for your help

    What you can do is use the _visible property of the object to make it appear and disappear, or more correctly, use the opoosite of the _visible property.  You should not put code "on" objects, keep it in the timeline.
    If "object" is the instance name of the object you want to toggle, then in the timeline code you can use...
    object._visible = false;  // start with the object being invisible
    yourButtonName.onRelease = function(){
        object._visible = !object._visible;
    That one line in the function sets the object's _visible property to be the opposite of what it currently is.

  • How to make a button load a sprite from library??

    PLEASE HELP!!
    Hey everyone.. iv been looking for help for a few weeks but cant seem to find the awnsers
    I am trying to create a newspaper that consists of four pages. Each   page i have created and are sitting in the library as sprites. Each page   has buttons that need linking so that when pressed it loads the next   page or page that i want. This is the part i am confused with =/ how do i   make the buttons on each page load the next page (sprite) from the   library??
    Basically i want to no how to make a button load a sprite from the library when clicked. Does anyone no the script for this?
    Thanks for any help

    A question arises as to whether or not you are posting in the right forum.  Sprites are AS3 objects.
    If you want to add movieclips to the stage from the library using AS2, then you need to assign them each an Identifier via right clicking them in the library and selecting the Linkage option... from there you slect the option to Export for Actionscript and then assign the Identifier.
    You then use the attachMovie() method to make use of that Identifier to dynamically load the library object.

  • How to make the buttons INVISIBLE in the Application toolbar

    Hi All,
    I have a requirement to create a button in the Application toolbar of the Module Pool Screen. The field should be made Invisible by default. and it should be displayed based on one condition.
    Could you please let me know how to make that particular button INVISIBLE. I think we can make it invisible by using EXCLUDING statement. But, How to make the button VISIBLE again when the check is satisfied.
    I found from the portal that the FM 'VIEW_SET_PF_STATUS' can be used to make a button INVISIBLE. Could anyone help me out how to pass the parameters to this Function module?
    or is there any Function Module available to make the button VISIBLE and INVISIBLE? Please help me on this issues.
    Is there any possibility to make the button VISIBLE or INVISIBLE as we do for the screen fields using LOOP AT SCREEN..?
    Thank you in advance.
    Regards.
    Paddu.

    Hi,
    Try to use below in the PBO module status_0100 OUTPUT.
    DATA t_fcode TYPE TABLE OF sy-ucomm.
    refresh t_fcode[].
    APPEND 'Function code name of the button' TO t_fcode. 
    Check the condition here for which you want to make field visible.
        DELETE FCODE of the button from T_FCODE table
      ENDIF.
      SET PF-STATUS 'STATUS_0100' EXCLUDING t_fcode.

  • How to make a button to stop and run a for loop?

    How to make a button to stop and run a for loop?  and if it is stopped it shall start from where i t stopped.

    Your VI has some very fundamental flaws.
    The start/stop button is outside the FOR loop, thus it will NOT get read during execution of the FOR loop, but only before the FOR loop starts. Think dataflow!
    Thus the terminal of the start/stop button belongs inside the FOR loop.
    Your FOR loop iterates 20x, which probably takes about a nanosecond. You will NOT be fast enough to reliably press the start/stop button during a specific iteration of the FOR loop.
    Your code does not "stop and run" a FOR loop (sic). The loop always spins, but executes an empty case when "Stopped". I guess that's what you actually want?
    Once you solve (2), the x indicator will contain a random value whenever you "stop".
    As soon as the 20 iterations complete, the outer while loop spin an things start over, another nanosecond later.
    Place e.g. a 500ms wait inside the FOR loop to solve this.
    Don't place terminals of indicators on top of formula nodes.
    Your formula does not produce any output, so really has no purpose.
    Use a real "stop" button to terminate the while loop (mechanical action: latch when released). Right now you are using a plain switch, which does not reset to false before the next run. This means that you need to manually reset it before running the program again.
    It is oftern useful to operate the VI in execution highlighting mode. You will immediately see that your button does not get read during execution of the FOR loop. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • How to make a Button to work Actively even if there is a mandatory field..?

    Hi All..
    How to make a Button to work Actively even if there is a mandatory field to be fulfilled..???
    I am badly in need of this logic, as i have to incorporate in my code..
    Points will be rewarded without fail..

    Hi Pavan,
    I also faced the same requirement. U can do one thing like remove the obligatory keyword of that parameter/select-option. U can handle the same using the program in at selection-screen event. See this sample of code,
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_land1 for T005-LAND1 <b>[Needs to be mandatory]</b>                 no intervals no-extension.
    SELECT-OPTIONS:  s_panid FOR zoindex_val-zopanid.
    SELECT-OPTIONS:  s_effdat FOR zoexchrate-zedate.
    SELECTION-SCREEN END OF BLOCK b2.
    *-- AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
    *-- Obligatory Country Code
      IF s_land1[] IS INITIAL.
        MESSAGE e050 WITH text-050.
                     "Please select the Country Code
      ENDIF.
    So whenever u do F8/Enter other than that push button, it will prompt u to enter the country code first then only u can proceed.
    Hope this would help u in some way. Please do reward the helpful answers.

  • How to make "Utility" button in Printer Setup Utility available

    There, i add a printer in the Printer Setup Utility and select it. i want to open printer utility, but the "Utility"
    button in Printer Setup Utility is dimmed. In addition,
    "Printer\Configure printer" in the Printer Setup Utility menu is also dimmed.
    How to make "Utility" button in Printer Setup Utility available?
    Thanks in advance.

    Hi Jiong,
    That button is to acess the printer utility for that particular printer, not all printers come with a utility. If you have the disk that came with your printer, you can see if it has a Macintosh driver, if it does then it mimght have the utility with it. It's pretty hard to run the utility on its own, its burried somewhere in the system so that's why you have that menu item. You can alternatively go on the internet and download the latest driver, which might have a utility. All the utility will do will give you options to check nozzle patterns, alighnement, ink tank levels, and cleaning options - just mimnor maintenence junk, non-essentials, etc. I think Tiger just comes with a whole heap of generic drivers for different printer lines, can't say for sure.
    I wouldn't worry about it, especially if you have a relatively old printer.
    Hope that helps
    DKR

  • How do I create buttons that once clicked and un clicked, alter an image? ...

    How do I create buttons that once clicked and un clicked, alter an image?
    So for example if I imported a psd file into Muse with 5 layers, could i create 5 buttons which, when clicked, each individually took off and added 1 layer?
    Basically this should make what i'm trying to say clear (when it's loaded click the arrow and you'll see): http://lust.nl/lustArchive/noordzee/noordzee.html
    Appreciate any help

    Hi Joe,
    Please use this option to hide the target on click - http://prntscr.com/3plqn0
    - Abhishek Maurya

  • How to make a button to search something in sql

    I am trying to make a button that can search for something like for example if like say i type yes, it will show me things that is under yes.But I am not sure how to make the code work as I cannot change the php code as it is under the requirement that I make the button work and not using the php code to make it work which means that I cannot type the yes to show the information and the button must somehow have the "yes" in the function to show the information.Please help me and Thanks for your help.
    This is my flash code.
    package  {
      import flash.display.MovieClip;
      import flash.net.NetConnection;
      import flash.net.Responder;
      import flash.events.MouseEvent;
      public class main extends MovieClip {
      var gateway:NetConnection;
      var responder:Responder;
      public function main() {
      gateway = new NetConnection();
      gateway.connect("http://localhost:8088/amfphp/gateway.php");
      responder = new Responder(OnPass,OnError);
      showAlBtn.addEventListener(MouseEvent.CLICK,doAvailable);
      function doAvailable(evt:MouseEvent):void
      gateway.call("Books.getBooksAvailable",responder);
      function OnPass(res:Object):void
       var i:int;
      albumDG.removeAll();
      for (i=0;i<res.length;i++)
      albumDG.addItem(res[i]);
      function OnError(res:Object):void
      trace("Error");
    .This is the code for the php code that works because I already tested it out because it allows me to type yes and it shows me the required information that I need and it is not tested on flash cs6 but on local host things that allows me to test it out.
    function getBooksAvailable($avail)
      $this->connect();
      $sql = "SELECT title as 'Book Title', author as 'Author', price as 'Price', available as 'Available'
      FROM tblbookinventory
      WHERE available ='" . $avail . "'";
      $result = mysql_query($sql, $this->_connection);
      $rows = array();
      while($row = mysql_fetch_array($result, MYSQL_ASSOC))
      array_push($rows, $row);
      return $rows;

    use the urlloader class to call your php file. 
    the php function you showed is expecting a variable ($avail)  that might accept a value of 'yes'.

  • How to make pics visible that was received through mobil/PC/Bluetooth?

    Does anyone know how to make pics visble, that has been recieved through emails/mobil/PC/Bluetooth to Mac or vs?
    I am able to see some pics, but some again I am not able to see in anyway, and these are standard pics taken from typically commercially available cameras, and some pics are too small to be useful. But than other they are that well to be used in many ways!
    Anyone faced similar issues?

    Hello @_goma,
    Welcome to the HP Forums, I hope you enjoy your experience! 
    I have read your post on how you are looking to make your computer send all the audio through an optical audio cable instead of the headphone jack, and I would be happy to assist you in this matter!
    To configure your desktop to enable the optical audio cable, I recommend following the steps below:
    Step 1. Click the Windows Key Button on your desktop
    Step 2. Type "Control Panel"
    Step 3. Select "Control Panel" in the top right-hand corner
    Step 4. Select Sound
    Step 5. Under the Playback tab, right-click the white area below the devices available
    Step 6. Select "Show Disabled" and "Show Disconnected Devices"
    Step 7. Connect your Optical Audio Cable
    Step 8. Select your Optical Audio Cable as the default device and click "Enable"
    Since it is not possible to convert the HDMI out to audio out on your notebook computer, it is unfortunate that the notebook is not able to connect with an optical audio cord.
    Please re-post with the results of your troubleshooting, and I look forward to your reply!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • HOW TO MAKE ROUND BUTTON

    HI PLS TELL ME HOW TO MAKE ROUND BUTTON ON FORM.

    Rounded end buttons (e.g. Oracle Look and feel) are do-able in both 6i and 9i using PJCs in the 9i demos see the rollover button example, in 6i I seem to remember that there is a RoundedButton sample in the demos.
    Both sets of demos can be downloaded from http://otn.oracle.com/products/forms.
    If you want circular buttons then you'd have to use an Image for that.

  • Can someone tell me how to make the letters that look like fabric?

    Can someone tell me how to make the letters that look like fabric?

    pharrout wrote:
    Can someone tell me how to make the letters that look like fabric?
    It could be as simple as clipping an image of the fabric of your choice, to a text layer.
    In this example the Hessian texture was downloaded from Google images, and placed over a Type layer.  You then Alt (Opt) click the intersection of the Type and Hessian layer to clip them together.  This just means that only the shape of the underlying layer will show in the clipped layer.

  • Is it possible to make a button that adds extra pages?

    I'm trying to make a form that consists of three pages. However, I would like to have a button at the bottom of page 2 that can be used to duplicate page 2 as a continuation sheet - including the same button, which could then be used to create a 3rd copy as another continuation sheet if needed, and so on.
    I can't think of a way of doing it. Even if I managed to duplicate the page, the new copy would be pre-populated because the fields would have the same names. Therefore I'm now wondering if it's possible to make a button that would effectively unhide entire pages to achieve the same thing. Then I could perhaps create the form with nine copies of page 2, and unhide them one at a time based on use of the button. Again though, I'm not sure that's possible, and even if it is it would be pretty inelegant.
    Anyone have any bright ideas or alternative approaches I might not have considered?

    It is possible to do using the templates feature. If it needs to work with Reader, the only version that supports it without having to apply usage rights with LiveCycle Reader Extensions ($$$$) is Reader 11, so all of your Reader users would have to update to the latest version.
    Templates can be spawned so that the fields are automatically renamed, avoiding the issue you mentioned.

  • Why not make a phone that can hold two different s...

    Why not make a phone that can hold two different sim cards ?

    11-Jan-2009 10:18 PM
    hermandh wrote:
    Why not make a phone that can hold two different sim cards ?
    I guess time will come...but I don't see the main point of having two sim cards on a phone at the same time?
    Knowing the phone won't let this go on, Can you take up two calls at the same time? Probably not.
    =)

Maybe you are looking for

  • How to start video chat with another mac

    i tried to start a video chat with my daughter living in another province. what do we have to do to start the video chat?

  • Backing up ipad to computer

    backing up ipad to computer?

  • Related to smart form

    Hi guys,        I got strucked in smart forms.I developed one smartform.After executed it generated one FM. In driver program i called SSF_FUNCTION_MODULE_NAME, and i passed parameters formname,fm_name as V_FNAME. after that i have to call the functi

  • Security Certificate Not Trusted

    One of my clients is getting an warning when loading their site in Chrome. I can't replicate the issue on any of my systems. Does anyone know why this is happening or how to fix it?

  • How insert a new material in between through me22n

    hi, I am not sure whether this is right forum or not to ask this question. But in quest of searching a solution to my problem I am putting my question: how to insert in between two material line-items a new material to keep sequence of ordering stock