Wait until the end of the transition between two images.

I'm developing an ActionScript 3.0 for Blackberry Playbook application.

I have twelve images loaded with a class Loader. I use Event.ENTER_FRAME melted and melted images using this event handler:

private function onEnterFrame(event:Event):void
    {
        imageToFront.alpha += 0.1; // slow fade
        imageToBack.alpha -= 0.1;

        if( imageToFront.alpha >= 1.0 )
        {
            imageToFront.alpha = 1.0;

            // hide the first image
            imageToBack.alpha = 0.0;
            imageToBack.visible = false;

            // remove the enter frame event listener
            stage.removeEventListener( Event.ENTER_FRAME, onEnterFrame );
        }
    }

When a user clicks an image his manager fundraising click the following:

private function onImageClicked(event:MouseEvent):void
    {
        switch((event.currentTarget as Loader).name)
        {
            case imageCell11Back.name:
                imageToFront = imageCell11Front;
                imageToBack = imageCell11Back;
                break;
            case imageCell11Front.name:
                imageToFront = imageCell11Back;
                imageToBack = imageCell11Front;
                break;
            case imageCell12Back.name:
                imageToFront = imageCell12Front;
                imageToBack = imageCell12Back;
                break;
            case imageCell12Front.name:
                imageToFront = imageCell12Back;
                imageToBack = imageCell12Front;
                break;
            case imageCell13Back.name:
                imageToFront = imageCell13Front;
                imageToBack = imageCell13Back;
                break;
            case imageCell13Front.name:
                imageToFront = imageCell13Back;
                imageToBack = imageCell13Front;
                break;
            case imageCell21Back.name:
                imageToFront = imageCell21Front;
                imageToBack = imageCell21Back;
                break;
            case imageCell21Front.name:
                imageToFront = imageCell21Back;
                imageToBack = imageCell21Front;
                break;
            case imageCell22Back.name:
                imageToFront = imageCell22Front;
                imageToBack = imageCell22Back;
                break;
            case imageCell22Front.name:
                imageToFront = imageCell22Back;
                imageToBack = imageCell22Front;
                break;
            case imageCell23Back.name:
                imageToFront = imageCell23Front;
                imageToBack = imageCell23Back;
                break;
            case imageCell23Front.name:
                imageToFront = imageCell23Back;
                imageToBack = imageCell23Front;
                break;
        }
        stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
        imageToFront.visible = true;
    }

I'm having the following problem:

If the user clicks on another picture until the previous image did not reach this image with a less than 1.0 alpha to alpha = 1.0 left TI.

In other words, I have to do something for the function onEnterFrame left the 1.0 alpha value.

Any ideas?

