Can I make a function wait for a period of time?

Hey everyone
I just wanted some idea's on how best to tackle this problem
in actionscript.
All I want is that when a button is pressed it fades out the
current page and then fades in the new page to be displayed. How
ever when trying to fade out the current page i doesn't because it
goes to the label and starts to play but the next part of the
script tells it to go straight to the label to load the new page.
Does anyone have a clever way of making it wait till the current
page is faded out?
If worse comes to worse can I just make it wait a set period
of time before fading in the new page?
Ive attached a bit of the current code and comment it with
where the current page is faded out.
Thanks in advance for any help
Gaunt

What I'm struggling to get my head round though is how to I
get it to know when the fade out code is finished?
Because the way I have programmed it at the moment,
everything is done from one action script that registers the last
viewed page and then when the new page is clicked it will just call
gotoAndPlay to the point where my pages_mc will play fading out the
current page, then after that it will call gotoAndPlay on the
pages_mc to play the fade in of the new page.
I just dont see how I call the second gotoAndPlay function
once I know the first gotoAndPlay function has ended.
Does that make any sense or am I just being stupid??
Thanks for the help again though kglad

Similar Messages

  • Having program wait for a period of time

    I have a program that I am creating that will need to paint something to the panel every few seconds. I have some code like so:
    public void paintBar(Graphics g, Graphics2D g2)
              for(int i = 0; i < 325; i++)
                   //draw a rectangle
                   double leftX = 36;
                   double topY = 76;
                   double width = i;
                   double height = 48;
                   double test = 100;
                   Rectangle2D rect = new Rectangle2D.Double(leftX, topY, width, height);
                   g2.setPaint(Color.yellow);
                   g2.fill(rect); //fill rectangle with color
                   g2.setPaint(new Color(204, 204, 153)); //change paint to background color for erase
                   eraseMessage(g);
                   calculatePercentage(i);
                   g2.setPaint(Color.black); //change paint color back to black for message
                   printMessage(g);
    //NEED TO WAIT HERE FOR A PERIOD OF TIME
    //THEN CONTINUE WITH LOOP.
    The problem that I am having is that I tried to use different wait() meathods and it seems to get to the wait meathod and just freeze. The painting is never done until the wait command is complete and then the all of the painting is totally finished. I never see it progressing.
    Any ideas?
    Thanks

    You could use a scheduled event...
    public void run() {
         Timer timer = new Timer(false);          // Create Timer
         class Refresh extends java.util.TimerTask {     
              // Create repaint event
              public void run(){repaint();}
         timer.schedule(new Refresh(),0,10);     // Schedule repaint
    }Call this when you run your program, and place all your paint and update methods into a paint(graphics g) method.
    Then, the timer will continuously run repaint repeatedly.
    You can then insert a single event timer (i don't know how off hand, but they are in the API under Timer events), that kills the origional event timer after X ammount of time.

  • 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

  • Can I make PDFs expire after a specified period of time?

    I found some older articles elsewhere, but they are fairly dated.
    Is it still possible to generate, created etc. PDF's and specify a time period that it would then expire?
    SO PDF1 is set to expire in 1month, PDF2 is set to expire in 6 weeks etc.
    Thanks for the help.

    Hi boldycreative,
    I believe you can do that using some JavaScript, as outlined on this page: Basic Document Level (Document Open) Scripts.
    But, it can be easily disabled by somebody who knows JavaScript.
    Best,
    Sara

  • Possible loop deadline monitoring for a period of time?

    Hi All,
    Here is our scenario.. We have a task sent to the managers inbox with deadline monitoring on it.  If the manager does not action this task, we set this task to obsolete and then we want to send a reminder email every day until the manager performs the required action.
    So the problem.. originally this email was to be a task but the loop would not work with the task as it's waiting on action from the user.  We changed this task to an email and it looped as expected however the only way I could think to put a wait for a period of time before another email is sent is by actually counting down the time in a method.
    However, the problem with this is that wf-batch is locking the worklfow so it can never complete, even if the event to complete the workflow is triggered.  wf-batch has it locked so the workflow can never complete, so it loops infinitely.
    So my question.. is it possible to repeatedly send notifications to a manager at specifically defined time intervals without locking the workflow?
    Below is how the workflow currently looks:
    Any guidance on this would be most gratefully received!
    Thanks in advance,
    Liz.

    Hi Liz
    in your wait step, do not count down the time.
    Instead keep the method as a dummy method with no code.
    In the wait step, use the deadline monitoring - Requested Start - set it to current date + 1 day
    The step will start 1 day after 'today' , execute nothing in Dummy method and then go on to the mail step
    I am sure that the deadline monitoring job is running because "Latest End" of the first task is executed in your system. So the same job will take care of Requested Start of the wait step.
    regards,
    Modak

  • TO STOP WORKFLOW TEMPORORILY for a period of time

    how can i stop running workflow tempororily for a period of time
    for ex: 7 days.
    any one pls answer this,its urgent
    if not pls send any links regarding this topic...

    hi  krishna,
    thanks for u  r reply,
    i created custom function module z*********.
    in swe2 for check FM text box i  assigned that fn module
    In workflow builder start conditions
    when click on that start conditions pop screen is appeared
    to choose any one.
    for the current scenario
    --which option i have to choose when i click on start conditions button .
    --i have created date attribute in object type,In function module how can i access object attribute to write a condition in function module.
    --can u send me the logic please.

  • How can I make a bootable disk for Mountain Lion?

    How can I make a bootable disk for Mountain Lion?

    Make Your Own Mountain/Lion Installer
    1. After downloading Mountain/Lion you must first save the Install Mac OS X Mountain/Lion application. After Mountain/Lion downloads DO NOT click on the Install button. Go to your Applications folder and make a copy of the Mountain/Lion installer. Move the copy into your Downloads folder. Now you can click on the Install button. You must do this because the installer deletes itself automatically when it finishes installing.
    2. Get a USB flash drive that is at least 8 GBs. Prep this flash drive as follows:
    Open Disk Utility in your Utilities folder.
    After DU loads select your flash drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID then click on the OK button. Click on the Partition button and wait until the process has completed.
    Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    Click on the Erase button. The format process can take up to an hour depending upon the flash drive size.
    3. Locate the saved Mountain/Lion installer in your Downloads folder. CTRL- or RIGHT-click on the installer and select Show Package Contents from the contextual menu. Double-click on the Contents folder to open it. Double-click on the SharedSupport folder. In this folder you will see a disc image named InstallESD.dmg.
    4. Plug in your freshly prepared USB flash drive. You are going to clone the content of the InstallESD.dmg disc image to the flash drive as follows:
    Double-click on the InstallESD.dmg file to mount it on your Desktop.
    Open Disk Utility.
    Select the USB flash drive from the left side list.
    Click on the Restore tab in the DU main window.
    Select the USB flash drive volume from the left side list and drag it to the Destination entry field.
    Drag the mounted disc icon from the Desktop into the Source entry field.
    Double-check you got it right, then click on the Restore button.
    When the clone is completed you have a fully bootable installer that you can use without having to re-download Mountain/Lion.
    Note: The term Mountain/Lion used above means Lion or Mountain Lion.

  • I have snow leopard, 10.6.8 on my mac pro.  would it make sense to wait for mountain lion in the summer vice upgrading to Lion then mountaion lion?

    i have snow leopard, 10.6.8 on my mac pro.  would it make sense to wait for mountain lion in the summer vice upgrading to Lion then mountaion lion?

    Nobody can tell you that.  We don't yet know what the pricing will be or what kind of compatibility issues may arise.  If you don't need anything in Lion right now, you can certainly wait, and if you do find the features of Lion compelling, there's no reason to wait for 6 months.  Buy what you need when you need it, and don't worry so much about what's ahead...  there's always something new coming soon!

  • How can I make a intro page for my website, then after the intro has run make the page automatically change to my we site home screen

    how can I make a intro page for my website, then after the intro has run make the page automatically change to my website's home screen

    You can do this using a meta refresh but the problem is you have to add it to the html file for the page very time you publish changes.
    A better way is to create a splash page and upload it to the server outside of the folder produced by iWeb. Example HERE.
    The meta refresh is added to the head section of the html file...
    <meta http-equiv="refresh" content="32;url=http://www.domain.about.com/Page-Name.html">
    The delay time in seconds is marked in blue and the URL to the redirect page is in red.

  • How can I make a "property node" for a VI?

    Hello!
    If I add a boolean button on the FP then I am able to make a property node for that button in the Block Diagram. But how can I make a property node for a VI? I have several VI:s an that together is one program. What I need to do is to verify what kind of VI some of my VI:s is. I need to verify if it is .exe or .vi-file, and if it is .exe then I want to disable run, abort, run continuously bottons otherwise not. I have hard that this is possible to do programmaticaly but I can´t figure out how. I am aware that I could do that manually in the File->vi properties->customize->windows appearance but theese choises makes it last forever.
    I want to be able to stop and run and everything if it is a .vi file, but if it is .exe-file then all those buttons should be disabled.
    Anyone have an example on this?
    In an other message at this Forum I read "You can use the `Front Panel Window. Allow Runtime PopUp`" property to disable run-time shortcuts menues programmaticaly, but still I dont know how to create this property node.
    /Amir

    You really shouldn't open a new thread. If you don't understand something, ask and we will explain it.
    Like I said in the other thread, you can check if you are running in LV or an EXE by using the Application>>Kind property. To get it, place a property node (from the Application Control palette) on the diagram, click it and find the property.
    To set the properties for the VI, place another property node, right click it and select Select Class>>VI Server>>VI. You should have the properties you want under Front Panel Window.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf). I believe chapter 17 of the user manual explains about programmatic control of VIs.
    Try to take over the world!

  • Can applw make a new software for Iphone 3g with multitasking

    can apple make a new software for Iphone 3g with multitasking

    No. Apple stated that the 3G does not have the processing power to provide multitasking to Apple's reuired standards.

  • Realtek network card seems to be disappeared. how can i make it visible again for the OS?

    i can't access my LAN card. somehow it is disappeared. how can i make it visible again for the OS? my OS is windows 7. thanks very much for your help

    right click on the button bar, then select "customize toolbar", drag any button you like into the toolbar and you're done!
    Diego

  • How can i make Apple id free for downloading apps

    how can i make free apple ID for downloading apps?

    No thats false thers an other way go to App Store ( on iphone or itunes) then choose any free app click download the App Store will ask you for your apple id the click in this dialog on create new apple id then you should select by Credit Card None, thats a trick, you don't need a credit or itunes card
    PS: Sorry for my bad english

  • Can we make two shipment cost for one outbound delivery

    Hi team,
    Can we make two shipment cost for one outbound delivery?
    Need your suggesstions.
    Regards
    Venkat Ramana

    Hi
    I do not think that you will get a reply now as it has been too long.
    Maybe the answer is not known.
    However as the forum is growing and it takes so much time to get through all of the pages it would be nice to keep it current so could you please close your thread and either re-open a new one (this might help as people are more likely to look at curret ones) or try another forum.
    This will make life easier for everyone
    Regards
    Frenchy.

  • How can I make lining number format for opentype fonts in Acrobat?

    How can I make lining number format for opentype fonts in Acrobat?

    I bought the Max OT font. I want the numbers on the right to look like on the left. I could do that in word, but not in adobe acrobat.

Maybe you are looking for

  • .jar file is not working properly :developed in NETBEANS

    Hi Gurus, i am using NETBEANS IDE 7.2. i am developing a project that interacts with databases 10g and COM ports of machine , these all processes are performed by .bat file which i am trying to run from jFramform , code works perfectly .bat file is a

  • How can I share my iPhoto '08 Library with another user account?

    I found a post that tells how to share my library so that two user accounts on my iMac have full read and write access to my iPhoto Library, but I can't find the Library. It should be under /users/myname/pictures/iphoto library/data according to a Sp

  • Report to forecast based on fiscal period

    Has anyone done any financial reports which display data based on fiscal periods? The ProjectData service doesn't expose fiscal period (neither does the REST API under _api/ProjectServer). I saw a previous post (http://social.msdn.microsoft.com/Forum

  • Hardware key is not displayed in SAP B1 8.81

    Hi, We installed  SAP B1 8.81(Evaluation version). Hardware key is exists in     Service manager -> Licence Manger. But it is not displaying in   Client  System 's       Help -> About SAP Business one. Please let me know how to retrieve hardware key.

  • Microsoft Word 2004 Help

    Hi, I have a word Document and I was wondering how i could turn it into a PDF?