the animation code runs only once

Hi all

import bb.cascades 1.2

Container {
    Container {
        layout: StackLayout {
            orientation: LayoutOrientation.LeftToRight
        }

        Label{
            overlapTouchPolicy: OverlapTouchPolicy.Allow
            text:"Initial Text"
            minWidth: 600
            animations: parallelAnimation
        }
        Container {
            overlapTouchPolicy: OverlapTouchPolicy.Allow
            layout: DockLayout {

            }
            ImageView {
                overlapTouchPolicy: OverlapTouchPolicy.Allow
                imageSource: "asset:///images/hotels.png"
            }
            ImageView {
                overlapTouchPolicy: OverlapTouchPolicy.Allow
                id:imgsource
                imageSource: "asset:///images/hotels.png"
                opacity: 1.0

            }
        }
        gestureHandlers: TapHandler {
            onTapped: {
                if(parallelAnimation.isPlaying()){
                    parallelAnimation.stop();
                }
                parallelAnimation.play();
            }
        }

        animations: [
            ParallelAnimation {
                id:parallelAnimation
                TranslateTransition {
                    id:translate
                    toX: -20
                    toY: -300
                    //duration: 1000
                }
                ScaleTransition {
                    id:scaletransition
                    toX: .2
                    toY: .2
                    //duration: 1000
                }
                FadeTransition {
                    id:fadetransition
                    toOpacity: 0
                   // duration: 1000
                }

                onEnded: {
                    console.log("On ended parallel animation");
                    translate.toX = 0
                    translate.toY = 0
                    scaletransition.toX=1
                    scaletransition.toY=1
                    fadetransition.toOpacity=1
                    //parallelAnimation.stop();
                }
            }
        ]
    }

}

I made the image to translate into original poision in onEnded ParallelAnimation but its not working. The label is visible only after tapping the container again. And further taps plays not the animation.

Please help me with this.

use a sequential Animation:

first run your ParallelAnimation

then the following reset of translations

Tags: BlackBerry Developers

