Adding items to an array dynamically to the current scene

Hello

I created an array with n elements. After 5 seconds, I want to add an extra element in the table and display it on the screen. And that's my problem. The function is called and the element is added (as far as I can see in debug mode), but it is not displayed. I tried the playFromStart function, but it does not help (in fact, it freezes the entire application). Here is my code:
for (j in [0..1]) {
    for (i in [0..1]) {
        insert Element {
            x: 
        } into Elements;
    }
}

def t1 = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 25ms
                    values: []
                    action: function() {
                        for (Element in Elements) {
                            //do some fancy stuff :P
                        }

                    }
                }
            ]
        };

def t2 = Timeline {
            repeatCount: Timeline.INDEFINITE
            keyFrames: [
                KeyFrame {
                    time: 5s
                    values: []
                    action: function() {
                        insert Element {
                            x: random.nextInt(500), y: random.nextInt(500)
                        } into Elements;

                        //insert Elements into stage.scene.content;
                        t1.playFromStart(); //doesn't work...


                    }
                }
            ]
        };
var stage : Stage = Stage {
    title: "Test App"
    width: 500
    height: 500
    scene: Scene {
        content: [
            background, Elements
        ]
    }
}
What am I wrong with my code? Tips/advice, how can I get I work?

Hello user,

Please use bind for the changes in real time on scene.content;
And are the timeline must always be under the nodes (code statement) whose animation you are in treatment.

Thank you.
Narayan

Tags: Oracle

