ActionScript: How to Re- setInterval Each Time Function Works?

I have a function that draws a rectangle on the screen (see createInfoPanel())
While drawing rectangle, I am adding 2 text fields on it.
But as you may guess, it is adding those immediately.
I want to delay adding these text fields, then I want to remove these panels after a while.
The problem is, when I set an interval or timer, they won't work after I using once (I had to stop them by clearing/removing, it didn't set them again).
Since my panel is being created each time image changes, I need them to work every time image changes.
So, I have 2 questions:
1- How can I re-set interval each time my createInfoPanel() function works? It won't work anymore after setting and claring once. 
2- You can see infoPanel.addChild(titleField); line in addInfoPanel() function. How can I work a smooth animation here? I mean, text appears slowly? 
Thanks in advance.
Code file:
public class ImageRotator extends Sprite
private var ... ; //Some variables
public function ImageRotator(xmlPath:String = "images.xml", interval:int = 8301):void
    timer = new Timer(interval);
    loadXML(xmlPath);
private function loadXML(file:String):void
    urlLoader = new URLLoader(new URLRequest(file));
    urlLoader.addEventListener(Event.COMPLETE, parseXML);
private function parseXML(e:Event):void
    xml = new XML(e.target.data);
    loadImages();
private function loadImages():void
    for (var i:int = 0; i < xml.children().length(); i++)
        var loader:Loader = new Loader();
        loader.load(new URLRequest(xml.children()[i].@src));
        imagesVector.push(loader);
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, sortImages);
private function sortImages(e:Event):void
    imagesCounter++;
    for (var i:int = 0; i < imagesVector.length; i++)
        imagesVector.reverse();
        addChild(imagesVector[i]);
    //I have only 3 images, I needed to set indexes because
    //they were covering each other
    this.setChildIndex(imagesVector[2], 0);
    this.setChildIndex(imagesVector[1], 0);
    this.setChildIndex(imagesVector[0], 0);
    if (imagesCounter == imagesVector.length)
        createInfoPanel();
        timer.addEventListener(TimerEvent.TIMER, autoChange);
        timer.start();
private function createInfoPanel():void
    infoPanel.graphics.beginFill(0x000000, 0.0);
    infoPanel.graphics.drawRect(0, 0, 967, 138);
    infoPanel.graphics.endFill();
////Here I want to run addInfoPanel() function with 2 seconds delay,
////After it starts, I want to run removeInfoPanel() function with 2 more seconds delay
    addChild(infoPanel);