Similar Questions

  • The initialization Code: run only once at T = 0?

    Hello

    Is it possible to run some ActionScript only once at the beginning of the flash application?

    There are GIFs that I need to download dynamically from the server that once that will be used on the buttons. When we go to another scene and return, the GIFs are downloaded again.

    Thank you
    FG

    #initclip and #endinitclip must be applied to a movieclip. If this movieclip is on stage as part of the _root timeline and governing has played more than once, your code initialization, attached to the timeline of the movieclip would run only once.

    Anyway, there are some easier ways to accomplish what you want directly. for example, the following code in the conditional runs, at most once little matter how many times the frame is played:

  • While the loop within a box Structure runs only once a target FPGA

    I have a card OR cRIO-9012 RIO for the HIL system. I have a target FPGA file when I use a While loop within a while loop I use the box Structure to check a real condition inside I have the function of activation of the ports and selecting the analog and digital ports. But for my code the code runs only once on repeted times that we have in the LabVIEW environment.

    I also need help to optimize the code. I've seen people using While loop timed in the FPGA target I don't use in both cases.

    I've attached my FPGA with the Version of LV2012 file.

    Waiting for your comments.

    Thank you and best regards,

    Ganesha Moorthy

    You have while loops inside the structure to deal with a constant of false cable to the stop condition. These loops will obviously never stop so browse your outside while loop (containing the case structure) can never.

    This has nothing to do with the FPGA target, the same thing will happen in the development environment.

  • My new Publisher El 12 runs only once after restarting the PC - how to fix?

    My new publisher of 12 items, runs only once after restarting the PC and seems to work well. I did a "clean install" repeatedly (cleared Temp files, shut down all applications, including Norton Antivirus and then installed DVD after a clean reboot). I can launch organizer of 12 elements several times, but the photo that editor runs only once. After that, I have to restart the PC, and then I can run the Editor again, but once again, only once. I also first 12 items for video files - no problem, he launched several times. I see that Alfredo has a similar problem: How can I fix?... is it a bug of El 12?... Thanks for your help... k-paul

    Thank you very much Peru Bob... your statement works... of course, this stitching is 12 items of closing/out not really closes it (which is why I could not re - start it), so there's always a problem... I can live with that, but why would the program stops not when I close?... k-paul

  • JavaScript to run only once

    I need to make several calls javascript from my Captivate 6 project, but anywhere, I put the javascript calls (OnEnter for a slide, OnSuccess for click box or the button), the javascript code is only run the first time.  It is a major wait up for me, and it makes no sense.  I can add a second slide and place a javascript call and it also works a long time that I did no other call javascript to this day.  It's SO frustrating, and unless I'm missing something, this is obviously a bug in Captivate. It is easy to reproduce the problem.  all you have to do is to create a new project and add the 2 boxes and add javascript both calls.  Then click on one, then the other.

    Huh, I got the flex project and put it on the Web server, and it works.  There must be a problem with it being in charge of Flex.  Sorry!

  • I have CS5.  Cannot install updates.  The update process runs, but once finished, I get an error message that the update could not be installed.  I have a Dell PC with 8 GB ram and 2 TB of storage.

    I have CS5.  Cannot install updates.  The update process runs, but once finished, I get an error message that the update could not be installed.  I have a Dell PC with 8 GB ram and 2 TB of storage.

    The latetest (cloud) update sometimes does not work with old programs... Try to install your updates manually

    Beginning of the updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

  • A repeating region: display the entries of dubble only once

    I want to do a Recordset where all the 'cities' are shown only once, it should not be like

    The Hague

    The Hague

    The Hague

    Rotterdam

    Rotterdam

    Amsterdam

    But:

    The Hague

    Rotterdam

    Amsterdam

    This is the recordset object:

    SELECT c_city FROM canteen

    It's the repeat region:

    <? PHP {? > <? php echo $row_allCities ["c_city'];? > <? php} while ($row_allCities = mysql_fetch_assoc ($allCities));? >

    Thankx for any help!

    Add a SEPARATE statement to your application.

    SELECT DISTINCT c_city canteen

    --
    Lawrence * Adobe Community Expert *.
    www.Cartweaver.com
    All Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF
    www.twitter.com/LawrenceCramer

  • the event structure cannot combine with other events and run only once

    Why it will always get stuck when I combined the 'new user add' event to the event of 'Login '?

    It works for me when I separate the two, but the 'Add a new user' button can work but only once for the structure above, program will be blocked on the second time that I press the button "add a new user".

    It has already been said, you must use that a single structure of the event and not 2. Also, avoid using local variables (better store data in a shift register and not in an indicator) how you do it, it can cause bad racing conditions.

    Actually here you just don't another data storage since you have a file. Don't store data file to the root of the C drive, you do not have write permission. Use the default data folder or the folder of the application.

    I have attached a simple example. I guess that's a work at home? Please make my account help: try to understand why your VI does not work and try to find a solution by yourself. Modify my sample and play with him. This is how you learn LabVIEW. If something is not clear, post here, and we can explain/help.

    Edit: has the 'connection' event, I don't check against whether the file exists or not. Difficulty of this part, gives too little practice.

  • Help, please... Game animation click event, only once the animation is complete, launch lightbox

    Hey all,.

    I could really use some advice, I have been looking for a good few hours and came to nothing.

    I was expecting to play a small animation and the launch of that the Commons of edges in light as soon as the animation ends.

    My code:

    Insert the code for the mouse, click here

    sym.getSymbol("no17").play ();

    Open spotlight overlay

    Perform the configuration

    var config = {}

    Width: 1400

    height: 900.

    type: 'animate ',.

    Source: "http://new.oliverrice.co.uk/folio.html".

    };

    Open the overlay

    BCI Spotlight.Open (config);

    The code starts the projector starts the animation. I would like the second 2 animation to play first before launching the spotlight.

    I'm sure that the answer is really simple, but im new to JavaScript and am struggling to find how to achieve this.

    Is there an intelligent people that might be able to help me?

    Hi, thanks for the reply, I got something to think about today and placed the code of Honor:

    Open spotlight overlay

    Perform the configuration

    var config = {}

    Width: 1400

    height: 900.

    type: 'animate ',.

    Source: "http://new.oliverrice.co.uk/folio.html".

    };

    Open the overlay

    BCI Spotlight.Open (config);

    In a trigger at the end of my animated film that did the trick!

    so:

    1. I click on the animation

    2 times

    3. then throw spotlight lightbox

  • producer consumer loop run only once?

    Hello here

    In my VI, the loop of the producer seems to operate continuously, but the loop of consumer only run once.

    I did not use producer/consumer patterns before, could someone give me some ideas why this is happening?

    My code is attached.

    Thank you in advance.

    Faouzi

    It would be the wrong choice to use a structure of the event into the loop of the consumer.  As it is configured, you must generate a leave mouse or mouse event enter on the graph of waveform for the loop of consumer to complete its first iteration.

    Remove the structure of the event.  you don't need to update a chart.

  • Why my calculation at the time loop repeats only once?

    I have a series of simple calculations (multiply, divide, add, subtract) occurring in a while loop based on input data on the front panel of the user. The results are then connected to local variables that alter the parameters of a signal generator in one another while loop.

    The while containing the iteration of repetitions one calculation, unless I turn the button "Highlight execution" in which case it repeats until the loop is stopped as I expect. With the 'performance highlight' button and using a probe to check instead of the loop does not repeat itself.

    Another while loop with the signal generator allows to reproduce, but uses only the values which were concluded before the VI began to run.

    I need the VI to be recalculated each time a value on the front panel is changed and change the output of the generator signal accordingly.

    What Miss me?

    Because local variables are fixed on the LEDs that are in the position it after the end of the VI it runs correctly the first time and only executes a forward iteration to stop, all in a loop containing calculations, if you run the VI more than once. As long as the LEDS are in the off position when the VI is launched then everything works fine.

    Thanks for the advice, everyone.

  • Tip action that run only once

    Hello

    Question: What is the best way to get a tip action to execute only once during the lifetime of an execution?

    My script: I have a project with 80 slides in there to learn. Slide 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, I use onEntry event to perform actions advanced designed for each of these numbers. Given that users are allowed to go forward and backward slide, slide 10-100 event are executed several times, depending on how much time users visit these specific slides. My question is, what is the most effective way to ensure that a tip action is executed only once. Say a user reached slide 10 and advanced action "foo10" is executed. If this user has decided to return to slide 10, I don't want to foo10 advanced action to be executed again.

    My solution: I would create Boolean variables for each of the advanced actions. foo10 ... foo100. If the corresponding var bool is false, do not run the action, run another action assigned.

    Question: What is the best way to get a tip action to execute only once during the lifetime of an execution?

    Thank you.

    If it was a success (for an interactive object) event, you could disable this object with the same action as the advanced conditional action. Using the system variable LastVisitedSlide will probably exclude not all possible situations. A Boolean variable is probably the best choice. Since you're on 9 Captivate, make sure to use shared instead of shares advanced actions, you will save time (and the size of the file).

  • Haw to find the element in the table that appears only once

    I have a table like this 2d:

    1 2 3 4 5 0

    5 6 2 4 7 2

    8 3 6 0 9 4

    5 6 7 7 3 2

    And I need to find items that appear only once in this table

    In this case, 8 and 9

    I also need this elements (row and column) position

    Are integers

    I tried to remodel the table and use the find but no result.

    Your best bet is to remodel a table 1 d do your seaching and use 'Quotient & rest' to convert location (index) in the table 1 d back to the index in table 2D. Use "Array Size" to get the number of rows and columns of the table 2D.

    The histogram only works on 1 d arrays.

    Or reshape a 1 d table. For each digit (0-9), use 'Search 1 D Array' twice. If the first 'search' finds a match (does not =-1), use the offset to start the 2nd search beyond the 1st index discovery. If 2nd 'search' returns-1, then one and the SAME time happens

    The index of the first 'search' to calculate the index (Quotient & rest") line and collar of the 2D array.

  • Why my interactive pdf file shows the animation between pages only in full screen

    Is it possible to display the animation between two (or more) pages in pdf format when you are not using full screen.

    I made a file in indesign CC and exported (fade effect) interactive PDF form.

    But the animation is shown in the view full screen, can I change this?

    Hope to hear from you soon

    Jachim,

    What you call animation between pages is called the Page Transitions in English. (Animation in the Animation Panel does not in PDF, of course.)

    However, in the PDF files, it can only be displayed using the full screen. It's just the way it was designed. There is no way to change this, I'm afraid.

  • Agent script - runs only once.

    Hi all

    I wrote a custom script agent that uses a file of DOS commands to run a powershell script that creates a text file, then type this file on the screen.

    The content of the text file is here:

    TABLE PT_GBES02_USER_COUNT

    START_SAMPLE_PERIOD

    Host.String.id = ukstrgbes02.peroot.com

    PT_GBES02_USER_COUNT = 410

    END_SAMPLE_PERIOD

    END_TABLE

    The batchfile BACK content: (PT_GBES02_USER_COUNT. BAT)

    off @echo

    PowerShell-folder e:\Scripts\CountUsers.ps1

    type e:\scripts\usercount.txt

    Content of the powershell script.

    $usercount = (get-ChildItem E:\PST-filtre "GMS-BlackBerryServer *.pst.db"). County

    Clear-Content E:\Scripts\UserCount.txt

    E:\Scripts\UserCount.txt Add-Content "TABLE PT_GBES02_USER_COUNT".

    Add content E:\Scripts\UserCount.txt "START_SAMPLE_PERIOD".

    Add content E:\Scripts\UserCount.txt «Host.String.id = ukstrgbes02.peroot.com»

    Add content E:\Scripts\UserCount.txt "PT_GBES02_USER_COUNT is $usercount".

    Add content E:\Scripts\UserCount.txt "END_SAMPLE_PERIOD".

    Add content E:\Scripts\UserCount.txt "END_TABLE.

    I created the agent and deployed the agent on the server. The agent runs the script once but not again. I need to run periodically.

    Every time I have stop and start the agent running the script once but again its not repeated. I do not also the agent Agents/hosts with agents screen

    but it is visible in the agent status page.

    I have written other agents of script (even if not using powershell) and they all seem to be normally repeats.

    The only messages in the log file are

    2012-11-09 09:25:36.934 ECHO VERBOSE [IncomingMessage-4444] com.quest.glue.core.agent.AgentInstance - starting data collection

    2012-11-09 09:25:37.293 ECHO INFO [IncomingMessage-4444] com.quest.glue.core.agent.AgentInstance - started data collection

    No idea what I did wrong?

    Hi John, it is resolved. It was the command line I used to start PowerShell

    I replaced the bottom and everything works fine now

    PowerShell - ExecutionPolicy RemoteSigned-NoProfile interactive non - command -.<>

Maybe you are looking for