Timeline. How does (or does not) update global variables?

Hello All,
I am having problems to understand how a timeline updates values. In my case the timeline is supposed to change an index within a second always by incrementing it by one or decrementing by one. Basically I am trying to create a mosaic of images that when I press left key all the columns move to left and when I press right key all the columns move to right.
To do this I have a deltaX constant that defines the translation.
Then I have a global tracker initialized to 0 and then udated +1 if move to right, -1 if move to left.
The Timeline is:
public var tracker: Number = 0;
var thumbnails: ImageView[] = bind for (column in [0..appModel.CATALOG_COLUMNS + 1]) {
                for (row in [1..appModel.CATALOG_ROWS]) {
                    def imageView: ImageView =  ImageView {
                                image: bind catalogData.dataAt(row, column)
                                x:  bind (column - 1)*catalogData.maxThumbnailWidth + column*xSpacing
                                y:  bind ySpacing + (row - 1) * (catalogData.maxThumbnailHeight + ySpacing)
                                translateX: bind tracker*deltaX
                                transforms:  bind [
                                    Rotate {
                                        angle: bind direction * rotation
                                        pivotX: bind imageView.x + imageView.boundsInLocal.width / 2
                                        pivotY: bind imageView.y + imageView.boundsInLocal.height / 2
    override public function create(): Node {
        return Group {
                    content: bind thumbnails
public function rotateAndTranslateToRight(): Void {
        direction = 1;
        translateAndRotateTimeline.stop();
        translateAndRotateTimeline.play();
    public function rotateAndTranslateToLeft(): Void {
        direction = -1;
        translateAndRotateTimeline.stop();
        translateAndRotateTimeline.play();
    var translateAndRotateTimeline = Timeline {
        def initialValueTracker = tracker;
                keyFrames: [
                    KeyFrame {
                        time: 0s
                        values: [
                             rotation => 0,
                             tracker => initialValueTracker
                    KeyFrame {
                        time: 1s
                        values: [
                            rotation => 360 tween Interpolator.LINEAR,
                            tracker => initialValueTracker + direction tween Interpolator.LINEAR
            }The problem is that if I first move to right the Timeline works correctly and tracker goes from 0 to 1 in one second, therefore I see a translation to right of tracker*deltaX pixels. So far so good.
Then if I move to left, I am expecting the Timeline to change tracker from 1 to 0 in one second, but really it is changing tracker from 0 to -1... which of course messes up my translation to left.
I thought Timeline updates global variables (define outside the Timeline in the context of the class the Timeline is defined) during the transition, but apparently from my observation it doesn't.
Or maybe I am not defining correctly the Timeline itself and/or the tracker variables?
Thanks.
Edited by: sacchett88 on Jun 4, 2010 1:03 PM

Thanks for the reply... but it didn't help me that much in finding the workaround. I wrote a simpler example to prove the point that can be easily copied and pasted and run. The example draw a circle and for every right key it should move the circle to right of a deltaX number of pixel. If left key is pressed then the circle should move to left of a deltaX number of pixels. The code is:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.shape.Circle;
import javafx.scene.paint.Color;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
import javafx.animation.Interpolator;
var deltaX: Number = 70;
var direction: Number = 1;
var tracker: Number = 0;
var circle: Circle;
var translate = Timeline {
    def initialValueTracker = tracker;
            keyFrames: [
                KeyFrame {
                    time: 0s
                    values: [
                        tracker => initialValueTracker
                KeyFrame {
                    time: 1s
                    values: [
                        tracker => initialValueTracker + direction tween Interpolator.LINEAR
Stage {
    title: "Application title"
    scene: Scene {
        width: 900
        height:500
        content: [
            circle = Circle {
                centerX: 100,
                centerY: 100,
                translateX: bind tracker*deltaX
                radius: 40
                fill: Color.BLACK
                onKeyPressed: function (e: KeyEvent): Void {
                    if (e.code == KeyCode.VK_RIGHT) {
                        direction = 1;
                        translate.stop();
                        translate.play();
                    } else if (e.code == KeyCode.VK_LEFT) {
                        direction = -1;
                        translate.stop();
                        translate.play();
circle.requestFocus();I understand how KeyFrame works. However the final value I'd like to be the initial value for next key press. I also tried to assign explicitely the final value to the tracker variable at the end of the timeline, but next time timeline still picks up the initial value 0 of tracker.
Thanks.

Similar Messages

  • HT4623 how come i can not update my iphone 4 to ios 6

    how come i can not update my iphone 4 to ios 6

    I may be completely wrong, but I think you may need iTunes 10 to update to 6.0 or 6.0.1. I'm also not completely sure what firmware the built-in update feature was implemented, so if all else fails, check the General tab in Settings to see if you can update from the iPhone itself.

  • How to Set and Use a global variable within a session?

    Dear All,
    I'm new to jsp, and would like to ask how to set and use a global variable within a session?
    Thanks in advance.
    Regards,
    Cecil

    With session.setAttribute("name",object) you can store a Attribute in the session object.
    with session.getAttribute("name") you can get it.
    That's it.
    Regards,
    Geri

  • Profit Center Hierarchy is not updating in Variable

    HI Guru's,
    Profit Center Hierarchy is not updating in Variable .
    We have 3 new profit center added of which i have updated the master data ie, attr, txt, and hierarchy and Txn data. Where after updating i can find the thing updated but when i execute the report in the variable i dont find the updated profit center.
    Please guide
    Prasad

    But just to update you that we don't have data for the new profit centerin R3. Is it because of this i don't find the new profit centers in
    Variable screen ( though i can see in Query Designer)
    Please guide

  • Data manager package log does not show Global variables!!

    Hello Experts,
    We are using BPC 10 sp14 Microsoft version with SQL Server 2008 R2. We are seeing an issue where datamanager package log does not show the Global variables defined in package script whereas in BPC 7.5 Global variable were visible in package log.
    Please let us know is this behavior changed in BPC 10?
    Below is the package script having Global variables and Package log not showing any of them.
    Thanks & Regards,
    Rohit
    Package Script:
    Package Log:

    Hi Ergin,
    As far as I remember it's by design...
    Vadim

  • Regarding Template updates, what does this error " not updated, item not found" mean?

    This is the second time I've posted this question so hopefully somebody will respond. At some point in the last few weeks I found that I could no longer apply a template in a group operation (returns the error shown above). If I modify the template and save it it shows all the related files to be updated but does not actually update them and again returns the error "not updated, item not found". As a test I created a duplicate of a particular .html file and applied the associated template successfully. When I apply a template change it does properly update the newly created file but not the others. I also did a mechanical file compare (using windiff.exe) between the original and duplicate file and there are NO differences in the two .html files. I have also deleted and recreated my site maps several times.
    As an aside, Library items do update successfully.
    I am running Dreamweaver CS6 on Windows 7.

    I have an extensive home network and I consider myself to be very proficient with personal computers (had one since 1981) so let's start at that level.
    I have you beat by 2 years. Bought an Apple II+ in 1979!
    When this problem first started, I went to another PC (home built desktop Win 7 64 bit) I have and created a new Dreamweaver site copy using an instance of the site that was on a network share running on a NAS box (Netgear RAID5) that I use for central file storage. Just for a test I did the same thing on my main working PC (see below) and created a new site with the data that was on the network share. Well, lo and behold the template problem went away with both of the two sites I am having trouble with. Now I have no idea why sites housed on my PC are having a problem but that seems to be the issue.
    Your setup is very similar to mine - NAS (I'm using an Intel NAS) housing all my working files.
    Just for a test I did the same thing on my main working PC (see below) and created a new site with the data that was on the network share. Well, lo and behold the template problem went away with both of the two sites I am having trouble with.
    So it's working in the duplicate site, but not the current site. And in the current site, you have some files that update as desired and some that do not? Why not just make the duplicate site be the main working site?
    Anyhow, I cannot think of any wrinkle that would cause DW to update some legitimate child files in a site but not others, except for a corrupted file cache.

  • Why does my library not update itunes to display purchased songs?

    I bought a portion of an album a few months ago, and went to purchase the rest of the album and none of the songs I have purchased show up as purchased.  I bought one of the songs I did not own, and it instantly marked it as purchased but did not update the rest of it.  Any advice/ fix for this?  Also I have the "share details of your library with apple" turned on.

    public void dImg(Image po){
    thebkg1=po;
    validate()
    repaint();
    }

  • Update global variable on front panel of another VI

    I have a main VI that has the GUI for the operators that has several steps with multiple sub vi's. I want to display the status (where I am in the process) on the GUI. I am using global variables, and the status updates in the global variable front panel just fine, however it only outputs the last value to the operator GUI. I would like it to show the new status at each point in the code. I read something about action engines but I am not sure is that is the correct way. I attached some code just as an example of how I am doing it right now.  
    Attachments:
    example.vi ‏9 KB

    lvuser333 wrote:
    I have a main VI that has the GUI for the operators that has several steps with multiple sub vi's. I want to display the status (where I am in the process) on the GUI. I am using global variables, and the status updates in the global variable front panel just fine, however it only outputs the last value to the operator GUI. I would like it to show the new status at each point in the code. I read something about action engines but I am not sure is that is the correct way. I attached some code just as an example of how I am doing it right now.  
    i would implement a state machine, in your case. and look into references to bring the info up to the main vi if need to....
    Spoiler (Highlight to read)

  • Can not use Global Variable in Event Structure

    I am using LabVIEW 2009.
    In my LabView project I have a Boolean Global variable called EStop. I can read and write the Global variable. If I double click on the Global variable, it takes me to EStop.vi which includes a Text Button. EStop.vi is part of my Project.
    In one of my VIs, I have an Event Structure. If I go to one of the Event Handlers in that Event Structure and right click and then select Add Event Case, I get a list of possible events. But that list does not include EStop or an EStop events.
    I want to Add an Event Case for EStop: Value Changed.
    Why can't I Add events to an Event Case that include events on Global Variables like value changed?
    How do I add EStop: value changed event to my Event Structure.
    Solved!
    Go to Solution.

    dbaechtel wrote:
    I have many events throughout the system that might need to cause the system to do an Emergency Stop action. So I want ro use a Global variable that is accessible from anywhere in the system. Any action or condition that occurs anywhere in the system can activate the emergency Stop condition by setting the boolean EStop Global variable to True. When the Global bolean variable goes true(value changed), I want to detect that event in an Event Structure and do the actions necessary to accomplish a system Emergency Stop.
    Sorry, I am not familiar with your terminologies. What is your definition of a "system".
    One big VI with many parallel loops?
    Several VIs running in parallel?
    LabVIEW Champion . Do more with less code and in less time .

  • How can I make my mini global variable work in more than the default case?

    Hello, this seems so simple yet does not want to work. I created 2 simple read/write mini vi's and want to use them as global variables. Writing values based on a case selection. This method only seems to work in the default case. Where did I go wrong?  Thanks
    Attachments:
    Curs 0 Y.vi ‏13 KB
    Main.vi ‏19 KB
    Curs 0 X.vi ‏13 KB

    In case 1, you are writing to a second set of subVIs (Curs 1 X.vi vs Curs 0 X.vi). You only read from Curs 0 X.vi, and never from Curs 1 X.vi.
    LabVIEW Champion . Do more with less code and in less time .

  • How do I see values of global variables in a SAP system

    Hi Guys
    How do I get to see the values of global variables DIR_GLOBAL etc.
    Actually I wanted to run an archive for some IDOCs, and I configured a filepath for the same and gave it an address to my local system, now when I use SARA and after customising the logical path it gives me an error stating that "Logical file path is not completely maintained".
    So I resorted to one of the predefined paths ARCHIVE_DATA_FILE and it archived successfully but I am not able to figure out the exact path of the archived file can you please help??
    Best regards
    Sujoy

    Hello Sujoy,
    Execute transaction FILE, double click on Logical File Name Definition, then, scroll down to find ARCHIVE_DATA_FILE - double click on ARCHIVE_DATA_FILE.  Note what is entered in the Logical path field and then, go to Logical File Path Definition.  Look for the path name from previous step and highlight/select it and click on Assignment of Physical Paths to Logical Path.  From there, you can double click on the relevant Syntax group.  This will give you the path for where the archive file has been written to.
    I hope this explanation is not too confusing :-).
    Best Regards,
    Karin Tillotson

  • How do you reference a created global variable in a report text field?

    I have created a parameter using the Globaldim statement in a script file. when I reference this parameter in any other script file during the current DIAdem session the value is passed without any issue.  Call the variable parmxyz where I assign it a value of 25.3 
    The help section under Globaldim mentions that global variables can be referenced in all panels, scripts, and dialogue boxes.  When I try to insert a text box on a report page using the @@parmxyz@@ it returns NOVALUE where I expect to see 25.3 (for example).
    When I substitute @@CurrDate@@ I do get the date, so I know the text box is valid.  What am I doing wrong?
    Steve    M 

    Hello Steve!
    It should work the way you did it. But their are some circumstances wich might prevent it:
    You have reseted the global script engine. All variables will be lost.
    You have a Sub with the same name in a command extension script. There is no warning ;-)
    One Test you can make is to put in '@@TypeName(paramxy)@@' as the expression to see the variable type. You can also try a realy unique variable name. The last option is to use ItemInfoGet to get detailed infos about your variable.
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to go to java section global variable declaration

    Hi all
    i am following this scenario
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID0446700150DB10376299506581707969End?blog=/pub/wlg/11287
    in this scenario 3rd screen shot is about global variable declaration:
    In order to build the content of the attachment (for this particular requirement) we use a global variable declared and initialized in the global sections :
    can any body tell me how to go to this java section screen , as i am unable to find this java screen....
    Thanks
    sandeep

    even i cant see this edit java section
    i am working on PI 7.1. has this feature been removed in pi 7.1
    this is replaced in PI7.1 ... check this blog on how to use the "global" variable in PI7.1:
    /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    Regards,
    Abhishek.

  • How to get value for a global variable from an exel file?

    Hallo all,
    I am a beginner in LabVIEW and I have  a problem in reading datas from an exel file . I would like to import a group of data with timestamps from exel file to a global variable. for ex. speed, acceleration and position of 4 different sensors to each of its global variable.
    It will be very nice if anyone can give me some ideas.
    Thanking you in advance

    ...continued here

  • Why does photo stream not update latest photos to ATV?

    Noticed this weekend when I posted photos from my iPhone, iPad, or iMac to photo stream all my devices immediately updated all devices with the new pictures from iCloud, my apple TV does not do this anymore.  I needed to turn off photo stream in settings and then turn on photo stream to get the new pictures.  It used to be automatic like all my other Apple products.

    This issue is has been resolved.  The updates are much slower that to an iPad or iPhone however it is now automatically updating without any manipulation.

Maybe you are looking for

  • Moved Music to New Hard Drive - Required folder not found??? pls help

    Hello I have recently purchased a new external hard drive as my crappy Dell was full to the brim with music. I have moved all my music files over to the hard drive and re installed itunes. Now when i drag my music folder into the itunes library it up

  • Conditional Mail Routing in Exchange 2013

    Hello all, Is it possible to create a rule in Exchange 2013 based on a message header, and redirect to a custom send connector? It looks like you can do it within Exchange Online with outbound connectors, but I don't have the same options in 2013. "

  • How to set airport extreme as primary base??

    Hi I have just spent literally all day trying to get rid of the flashing amber, finally I now have a steady green light. What I would like to know is what is the benefit of having the Airport extreme as my primary base and how do I do it. regards TIA

  • Lighting effects

    Is there something I'm doing wrong or is there a problem with my filter. The lighting effects option shows up under the Filter>Render menu but the Lighting Effects option is grayed out so I can't select it.

  • Index Corruption in database

    I am getting the below error when I run utlrp in my database. Please assist: ERROR at line 1: ORA-08102: index key not found, obj# 423571, file 6, block 113416 (2) ORA-06512: at "SYS.UTL_RECOMP", line 760 ORA-06512: at line 4 I have run dbverify on F