I tried with stage.hasEventListener (Event.ENTER_FRAME) to wait until the Manager came out, but it does not work (it's always return true).

My solution:

private function onEnterFrame(event:Event):void
    {
        imageToFront.alpha += 0.1; // slow fade
        imageToBack.alpha -= 0.1;

        if( imageToFront.alpha >= 1.0 )
        {
            imageToFront.alpha = 1.0;

            // hide the first image
            imageToBack.alpha = 0.0;
            imageToBack.visible = false;

            // remove the enter frame event listener
            stage.removeEventListener( Event.ENTER_FRAME, onEnterFrame );
            faddingCard = false;
        }
    }

When a user clicks an image his manager fundraising click the following:

private function onImageClicked(event:MouseEvent):void
    {
        if (faddingCard) return;

        switch((event.currentTarget as Loader).name)
        {
            case imageCell11Back.name:
                imageToFront = imageCell11Front;
                imageToBack = imageCell11Back;
                break;
            case imageCell11Front.name:
                imageToFront = imageCell11Back;
                imageToBack = imageCell11Front;
                break;
            case imageCell12Back.name:
                imageToFront = imageCell12Front;
                imageToBack = imageCell12Back;
                break;
            case imageCell12Front.name:
                imageToFront = imageCell12Back;
                imageToBack = imageCell12Front;
                break;
            case imageCell13Back.name:
                imageToFront = imageCell13Front;
                imageToBack = imageCell13Back;
                break;
            case imageCell13Front.name:
                imageToFront = imageCell13Back;
                imageToBack = imageCell13Front;
                break;
            case imageCell21Back.name:
                imageToFront = imageCell21Front;
                imageToBack = imageCell21Back;
                break;
            case imageCell21Front.name:
                imageToFront = imageCell21Back;
                imageToBack = imageCell21Front;
                break;
            case imageCell22Back.name:
                imageToFront = imageCell22Front;
                imageToBack = imageCell22Back;
                break;
            case imageCell22Front.name:
                imageToFront = imageCell22Back;
                imageToBack = imageCell22Front;
                break;
            case imageCell23Back.name:
                imageToFront = imageCell23Front;
                imageToBack = imageCell23Back;
                break;
            case imageCell23Front.name:
                imageToFront = imageCell23Back;
                imageToBack = imageCell23Front;
                break;
        }
        faddingCard = true;
        stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
        imageToFront.visible = true;
    }

I added a class Boolean faddingCard variable to control when onImageClick is thrown.

This solution is faster than Tweener or TweenLite.

Thank you very much for your help.

Tags: BlackBerry Developers

Similar Questions

  • Calculating the distance between two images... ?

    Hello

    I'm trying to calculate the distance between two images (A and F - there are other images between A and F), but I can't seem to understand how to make good sense.

    Image A.x is "(stage/2)-(A.width/2)" and the image of F.x is "provable - imgSpace" which is a negative value (all images x is a negative value for image A.x). "

    In my view, the calculation is F.x - A.x, and although it could be good I still ned the value to be non-negative.

    Does anyone know how to do this?

    Thanks in advanse...

    I think you can find out the distance with this equation,

    var len:Numer = Math.abs (A.x - F.x);

  • The transition between two objects with color gradient

    Oh no! I want to make a smooth transition between objects of gradient color, but you can see a line. How can I make a smooth transition? It is not a transparant-gum... Please help me!

    probleem2.PNGprobleem.PNG

    try to use a gradient instead of the net?

    You can use the path search tool to convert forms in one section, then gradient to create the dark lines where are the current limits.

    Or you can use "pen" one of them, to blend the overlap, but you may need to add the pen to a slightly larger copy of the object and your current border point to create a mask in order to keep the edges you want to stay strong and just leave an edge of more than in the other form.

  • By selecting the difference between two images

    Hello

    I have two photos exactly the same thing that I took using a tripod, studio lighting and general conditions. However, in the second photo, I inserted a subject - in this case a sculpture complex. Photoshop can merge these two images together AND choose so the difference between the two images - in this case the sculpture complex?

    Basically, I need to select the sculpture and do not want to spend time manually selecting due to its complexity. I need to separate the background and the sculpture for editing on their own layers.

    Thank you

    Stephen-CS3

    You posted this in the two forums, its been answered in the mac forum.

  • SPOT the difference between two images

    Posted earlier but I think I wasn't clear.

    My problem is you need to do the correct brand/animation to appear when the user clicks on the two hot spots (like spot the difference of the issue type) and ofcause that must also be marked as a correct answer... Please refer to this quiz http://genworth.com.au/webapps/fraudquiz/

    If you can click on the picture on the left and then the right picture (in a sequence any), then you will get correct answer layer appears...

    This single slide have also several issues like this... like date of birth left and right...

    Also note how it says answers from users like 1 / 3 if only one has been found corectly then two, such,.

    Thanks Masters in advance!

    Grasshopper... a Word to the wise... You double post this question, that will upset just the masters very "advance" whose wisdom looking so humbly.

    I replied to your post in the other thread.  Go and apply.

  • Exact differences between two images

    I need to be able to tell the difference between two images of a pastel artwork.


    The first image is of the piece, to be hung on a wall or placed on a table.


    The second is a photo of the piece after it has been moved, shaken or vibrated during which time particles were moved.


    I tried superimposing the two images and see the difference between the layers.  The images never seem to perfectly align along the lines of reference drawn in ink on the piece, and I do not understand the presentation of grayscale of the layer mode of difference.  I would like to know if anyone has any photographic photoshopic, or insightful ideas on how to capture this specific detail of change.  Another big challenge is now the images themselves to the exact distance and exposure to the room at the before and after photos, especially if they were taken in two different places on different dates.

    Best I can think of is to load into Photoshop layers >, select the two layers and go Edit > auto alignment of layers.  Then to the blending mode of the layer from the top to the difference.

    You can test so that you know what to expect by opening an image and copy the layer of BG and setting the blending mode of the layer copied the difference.  It will show as a pure black.  Now make tiny changes to the upper layer.

  • I got following message from the installation program Adobe - other instances of running Applications Adobe Manager that must be closed before you install this product. Please close or wait until they end. Please indicate how can I resolve the issue?

    I got following message from the installation program Adobe - other instances of running Applications Adobe Manager that must be closed before you install this product. Please close or wait until they end. Please indicate how can I resolve the issue?

    Please check if this helps https://helpx.adobe.com/creative-suite/kb/error-instance-updater-running-cs5.html

    Concerning

    Stéphane

  • I'm having a problem with a transition between two clips in the first.

    I put a transition between two clips, but it works only in a single clip. my project is almost done except to fix those errors.

    problem.jpg

    The handles are how you have before and after the section of the video images you removed in the timeline.

    Imagine you put a video in your editing and you use the clip (from the beginning to the end). Then you try and add a second 2 cross dissolve between the shots. First will have to at least 1 second image to prior to the shooting to make the transition, but because that there are no images more to use is unable to dissolve it in the middle of the Cup.

    You can do it all on a track just like FCP of Vegas, but you must have the images it to dissolve in.

  • How to make a slide to wait until the user has answered a question correctly, even after activation of a smartshape?

    Background:

    I created a questionnaire in which the user must answer each question correctly before to proceed to the next slide. That's what I did:


    • Set preferences Settings > required > respond to everything - the user must answer each question to continue
    • Set the number of attempts at the level of the question to infinity
    • Made the Next invisible button and disabled the PlayBar

    In this way, the user can proceed to the next slide in the issue with the submission process - and, since attempts are endless, this means that after having answered the question correctly.

    Current objective:

    I want the user to be able to click on a prompt for a hint. To configure this, I did the following:

    • Created a smartshape titled 'click_for_hint' to display the text that says: "click here for a tip.
    • Created a smartshape labelled 'hint' text display
    • Show "hint" success value "click_for_hint".

    Now, when the user clicks on the text that says: "Click here for a hint," the suspicion appears. So it works - great! However, once the indicator is activated, I would like to for the user to continue endless attempts until respondent correctly to the question... and then only after answering correctly, proceed to the next slide.

    The problem:

    If the user has submitted one or more wrong answers, and then activates the indicator, the slide just waiting until the user has answered the question correctly. Instead, it will be set in playing, proceeding to the next slide. I tried the smartshape 'hint' to take a break on the success of adjustment, but it does not work.

    Is there a way to make the slide to wait until the answer to the question correctly before moving on to the next slide, even after the indicator has been activated?

    Are you aware that your required parameter can cause problems, the blocking of the user? It is also completely useless because you have unlimited attempts at the level of the issue and hid the next button (hope, you don't need review, otherwise, I would recommend not to hide this button but slide it under the Clear key: the Question slides in Captivate - Captivate blog)

    The index problem is related to the fact that a simple gesture going out of reading. I would like to see the timeline of the slide, to compare the points of suspension form and the question slide button. And maybe this blog can also clarify difference between simple/advanced: Why choose Standard Simple action?-Captivate blog

    Regarding the buttons on question slides form: buttons on slides of Question/Score of Captivate 6?-Captivate blog

  • Wait until the next millisecond several question

    I seem to have a problem with the wait until the next millisecond VI. I put it to expect from 1000ms and I inside a loop that makes a bunch of stuff, yet my cards in the loop updates about 50 times every 60 seconds. I thought that maybe, it took too long to run everything in the loop, so he "missed" multiple next MS, but if that were the case it could be updated every 2 seconds. It wouldn't make sense not multiple integer.

    So my code is a great sorta, if he is the obvious places I should look and see, in what concerns, why what is happening in a general sense and not specific to my program, I could try that first.

    Thank you!

    Your loop can go to the next iteration until all structures of the event have expired or been triggered by an event AND wait the 1000ms has elapsed.

    It is difficult to solve the problems, you might want to rearchitect the code a little first. It seems that all the structures of the event are triggerend by the same event. You cannot combine all code into one? Use a structure of single event, not the event structures N!

    Keep the pattern of a single screen. Get rid of all the structures of these unnecessary sequences.

    Eliminate everything that the duplication of code. Why have a huge identical set of nodes of property in each case a case structure? Are not nodes of property after the structure of the case? Write to the properties when the value changes and not with each iteration of the loop.

    Use local variables instead of nodes in value property.

    Can you measure the loop with more conventional means to get a value of exact time loop?

  • uninstalled applications, received message: Please wait until the current program has finished uninstalling or one. After several reboots, still same message.

    Original title: 2 numbers do not know if they are related

    I have 2 questions and I don't know if they are related. Several days ago I was doing some cleaning and uninstalling programs to free up space. I don't know what I started with, but it seemed to go ok. However, after all that I've tried to uninstall gave me the message: Please wait until the current program has finished uninstalling or one. I rebooted the computer more than once during this period, but it still says that.

    Then my internet explore has stopped working just for 2 or 3 days. I've been using google chrome to access things, but it is rather slow.
    I ran repeated virus and malware scans my norton security and the microsoft Web site, and all said I am clean.

    Yes, it's windows 7 I appreciate the suggestions, but the problem was that he wouldn't LET me not uninstall anything. He gave me the waiting message please do anything, and he's not missing if I stopped and restarted. Finally, I gave up. I saved my files to my external hardrive and just do a full recovery of the computer. He solved the problem of installed programs and the internet problem explore both, although I hoped it would avoid going that drastic.

  • Please wait until the installer finishes determining your disk space requirements

    I have a windows Xp, Im trying to download Windows live sign in assistant. It seems to be stuck in (Please wait until the installer finishes determining your disk space requirements) I'm not quite sure what to do, Ive has been looking for an awnser for quite awhile. Im trying to download a game called also age of empires online. If there is a way I can by pass this dl all together that would be even better. I just went to re - install the program and this is the link ( http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=15106 ), it is not windows 7 but I'm not sure if it would work for my windows Xp. This link pop when I run the games for windows marketplace... Thanks - Matt...

    Well, I had it works for me without re doing not, but by going to my downloads and put back on the download I re install a couple of times and the same results, once I started it of my downloads, it worked like a charm! Hope this helps someone out there.

  • Impossible to uninstall searchfly. Looks like the system froze. continue to be "Please wait until the current program.

    Try to uninstall Searchfly since yesterday. I continue to keep the message "Please wait until the current program is completed the uninstall". Help, please.

    Hello

    You are infected with malware.

    Follow this removal Guide:

    http://www.bleepingcomputer.com/forums/t/502760/how-to-get-rid-of-SF-searchfly/

    See you soon.

  • Message "Please wait until the current program is finished uninstalling" or that when the uninstall a program

    Original title: Uninstalling questions

    The problem is when I try to uninstall any program I get a pop up message saying "Please wait until the current program is finished uninstalling" or that did not uninstall or change a program for months! Any ideas would be appreciated

    Hi Martin,

    This error message is related to the windows service installed on the computer.

    Before you begin to solve the problem, I recommend to restart the computer and verify if you are able to run the program.

    If the problem persists, I suggest you follow the provided methods to solve the problem.

    Method 1

    Unregister Windows Installer and then reregister Windows Installer. To do this, follow these steps:

    (a) click on Start Menu

    (b) type msiexec /unreg , and then press ENTER.

    (c) click on Start Menu

    (d) type msiexec/regserver , and then press ENTER.

    Method 2

    If the previous step fails, check if it has all the facilities waiting on the computer using the registry.

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see the link below.

    Back up the registry

    For Vista: Back up the registry:

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Empty registry key "in progress"
     
    Check the following registry key:

    HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress

    Empty/rename "PendingFileRenameOperations" registry key

    Check the following registry key:

    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

    Hope this helps; Please get back to us with the results.

  • I get the message please wait until the current program is finished gel or one

    I get the message please, wait until the current program is finished gel or be changed... trying to delete a program and have restarted and did a system restore nothing has fixed the problem...

    Hello

    try using the free program revo to remove a stubborn program

    http://www.revouninstaller.com/revo_uninstaller_free_download.html

Maybe you are looking for

  • 2015 Macbook: keyboard product strikes without touching (for only the T key)

    I have a Macbook or 2015 in perfect condition, original owner, never damaged, still under warranty. A few months ago, I noticed that the T key would occasionally insist on its own. With nothing, contacting the keyboard, keys T would have picked up. T

  • Satellite M40-313 USB question

    HelloI bought the laptop that precedes the last week and I have a terrible problem with the USB ports. I connect a standard USB device such as mouse, printer, scanner etc. and everything is ok. I bought an external hard drive that is USB 2.0 and have

  • I need to restore my phone, but my parents forgot restriction code. Help?

    My parents have completely forgotten the restriction on my phone code. Apple says I need to restore it, but I can't do it without the restriction code. Is there a way I can get around this? Do I need to go to the apple store it self to fix it?

  • Iteration in a structure of the event on the subset of elements of control

    I have an array of boxes that I want to live inputs switch indicators.  I have two tables which cell values feed indicators.  The checkboxes indicate which table is routed. My options are: Make a giant list of nodes of property with the switches (30

  • Detection of position of a secondary monitor

    Is there a function that tells me that my secondary monitor is to the left or to the right of the primary monitor? I paint 2D objects on a vi that will monitor is displayed on the primary or secondary, to the left or right and used the bounds FP.moni