Similar Questions

  • PLEASE, I BEG YOU! How can I have a label dynamically see the current user loggedin FirstName and LastName in my database?

    I have a HBox that becomes visible when a user is valid. The HBox contains a logout button, and a label. How can I get the label dynamically see the current user loggedin FirstName and LastName in my database? Below, I have included my element HBox and ColdFusion. ANY helpwould be appreciated!



    < < < < < < MY component LoginHBox.mxml starts HERE > > > > > > >
    < mx:HBox
    ' xmlns:MX =' http://www.adobe.com/2006/mxml '
    Width = '100% '.
    height = "28".
    horizontalAlign = "right."
    verticalAlign = "middle".
    paddingRight = "10" >

    "" < mx:Script source = "... / actionScript/logout.as" / >

    <!-App connects to ColdFusion using Flash Remoting STARTS->
    < mx:RemoteObject
    ID = "cfService_LoginCFC".
    destination = "ColdFusion".
    source="WebsiteApplication.CFC.LoginCFC"/ >
    <!-App connects to ColdFusion using Flash Remoting END->

    < mx:Label id = "welcomeLabel".
    Text = "Welcome"... "/ > < < < < HOW can I get the text dynamically see the users registered in FirstName and LastName?

    <! - logoutResultHandler() of the points of function in the file logout.as - >
    < mx:Button id = "logoutButton.
    label = "Log" Out
    Click = "logoutResultHandler ()" / >

    < / mx:HBox >
    < < < < < < MY component LoginHBox.mxml ends HERE > > > > > > >



    < < < < < < MY component LoginCFC.cfc starts HERE > > > > > > >
    < cfproperty >

    <!-function loginUser STARTS->
    < name cffunction = "loginUser" access = "remote" returntype = "WebsiteApplication.cfc.UserCFC" >
    < cfargument = 'user name' name type = "string" required = "true" >
    < name cfargument = "password" type = "string" required = "true" >

    <!-the default user is not logged in->
    < cfset var user = createObject ("component", "UserCFC") >

    < cfquery name = "loginQuery" dataSource = "TheChurchOnFire" >
    SELECT the name of user, password, AccessLevelID, FirstName, LastName
    FROM dbo. MembershipInfo
    WHERE
    Username = "#username #
    AND password = ' #password #
    < / cfquery >
    <!-the cfif instructionsuivante is absolutely fundamental in the achievement of the
    fully functional authentication-> process
    < cfif EQ loginQuery.Username ' #username # ' loginQuery.Password AND EQ ' #password # ' >
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "#loginQuery.AccessLevelID #" >
    < cfreturn user >
    < cfelseif > #username # EQ 'username' AND #password # EQ 'password '.
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "6" >
    < cfreturn user >
    < cfelse >
    < cfreturn user >
    < / cfif >

    < / cffunction >
    <! - function loginUser ENDS - >

    < / cfproperty >
    < < < < < < MY component LoginCFC.cfc ends HERE > > > > > > >

    Thank you

    John

    I finally thought to it! PRAISE BE TO GOD!

    I had to add...

    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';

    .. .for my loginResultHandler.

    function loginResultHandler
    private void loginResultHandler(event:ResultEvent):void
    {
    currentUser = event.result as a user;
    If (currentUser.loggedIn)
    {
    If successful login
    If (currentUser.roles == '5')
    {
    this.currentState = 'Youth';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '4')
    {
    this.currentState = 'Member';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '3')
    {
    this.currentState = 'PowerMember';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '2')
    {
    this.currentState = 'AssistantAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '1')
    {
    this.currentState = 'SeniorAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    on the other
    {
    currentUser.roles == "6";
    this.currentState = 'Visitor';
    welcomeLabel.text = 'Welcome, you are currently logged in as visitor!';
    }
    }
    on the other
    {
    If unsuccessful login
    Alert.Show ("unsuccessful Login", "Server authentication");
    }
    }

    Michael_ramirez44 thanks for your help!

    John

  • A button that doesn't stop and audio for the current scene (not to stop all sounds)

    Basically, I'm creating a history book, each scene has audio, I want my next button (ordered to the next scene) to stop the sounds on the current scene when you click on it so that they do not continue to the next scene.
    The action "stop all sounds" keeps the sounds on the next stages of the game.

    What should I do?

    SoundMixer.stopAll () stop not the sounds that are instantiated after executing the stopAll() method.

    But if you want more control over your sounds, they should be instantiated using actionscript.

  • Adding items to an array of unknown size several times

    Hey,.

    I had an application that communicates with a device (a generator of microwave) via the Protocol modbus RS-232. It is within a state machine. The VI running generator initialization first and then move to the State 'pending', where I have a structure of the event to follow any value change of control. In the structure of the event, a timeout of 300 ms is implemented, because communication to the generator must be active at least every second (if not a defect is reported). In the case of timeout I read all record and display values.

    Within this time-out I would record a value of the indicator ('measure Pfwd') several times in a 1 d table (the table size is unknown!). However, I would like for the variable to record only when the indicator 'MW?' is 'TRUE '. And "MW?" goes from 'FALSE' to 'TRUE' every time, I would like to start writing on a table from the beginning.

    I tried several options, including the table to remodel, but I can't make it work. Or it works in a separate VI, but when I use it within the structure of the event and state machine, nothing works.

    If someone has an idea, it would be welcome...

    Thank you

    Concerning

    Create an another shift register which is initialized with an empty array of the correct data type and use the node Build table add data to it when you want that he added.

    In BT, the size of a table doesn't have to be declared in advance.

    Mike...

    PS: other tunnels must be wired throughout.

  • Adding items to a table and having the front Table is displayed correctly

    Hi all

    I'm working on creating a .vi who will take an old instrument and allow the operators on the ground record the data automatically instead of reading the data out of the instrument and to have to manually enter in the computer.

    The instrument is configured using a RS232 communication port, I can communicate with the instrument, and I have full control of all functions.

    My problem is when I am trying to gather data and add it to a table existing and then to have the front table information is displayed correctly.  At the end of which this table in its entirety will be saved in a template excel in an existing format, so I can't adjust the way I need to the table to display.

    Please take a look at pictures and give me a hand if possible.  I won't be able to view the .vi due to the nature of my work and I like to read the information of the instrument.

    Thanks in advance for any assistance!

    There is no way to solve this problem by looking at the pictures. Please attach a version of VI simplfied. Is the "FG" table just a driving force?

    What size of the 2D string table that comes out of the table of FG? There may be large enough to hold all the fields as empty strings, then you can (re) place values using 'replace the subset of table' to desired locations.

  • A means of detection of the current scene in a document class

    I just want to know if there is a way to do this.

    Thank you

    You can use the movieclips currentScene property.  control the class to see how you can use the reference of the scene of the scene, but if you only need the name, you can use:

    this.currentScene.name;

  • Select items in a table dynamically

    Hello...

    I am writing a program where you can choose the elements of the array dynamically from the Panel when the VI is in run mode.

    So far, that ic_opendevice.VI gives me different video formats [it is a 1 d array], at the moment, I guess as the penultimate among this table as an example. But, I want to design the program so that the user can select any Format of video of the façade. How to achieve this?

    Block diagram:

    Front panel:

    Why you did not update in video format in the structure of the event?  You can use the 'video 2' Format: value change event.  Then, everything is in a single loop.

    And you don't need to wait in your upper loop because the event structure will take care of your timing.

  • Get the current index value of the table control

    I have a table control 1 d on a panel that contains a value of temperature curve that I send to a temperature controller. The values in the table are not unique, because for example 40.5 degrees in the table could represent 40.5 degrees on the cycles of cooling or heating. I could have severat heating/cooling cycles programmed into the table. I would like a way to read the array index of the currently displayed item in the array in the up/down control of index on the left of the table control. I could then run curves partial temperature easily by neutrophilia a starting point on the curve in the table control.

    I don't see a property that I can use to get this index value. Anyone have any ideas?

    Thank you

    J

    Use the property 'index values. It will be the first item of the output of a 1-d array.

  • Add/Remove objects of the 3D scene programatically (or show/hide)

    I have a project I'm working on where we need to somehow add/remove objects in a 3D scene but without major lag.  Basically I have a set of objects in the real world I am reproducing in a 3D scene by loading 6 STL files.  I want to display only one of these items at a time.  When the currently displayed object is no longer present I want to quickly view another.

    I tried the subject 'remove' invoke the node without success.  I also tried a few other techniques that people have posted deal with transparency, but without a bit of luck.  It seems to me to recreate the scene when objects change is not an appropriate solution, because it seems to be a long process.

    I was wondering if there is someone who has done this or something similar in Labview.

    -Thad Briese

    These links are for images.  Not for 3D objects.  I had this work with the Object.Remove method.  The main thing to keep in mind is to know what items are currently displayed in places and do not attempt to apply transformations, etc to objects that have been deleted.

  • Flash CS5 advance the playhead to the next scene

    Hello

    Please forgive a simple question, I have not used the Flash for centuries.

    In Flash CS5 someone knows how to move the playhead to frame 1 of next scene? I may be wrong, but I thought that older versions of Flash would do it automatically.

    My scenes are a loop that is fine for some but not for others.

    I thought that I used to put a "goto and play" action on the last frame to return to section 1 of the current scene, if I wanted it shut.

    Otherwise, it would advance to the next scene.

    I can't find 'go and play' action except a clickable that you attach to a button.

    I tried to add a behavior but to get the message

    "This function is not supported by ActionScript 3.0. To use this feature, you must

    target the ActionScript 1.0 - 2.0 "

    Thank you for sharing your wisdom

    s

    by default, the playhead still coming through scenes.  If you are stopping on the last frame of a scene and is not to the next scene, there must be something that.

  • How to build a dynamic array index in the attribute 'to' house arrest

    Hi all

    I need to generate xml output with the appearance of multiples of the same complex element. The number of items is calculated dynamically. I use bpelx: append to add items, but I'm crashes when I try to assign values to elements using a variable to index items.

    How can you dynamically assign an array index variable in the attribute 'to' a copy instruction? I was able to do in the attribute 'from' the copy statement, following the examples indicated in the documentation for the xpath function. But when I use the concept of intermediate variable, I get a compiler error stating that the query attribute must start with ' / '.
    It works fine when I hard code the index in the attribute of "query" in the statement "copy to".

    I use 10.3.3 version JDev and 10.3.3.0 PM BPEL version.

    Here are the two methods I've tried:
    ----------------------
    < copy >
    < expression = "concat ('/ client: assTestProcessResponse / client: ScreeningComments / client: CommentItem [', bpws:getVariableData('notesCount'),'] / client: CommentText')" / >
    < variable = "queryText" / >
    < / copy >
    < copy >
    < expression = "bpws:getVariableData('noteText')" / >
    < variable = part of the 'outputVariable"="payload ".
    Query = "bpws:getVariableData('queryText')" / >
    < / copy >
    ----------------------
    < copy >
    < expression = "bpws:getVariableData('noteText')" / >
    < variable = part of the 'outputVariable"="payload ".
    Query = "/ client: assTestProcessResponse / client: ScreeningComments / client: CommentItem ["bpws:getVariableData(&quot;notesCount&quot;) " ""] / client: CommentText "/ >
    < / copy >

    ----------------------

    Has anyone had a similar problem? Please let me know this is doable and how.

    Thank you
    A.T.

    Hello

    I don't know if the following solution is what you want, but I'll try to explain how this would work; (o)

    I understand your question, you have a following like the watch of simple structure xml schema:

    
      
        
           
        
        
           
        
    
    

    The element is a complex type that has as a child element.
    The element can have 1.. * items

    As you explained that you know how to add loose, common is to use an XML Fragment example

    
      
        
          
            
          
        
        
      
    
    

    As you can see now there are two elements with the child element

    After the task to assign the variable content looks like:

    
      
        
          
            
              
            
            
              
            
          
        
      
    
    

    After adding the fragment, you can set the value for the for the first content element in the following way:

    
      
        
        
      
    
    

    The important thing is to know how to point to the correct position within the payload. It works with that part of the query statement

    [position()=1]
    

    or you can of course use the short version

    [1]
    

    The next task is to dynamically create the reference to the position. Therefore, you can for example use a variable. You can for example something like this:

    
      
        
        
      
    
    

    And the last step is to set the element of content dynamically using the defined variable

    
      
        
        
      
    
    

    The only thing to use the defined variable is that part of the query:

    [position()=bpws:getVariableData('Position_Variable')]
    

    Finally, the XML Structure should look like this:

    
      
        
          
            
              Content1
            
            
              Content2
            
          
        
      
    
    

    Concerning

    Alex

  • Dynamically control the size (in pixels) of elements of array?

    Hey everybody,

    I am writing a great vi where space façade becomes a limitation.   One of the elements I want to display is an array of Boolean flags (rectangular LED) 2D.  Is it possible to dynamically resize the elements of the array so that regardless of the number of items, the whole picture is still visible and has a constant print.  For example, the table is 8 x 8 elements and includes 160 x 160 pixels in front for each element is about 20 x 20 pixels.  Then, the number of items passes to the 4 x 4.  I want the display to stay 160 x 160 pixels, but the size of each element double 40 x 40 pixels.  Is this possible?

    Thank you all,

    Matt

    The solution graphic intensity is probably a little bit simpler. Here is an example. (The advantage is that the limits of the graphic remaining completely static).

  • How to fill a dynamic array according to the choice of the Viewer

    Hello

    I came across a dead end on my page "events".

    There is a dynamic array, get the information from a database. Initially, it will display upcoming events.

    At this point, my question is this:

    * Can fill the dynamic table based on a condition where the current date and the date of the event (as in the comic book) will be compared and if the date of the event is aware of the date, it will appear in the table. Otherwise, it will not.

    If I can do it, can someone please help me with the code?

    In addition, on the right side of the page there are 3 options for the Viewer:

    1. display upcoming events

    2 discovered past events

    3 search for events by month and year

    What I want to do, is that when the viewer clicks on 'past events', the table will be reset and populated by these events, whose date is exceeded.

    When the viewer clicks on "upcoming events", the table is reset again and filled with the relevant events.

    When the viewer selects a month and a year, the database to find reviews of research.

    Can we write this in php? Since I read smwhere that php does not work with onclick functions... I got confused. Cuz in my table data should vary depending on what the Viewer is clicking (coming events/events/research past events). I do not want to create pages for each type of event.

    If anyone has a better suggestion to complete this task, please share!

    Thank you!

    > Can I complete the dynamic table based on a condition if the current date and the event date (as in the comic book)

    > will be compared and if the event date is later than the current date, it will appear in the table. Otherwise, it will not.

    Of course. Just compare the date field in your database with the current time as returned by the function of date of your DBMS. Assuming you are using MySQL, you would compare your column with the currdate() function and the appropriate use of upper / lower to operators in the WHERE clause. If you don't know what a WHERE clause is then I invite you to learn SQL as soon as possible. You can't build data sites without a basic knowledge of SQL.

    > Since I read smwhere that php does not work with onclick functions...

    This means that php is a server side, where interactions with the user always occur on the client's site. But that doesn't mean that you can't call action from the side event on the client side server. Certainly, you can and would be.

    You should consider adding links to the page of dynamic array passing a querystring to the php script that determine which filter to add in the future WHERE clause to the current date, less, etc..

    Also, in the future, please post those questions on the application development forum.

  • Adding items to an enum shifts the constant on the BD...

    A picture is worth a 1000 words, here is my qualm:

    Why adds an element to a constant of the enum addressing the constant of the comic?

    I use a lot this approach for Pseudo-stacked sequences (I use instead a state machine) and I end up spending the enum constant after adding item wach, otherwise, it ends by disappears under what structure it is right...

    Of course, I could just right-click and use the Edit items property (which I've been using today doing my level of tolerance has ebbed down a lot lately), but unless this feature has been voluntarily integrated in LV, it is bordering the sadist.

    Tested in LV 2011.

    Hi guys,.

    Thank you for this comment! I was also able to reproduce here on my computer running LabVIEW 2011 SP1.

    This was reported to R & D (CAR # 339320) for further investigations. Please let us know if you find other problems, we like always your diligence and your comments!

  • Call for ensureIndexIsVisible after adding items to the dataProvider

    Hello

    I have a strange behavior where call ensureIndexIsVisible does not show the correct item.

    Did I miss the correct event to listen to after adding items to the list data provider?

    Description:

    I use spark.components.List with a HorizontalLayout to display my data.

    My data is displayed using the ItemRenderer.

    After the addition of new elements to the dataProvider, I register the Event.RENDER and within this handler, I call ensureIndexIsVisible and cancel the registration to this event.

    Add some data to dataProvider - some elements of thousnd

    list.dataProvider.add (...)

    list.addEventListener (Event.RENDER,

    function renderHandler(e:Event):void

    {

    show index

    list.ensureIndexIsVisible (indexToShow);

    list.removeEventListener (Event.RENDER, renderHandler);

    });

    I made the debug:

    1. If I comment removeEventListener, it will eventually work after some time the event fires.

    2. the original location that I see is a few points behind so if I scroll a bit I can find the desired article

    Thank you

    Roy.

    This blog can be useful: http://flexponential.com/2011/02/13/scrolling-to-the-bottom-of-a-spark-list/

Maybe you are looking for

  • Looking good 4 k monitor for end of 2013 Mac Pro

    I just ordered and received the LG 4 k monitors but when comparing them with the Apple thunderbolt display monitor they were still close in brightness or color rendering. They had an orange very little the cast to them. They were the 31MU97C-B models

  • Compaq NC6120 stuck at 'hp invent' screen

    Hi all I have a laptop HP Compaq NC6120 that no longer starts, it gets stuck at the 'hp invent' screen, and I can't do anything... OS is win xp RAM: 512 MB Any tips, advice or tips? thx a lot!

  • BlackBerry Smartphones PRIV Sync Pod w/1.2 m cable USB loading issueT

    The Pod of Syn PRIV is not charging my PRIV actually it it runs slowly. It is connected to a wall outlet (by the statement option.  However, it uses the wall adapter Z10).  Connection to a computer does not seem to load it or the other (although in b

  • HP DV9617nr - screen does not work

    My laptop screen has stopped suddenly display (modlel # in the subject). When I plug in an external monitor, it works very well. I have had him since about 2007 and this is the first question I had with her. Y at - it a fix for this problem or should

  • Mouse Sonar: Registry key? Specify the location of the pointer when I press the CTRL key

    Windows 7 Home Premium 64-bit(But this feature existed for several years, at least as old as XP). In Control Panel mouse pointer Options tab, there is a checkbox option: [b] "see the location of the pointer when I press the CTRL key". [/ b] When this