How to make a loop that changes two different movieclips from visible to invisible every second

I am writing some code that puzzles me. It may be, because I have a cold or because I've never needed to do anything like this. I want to have two movieclips one is visible and one is not. then one second passes the one that was visible is invisible and the invisible one is visible. What would be the best approach to this, besides handcoding if statements. I know there has to be a faster way and less expensive way than handcoding if statements.
I'd like to thank anyone who replies in advance .

this is how i would do it
package
          import flash.display.MovieClip;
          import flash.display.Sprite;
          import flash.events.TimerEvent;
          import flash.utils.Timer;
          public class Main extends Sprite
                    private var mc1:MovieClip;
                    private var mc2:MovieClip;
                    public function Main()
                              // create your mc's here
                              mc1 = new MovieClip();
                              mc2 = new MovieClip();
                              mc2.visible = false;
                              var timer:Timer = new Timer(1000);
                              timer.addEventListener(TimerEvent.TIMER, loop);
                              timer.start();
                    private function loop(e:TimerEvent):void
                              mc1.visible = !mc1.visible;
                              mc2.visible = !mc2.visible;

Similar Messages

  • Report that uses two different queries

    I need to make a Report that uses two different queries. It would do one query, then the second, putting the results one after the other on the page.
    Using the wizard, I put in the first query, and it will generate output from this first query.
    I am able to put the second query in the Report, but when I try to use something from the second query, it gives a message about accessing a field below its frequency.
    In the Reports forum, there is a reference to
    tons of samples available in
    builing reports doc 1. http://download.oracle.com/otn/other/general/B10310_01.pdf
    But the link is broken.
    What can you tell me?
    Thanks, Wayne

    What you're trying to accomplish is possible. Now that you've got the second query, add a new repeating frame in the layout editor below the first area. Open the property palette for the new repeating frame and set the source to the second query. Then add fields from the second query.
    Also, remove the fields you have for the second query from the first frame that was created by the wizard; that's what's causing the error about accessing a field below its frequency.

  • 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.

  • How to make a loop run for specific period of time ?

    hello !
    i'm new to labview and could'nt found how to make a loop run for 2 sec for example, and then to exit.
    Solved!
    Go to Solution.

    Hi Hookso,
    You can do it using the different loops like While loop and For Loop. Roderic has already stated how to do it using a for loop. I have illustrated in the attached vi how to do it using a while loop and Elapsed Time function. Take a look.
    Regards,
    Nitzz
    (Give kudos to good Answers and Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 2.vi ‏36 KB

  • How to make a curve to join two objects editable?

    Hi, I'm involved in a project in which we're doing a visual editor (written in Java). Now, I'm trying to make curves that join two different objects that I'm painting in a class that extends JPanel (this class is what I'm using to paint, inside a JFrame, overriding the method paintComponent). I'm in troubles because I'm using the class QuadCurve2D to make this, but I cannot make it clickable (I'm using the method contains, but it doesn't work everytime), make it editable (for example, setting a square in its middle point to modify its curvature. The point that is used on the middle of the QuadCurve2D when the constructor is called is outside the curve) or something (method, variable, iterator, etc) that could tell me which Points are in the QuadCurve2D.
    After looking for all of that some time, I have no answer, so I'm trying posting it here to find a solution. Is there anyway to make it with the QuadCurve2D class, or do I have to try with some external library?
    Edited by: mccrank on Jul 2, 2009 10:09 AM

    Used the Pen tool, but click on the correct icon on the top left on the Options Bar. That way you can get a Path instead of a Shape Layer.
    Once you have your Path you can stroke it with a Brush or any drawing tool. Various options appear in the Brushes palette. For a dotted line you will need to increase the spacing. If you want dashes, use a square brush and set the Angle Jitter to Direction.

  • How to make af: query (ResultComponentId) has two target values?

    hello all :D
    i'm newbie in jdev, i have little problem with af:query.
    how to make af: query (ResultComponentId) has two target values?
    thx
    agungdmt :D

    I think you can simply set the second target control's partialTrigger to the af:query.
    and access to the same binding attribute as your first target. (e.g.: if you have 2 target tables, set the value to #{bindings.XxxxxVO1.collectionModel})
    Samson Fu

  • How to make an app that uses plugins???

    Hello All,
    I am relatively new to programing and i have never done some thing like this so what i would like to know is.
    How can i make an app that can get/load plugins from a folder and then use them to copy files from one place to another(i got he copy part down just need the plugin part.
    And then i need to know how to parse the location of the file that needs to be copied and the folder it needs to be copied to into the plugin.
    Thanks in advance.

    What you do it to define a common interface which plugins have to implement. Typically you place the .class files for the plugins in a special directory (not on the class path) and you create a URLClassLoader to load the plugin classes. Class names (FQNs) for plugins are usually in some kind of configuration file.
    One you load the class you'll usually create a single instance (with Class.newInstance()) and cast it to the common interface. It's simpler to use a no-args constructor and define some kind of initialize method in the interface to initialise the plugin. Typically you pass some kind of context object when you initialize the plugin, which the plugin can use to comunicate with the framework.

  • How to change two different iCloud account from mac and iPhone?

    How to change two different iCloud account from mac and iPhone?

    Pick one to use, abandon the other.

  • How to Launch an Integration Builder under two different java versions

    How to Launch an Integration Builder under two different java versions     1
    1. Situation     2
    2. How To Do     2
    2.1 jre preparation     2
    2.2 Put them into the system     2
    2.3 Execute a Java Web Start under jre 1.4.x version     3
    2.4 Change Java Runtime Versions     3
    2.5 Launch an Integration Builder     6
    1. Situation
    OS: windows 2000 pro – English
    Java version: jdk 1.5.x was already installed. (It’s not permitted to change.)
    I don’t have any authorization to install any software on the PC.
    But I need to use an Integration Builder.
    I already knew URLs of an Integration Builder (http://<hostname>:50000/rep/start/repository.jnlp).
    2. How To Do
    At this moment, an Integration Builder (XI 3.0) can be launch under jre 1.4.x environment (on windows).
    2.1 jre preparation
    I download j2re-1_4_2_10-windows-i586-p.exe from http://java.sun.com/j2se/1.4.2/download.html
    I installed it on my home PC and copied all files from C:\Program Files\Java\ j2re1.4.2_10\ into my USB.
    2.2 Put them into the system
    I pasted j2re1.4.2_10 folder from my USB into the windows 2000 pro system.
    Finally, I could list up all of javaws.exe under this system.
    c:\j2re1.4.2_10\javaws\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\bin\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\jre\bin\javaws.exe
    c:\Program Files\Java\jre1.5.0_05\bin\javaws.exe
    2.3 Execute a Java Web Start under jre 1.4.x version
    I executed c:\j2re1.4.2_10\javaws\javaws.exe .
    2.4 Change Java Runtime Versions
    Go to File-> Preferences -> Java
    As you can see, it indicates 1.5 version.
    Click [FIND] button.
    Click [NEXT] button.
    Click the j2re1.4.2_10 folder.
    Click [NEXT] button.
    A JRE Finder is able to find javaw.exe automatically. Or you can indicate C:\j2re1.4.2_10\bin\javaw.exe directly.
    Click [NEXT] button.
    Finally, there are two Java Runtime Versions. Now you need to uncheck the Enabled column of 1.5 version and check 1.4 version.
    Click [OK] button.
    Well, in the General tab, I selected None for Proxies.
    2.5 Launch an Integration Builder
    In the Location field, I typed the URL of an Integration Builder jnlp.
    http://<hostname>:50000/rep/start/repository.jnlp
    SAP Integration Builder comes up inside Applications area.
    Select it and click [Start] button.
    If you click Environment-> Integration Builder (Configuration), you can launch Integration Builder: Configuration.
    [PDF file location] with screenshots
    http://SDN.mobilian.org/SDN/How2LaunchIB.rar
    ===================Advertisement==========================
    How do you search SDN?
    What about [<b>SDN Search Widget</b>]?
    SDN Search Widget
    =========================================================

    I am not getting anywhere with deploying my application or
    applet.
    I have set up my bc4j project. It contains all my VO info,
    links, application module. (proj a)
    I then have another project with DbInfo in it(has all my rowset
    info), Multiple Frames, and my Applet.java file.
    Actually I have an Applet.java file and a Application.java file
    because I was seeing if both/either worked. Anyway they seem the
    same, except for that extra window that comes up when you run the
    applet.
    I follow the steps in the oracle directions (from earlier post).
    And all seems ok. But at ---->
    [*] Select the subdirectory under myhtml where your applet's HTML
    file
    is located, and enter the directory path of the 'staging'
    directory you
    created in step 3 above, if different from the default.</li>
    [*]Select the HTML files that JDeveloper created to run your
    applet.</li>
    [*]Select all of the Java source files in your project that make
    up the
    applet.</li>
    I have no HTML file associated with my applet, at least that I
    know of.
    So do I need to create one, or should it of been done
    automatically.
    Also, I trying to figure out what will be the best way to deploy
    my project. Applet or stand alone application is what my first
    choices have been so far. I have read that there is some issues
    with applets being served from a different server than the
    database. So a stand alone application was my front runner, but
    I haven't gotten either way to work yet.

  • How do I create a bookmark in two different pdfs?

    How do I create a bookmark in two different pdfs

    Provided you only want to go one way, you can change a bookmark to fire the "open a file" action. I 'm not sure you entirely understand the terminology though - bookmarks in a PDF file appear on the left side panel and usually take you to a defined page in the current document. They are not part of the page and so don't change as you move through the file. Links are regions on a particular page that act as click points, and can do pretty much anything (move to a different page, open a file, etc.). Although you can use bookmarks to do something other than switch pages, it's very rare to do so and won't necessarily be supported by third-party software (or obvious to your users).
    If you want to create a bookmark to another document, and both files are going to be distributed together (in the same folder) then you can create a new bookmark (doesn't matter where in the source file you are..) then select it and from the options menu choose Properties. Switch to the Actions tab and delete the "go to a page" entry, then from the dropdown list choose "Open a file" and browse to your destination document.
    If your destination file is an attachment to your source file, you should use the "Go to page view" action, and when the tiny dialog box appears you should open the attachment, then click the OK button.

  • How to display the entire application in two different languages in apex

    Hi,
    How to display the entire application in two different languages in apex...
    For example i need to display each item in both English and Hindi..
    To achieve this initially i have the select the language otherwise the item label alone ll be displayed in both languages ...
    Anyhow how it ll be apex is it possible
    Regards,
    Pavan

    Hi pars,
    http://www.packtpub.com/sites/default/files/1346-chapter-6-creating-multilingual-apex-applications.pdf?utm_source=packtp…
    In this link also i struck in
    In page 10  of that document
    The application is now ready to be translated. Everything is in place to run it in any language imaginable.To ca ll the application in another language, change the URL of your application to the following:
    http://yourdomain:port/pls/apex/f?p=&APP_ID.:&PAGE_ID.:&SESSION_ID.:LANG:NO::FSP_LANGUAGE_PREFERENCE:nl
    This example will call the chosen page in the application and show it in the Dutch language instead of in English. To select another language change the property nl at the end of the URL to your desired language code.
    Thanks alot for ur suggestions.kindly provide more inputs..............

  • How to make iTunes read the song's name/singer from the file's name itself?

    Hi everyone,
    So I have this file with songs from everywhere. I spent quite some time now to make sure that the structure of each file's name is as such : "Singer - Song name", hoping that everything would be read by iTunes accordingly. However, either iTunes read it well, or it didn't read it at all ("Singer - Song name" appearing in Title alone), or iTunes read the "media" of the file (ie. what the guy I downloaded it from wrote for it in the Preferences, which usually is in capital letters or with a bunch of weird underscores). As I'm OCD and need everything to be neat, I'm highly tensed right now. I really want everything to be neat and clear!
    So, how do I make sure that iTunes reads the files' names such that it knows the structure is "Singer - Song name"? Thanks.

    iTunes doesn't use file names to determine how music appears in your library,  Rather, it uses metadata that is split between:
    data elements that are embedded within the media files
    data elements that are included in the entries in the iTunes database
    No amount of reorganization, renaming or other manipulation at the file level will make any difference to how songs will appear in iTunes.  Using your example:
    the value of the track number element is 1
    the value of the artist element is "Elvis Presley"
    the value of the song name element is "Blue Suede Shoes"
    Depending on how you configure iTunes then the file name is either:
    completely independent of iTunes (i.,e., the file containing this song could be xyz.mp3)
    dependent on the metadata managed by iTunes, (i.e., when you have these two options set:
    then iTunes will set the file name to be 1-01 Blue Suede Shoes.mp3 where:
    the file is in a folder called "Elvis Presley" (the name of the album)
    that folder is in one called "Elvis Presley" (the name of the artist) which is in iTunes Media\Music
    Going back to your question "How to make iTunes read the song's name/singer from the file's name" the answer is simple - you can't, as this is not how iTunes works.  There are some third-party utilities that you can use to set some metadata element values based on parsing of file names which might be a useful first step.  However, to use iTunes effectively you should really forget about / ignore file names - manage your media using appropriate metadata and allow iTunes to look after file names behind the scenes.

  • How can I Generate two different reports from single execution of Test cases in NI teststand

    Hi,
    My requirement is to generate two different reports from NI teststand. One for the Logging of error descriptions and the other report is by default generated by the Teststand. How can i generate a txt file that contains error descriptions other than that mentioned in the default report?
    Solved!
    Go to Solution.

    Do you need to do that just for these two sequences but not for other sequences? I don't see a problem to use SequenceFilePostStepRuntimeError. Create this callback in both sequence files and configure them to log into the same file. SequenceFilePostStepRuntimeError callback is called after each step of the sequence file if it has runtime error. You can access the calling step error information via RunState.Caller.Step.Result.Error property. Take a look to attached example.
    The "other way" is useful if you need to log errors not for every step of the sequence file, but for some of them. This is more complex, because you need to create a custom step types for these steps. For the custom step you can create substeps (post-step in your case) which will be executed every time after step of this type executed. Then, this is you job to determine if error happened in the step, acces to step's error information is via Step.Result.Error property. 
    Also, be aware that step's post-expression is not executed in case of error in the step.
    Sergey Kolbunov
    CLA, CTD
    Attachments:
    SequenceFilePostStepRuntimeError_Demo.seq ‏7 KB

  • How can I put a contact in two different groups?

    How can I put a contact in two different groups.  I downloaded Glite and have developed many groups, but I have some contacts that I would like to include in two different groups.  Any solutions?

    If I want to copy a contactl to another address-book I simly hold down the ctrl-key when I drag and drop

  • How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    Hi Libby,
    Select all three columns of data. All three must be 'regular' columns, not Header columns, and the X values must be in the leftmost column.
    Click the Charts button and choose the Scatter chart.
    The resulting chart will initially show only the first and second columns of data, and the selection will have been reduced to show this.
    Click the gear icon at the top left of the selection and choose Share X Values.
    You should see a result similar to this:
    Notes:
    The values on my sample table contain a random element, so they have changed from thhe first image to the second.
    The chart is as created by Numbers, with two edits:
    Data points have been connected with curves, using the Chart nspector.
    The curves were selected and their stroke increased to 2pts, using the stroke formating button in the format bar.
    Regards,
    Barry

Maybe you are looking for