private function addInfoPanel():void {
    titleField.text = xml.children()[infoCounter]. @ title;
    titleField.x = 425;
    titleField.y = 0;
    description.text = xml.children()[infoCounter]. @ description;
    description.x = 427;
    description.y = 26;
    infoPanel.y = 300;
    infoPanel.addChild(titleField);
    infoPanel.addChild(description);
private function removeInfoPanel():void {
    infoPanel.removeChild(titleField);
    infoPanel.removeChild(description);
private function addActions():void
    //Some function
private function changeImage(e:MouseEvent):void
    //Image changing function
private function changeDepth(e:TweenEvent):void
    //Some function
private function autoChange(e:TimerEvent):void
    //Some function
Edit: How I used to work the intervals:
private function createInfoPanel():void
    //lines above code sample
    intervalInfoPanel = setInterval(addInfoPanel,2000);
    addChild(infoPanel);
private function addInfoPanel():void {
    //lines above code sample
    clearInterval(intervalInfoPanel);
    intervalInfoPanelRemove = setInterval(removeInfoPanel,3500);
private function removeInfoPanel():void {
    //lines above code sample
    clearInterval(intervalInfoPanelRemove);

Hi,
No, no debug/runtime, I also export my movieclip.
Here's how I use:
import com.greensock.*;
private function sortImages(e:Event):void
    imagesCounter++;
    for (var i:int = 0; i < imagesVector.length; i++)
    imagesVector.reverse();
    addChild(imagesVector[i]);
    if (imagesCounter == imagesVector.length)
    createInfoPanel();
    timer.addEventListener(TimerEvent.TIMER, autoChange);
    timer.start();
private function createInfoPanel():void
    infoPanel.graphics.beginFill(0x000000, 0.0);
    infoPanel.graphics.drawRect(0, 0, 967, 138);
    infoPanel.graphics.endFill();
    addInfoPanel();
    addChild(infoPanel);
private function addInfoPanel():void {
    infoPanel.y = 300;
    titleField.text = xml.children()[infoCounter]. @ title;
    titleField.x = 425;
    titleField.y = 0;
    description.text = xml.children()[infoCounter]. @ description;
    description.x = 427;
    description.y = 26;
    titleField.alpha = 0;
    TweenLite.to(titleField, 1.0, { alpha: 1 });
    description.alpha = 0;
    TweenLite.to(description, 1.0, { alpha: 1 });
Nothing appears...

Similar Messages

  • How to run rmiregistry each time windows starts

    Can anybody tell me how to run rmiregistry each time windows starts.
    I want to start my RMIserver automatically to work.First I need to start rmiregistry then I want to start my RMIServer class as windows service.

    Stick a shorcut to it in your Startup folder or create a new Key in the registry @ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    If you have arguements to rimreg (like port number) create a .bat script and use that to launch it.

  • How do i get face time to work on i phone 4?

    How do i get face time to work on my i phone? step by step instructions please
    How do i get my photos from i phone 4 to display on my TV? as advertised on the television.
    Thanks

    The manual will tell you:
    iPhone User Guide (For iOS 4.2 and 4.3 Software)

  • How to implement the barcode printing functionality working on the Prod.

    Hi,
    Can anyone help me "How to implement the barcode printing functionality working on the Prod".
    Thanks
    Gangadhara

    Check this link --> barcode

  • How JSP codes residing in js function works

    Hi,
    I would like to check with you how JSP codes residing in js function works.
    How can I get the 2nd select stmt executed based on the values retrieve from 1st select statement and the conditions pass in to this js function
    How can I get the select statement to execute only when a condition is met.
    The following is the codes. It is not executing the 2nd select statement. when I didnt put in the 2nd select stmt, i execute those codes in that portion
    script
    ====
    function test(obj, obj2) {
    <%
    sql_query = "SELECT a1, a2 , a3, a4, a5 "+
    " FROM table_a ";
    try {
    rset = db.execSQL(sql_query);
    catch(SQLException e){
    System.err.println ("Error in query " +e);
    %>
    var po_ln_fnd = false
    <% while (rset.next()) {
    j_a1 = rset.getString("a1");
    j_a2 = rset.getString("a2");
    j_a3 = rset.getString("a3");
    %>
    if ((eval(obj2.value)== '<%=j_a1%>')) {
    if ((obj.value == '<%=j_a2%>') ) {
    <% j_a4 = rset.getString("a4");
    j_a5 = rset.getString("a5");
    sql_query = "SELECT b2, b3, b4 "+
    " FROM table_b "+
    " WHERE b1 = '"+j_a3+"' ";
    try {
    rset = db.execSQL(sql_query);
    catch (SQLException e) {
    System.err.println("Error in query " +e);
    while (rset.next()) {
    String j_b2 = rset.getString("j_b2");
    String j_b3 = rset.getString("j_b3");
    String j_b4 = rset.getString("j_b4");
    %>
    <%}>
    }

    what is the other alternative to produce the same results: (retrieve the data based on the value entered on screen, upon onChange, it will chk whether the condition met, if met, will retrieve data from another table and display on the screen - all this is done without the submit button being pressed)

  • How to write a use time function in elsif

    Hai All
    I have generated an attendance form and my problem is while i am using elsif insert operation there and there is no updation.
    My need is
    this is my table structure
    EMPCODE NUMBER
    EMPNAME VARCHAR2(25)
    BARCODE VARCHAR2(25)
    INTIME VARCHAR2(25)
    OUTTIME VARCHAR2(25)
    INTRTIMEIN VARCHAR2(25)
    INTROUTTIME VARCHAR2(25)
    ATTEND_DATE
    when timing between 0145 and 0630 then update in outtime
    and 0630 to 1000 then insert in intime column
    and 1100 to 1300 then insert in intime column or
    update in outtime column and
    then 1600 to 1730 then to insert into intime column or else
    when intime is not null then update in outtime column
    I have tried and only insert id doing opver there Pls tell what wrong i have made
    declare
    t_in varchar2(25) := :bartime;
         t_out varchar2(25) := :bartime;
    -- t_date dail_att.attend_date%type;
    Begin
    go_block('TEST_SRI');
    FIRST_RECORD;
    LOOP
    if :bartime between 0145 and 0615 and t_out is null and t_in is not null then
    update dail_att set outtime = :bartime where barcode= :barcode
    and ATTEND_DATE = :BARDATE-1 ;
    elsif :bartime between 0630 and 1000 and t_in is null then
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,:bartime,:bardate);
    elsif :bartime between 0630 and 1000 and t_in is null then
    update dail_att set outtime = :bartime where barcode= :barcode
    and ATTEND_DATE = :BARDATE-1 ;
    elsif:bartime between 1130 and 1330 and t_in is null then
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,:bartime,:bardate);
    elsif :bartime between 1130 and 1330 and t_in is not null then
    insert into dail_att(barcode,intrtimein,attend_date)
    values(:barcode,:bartime,:bardate);
    elsif :bartime between 1615 and 1815 and t_in is null then
    insert into dail_att(barcode,intime,attend_date)
    values(:barcode,:bartime,:bardate);
    elsif :bartime between 1645 and 2000 and t_in is not null and t_out is null then
    update dail_att set outtime = :bartime
    where barcode= :barcode and outtime is null and ATTEND_DATE = :BARDATE-1;
    elsif :bartime between 2000 and 2200 and t_in is not null and t_out is null then
    update dail_att set outtime = :bartime
    where barcode= :barcode and outtime is null and ATTEND_DATE = :BARDATE;
    EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' OR :BARCODE IS NULL;
    end if;
    NEXT_RECORD;
    --message('hai');
    END LOOP;
    delete from dail_att cascade;
    forms_ddl('commit');
    forms_ddl('truncate');
    exception
    when others then
    forms_ddl('rollback');
    message(sqlerrm||dbms_error_Text);
    message(sqlerrm||dbms_error_Text);
    End;      
    Regards
    Srikkanth.M

    I got it by converting by date time function
    Edited by: Srikkanth.M on Apr 10, 2010 2:19 PM

  • How do I get Quick Time to work on my computer again?

    Apparently I am old and a dummy and it seems I accidentally uninstalled Quick Time from my computer instead of uninstalling something else that I was intending to uninstall.  How can I get Quick Time back?  I've tried the download from the apple.com site, but it never shows up in a file other than some binary file and I don't have the option to "run" after download, just save to this binary file.  PLEASE can someone help me?  THANKS in advance for any and all help.

    Hi 1 olddummy,
    Welcome to the Support Communities!  First of all, you are not old or a dummy.  I'm sure you can give me hundreds of examples of things you can do because of your knowledge and experience, so give yourself a break .   I just want to clarify .... are you using a Windows computer or a Mac?  I'm going to assume Windows and include an article for you that will explain how to delete the iTunes application and all of it's components (because Quicktime is tied to this program).  This will not affect your iTunes library, only the application itself.   Once that is done, you should be able to work with Quicktime again.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/ht1923
    Cheers,
    - Judy

  • How do you make the 'places' function work in iphoto

    `i have just imported a lot of old photos from my 2007 macbook onto a new macbook pro with ilife 09. `i am trying to make the places function work but can't get it to work. The 'i' icon does not appear in the bottom right hand corner of the events main photo as it's supposed too. Any suggestions?

    Simply open an event; select 1 or more photos and select the i in the lower right corner of a photo thumbnail. You will get the Geocoding window. Start typing the address/place/country in the location area. For detailed addresses you select new place. You can resize the window. Maps from google appears and you select the place it finds. You can even drag the pin to a specific area. Press ok and your done.

  • How to get the Wiki search functionality working?

    hi,
    Another Wiki question regarding the 7.1u1 Portal wiki functionality: What is necessary to get the wiki search functionality working? Right now when using the wiki search page all it does is return to the search form, no errors but no hits either. I guess some additional administrative work is needed to get search working?
    thanks, tom

    haven't touched anything except for the wiki template jsps to change the design. it is a linux rh4 install. there are no communities on that server (yet), just the wiki portlet in a tab so far. is the wiki search dependent on the portal search server or totally separate (ie self contained wiki search)? any additional services or such that need to be started for it to work?

  • How long has the 'hey siri' function worked unplugged?

    I use my idevices and siri everyday for hours, I'm familiar with all of ios' functions. But I just discovered while using my iPhone 6 with ios 8.3 that after you hold the home button down activating siri, then ask a question, as long as you keep the siri screen open the 'hey siri' function works unplugged. Has this been the case since ios 8.0?

    simonp_au wrote:
    Ok, well after I press the home button as usual (unplugged), then ask siri a question, siri then answers. That's the way it has always worked, yes. But, if you leave the siri screen open, while unplugged, then say 'hey siri' siri activates again. Try it. And that has not always been an available function.
    I can confirm that it works. My recollection is that Siri always remained open for a minute or so after a query, but you would have to push HOME again for another question. Nice feature!

  • How exactly does the logical shift function work?

    I think I am missing something very basic here - I am trying to left shift an 8 bit unsigned integer by one place (x<<1)in each iteration of a while loop. So if I start with a number, say 18, the first iteration I get 36, then 72, 144 and after this 32, 64 and so on. I'm not able to do this apparently simple operation in LabVIEW. I tried the logical shift function and a formula node, but both dont give me what I need. The formula node appears to be close in that it gives me 18,36,72,144 but after that I get 255 rather than 32. I dont understand what the logical shift function is doing here. I have attached a vi here that shows what I am trying to do. Any help explaining the mistake I am making will be greatly apprec
    iated.
    Thanks.
    Attachments:
    Logical_Shift.vi ‏17 KB

    You have the inputs confused. If you want to left-shift by 1 at each iteration, the "1" goes on the upper "y" terminal and the number from the shift register (the "shiftee") goes at the bottom. (see attached modification).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Logical_Shift_2.vi ‏27 KB

  • When using FMLE how does the DVR auto record functionality work?

    Hi,
    Im using FMLE to send a live stream to my FMS. I check marked DVR Auto Record on it. But I am uncertain if its recording, for how long its recording, and whether I can control this functionality though my FLASH application. Do I edit an xml file in FMS directory to manage where the file is recorded to and for how long its recorded? Can actionscript from a FLASH app in the webroot dir access this file and play it back then return to the live stream? Has anyone found a tutorial on these matters.
    I appreciate the help, thank you.

    Check this articles - they should guide you:
    http://www.adobe.com/devnet/flashmediaserver/articles/live_dvr_pt1.html
    http://www.adobe.com/devnet/flashmediaserver/articles/live_dvr_pt2.html
    http://www.adobe.com/devnet/flashmediaserver/articles/live_dynstream_dvr.html

  • How do you get face time to work with shared email adress

    I have 2 computers sharing the same email address. I recieved for xmas a new i touch with face time. I can connect with the thrid computer not using the same email address as mine. How do I get the other 2 to accept the incoming calls?

    You have to add a unique calling email addres to Settings>Facetime and delete the common email address.  Yu need to do the same thing for Messages.

  • How do I use face time to work with Skype users?

    How do I use facetime to teleconferfence with skype users ? or do I need a skype account ?

    FaceTime can not communicate with Skype users. You will need to download Skype.

  • How do I make airport time capsule work with Linksys cisco router?

    Hi all.
    I bought an airport time capsule 3T and want to connect it to the internet, using a macbook with OS X 10.9.2. Currently I am using a Linksys Cisco router model WAG54G2.
    I followed the steps of the setup airport guide: Connected the WAN port of the airport with an ethernet port on the router, plugged in the power cable, filled in the internet username and password. In Airport Utility I can see the airport and the internet icon, both with green dots most of the time. But it seems to disconnect every minute or so, green dots turning orange and the status light on the airport flashing orange. The internet light on the linksys also goes on and off. When the internet is on, it is quite slow.
    Advice is welcome!
    Kees

    No guarantees here. AirPort Utility 6.3.1 is a big drop down from the 5.x versions in Leopard and Snow Leopard.
    Hold in the reset button on the back of the Time Capsule for 9-10 seconds and release
    Allow a full minute for the TC to restart to a slow, blinking amber light
    Click the AirPort icon at the top of the screen and wait a few seconds for a listing of New AirPort Base Station to appear. Just below that, click on Time Capsule.
    The example below shows an AirPort Express. You will see Time Capsule.
    As soon as you click on the Time Capsule, AirPort Setup will open up automatically and take a minute to analyze the network....and probably suggest that the Time Capule will be configured to "extend"....which is wrong.
    Click the Other Options button at the lower left
    Click Add to an existing network
    Next to Connect To.....select the wireless network name from the drop down list....if it appears. Otherwise type in the exact name of the wireless network.
    Click Next
    Confirm any settings again and wait to see if AirPort Utility 6.3.1 will allow the Time Capsule to join the wireless network.
    You have about a 1 in 5 chance that this will occur.
    Post back on your results.

Maybe you are looking for