Issue of object shared (with DataGrid)

Guys...

I did some research and I am able now to have a list in my screen, with names and notes, and I get a name and a score...

However, the idea is to have all registered scores or at least the first five of them...

Any help?

That's what I have:

Frame...

function backToGame(e:TimerEvent):void {}

If (lives > 0) {//go back to game

} else {}

captureUserInput();

addChild (typeNames);

}

}

function captureUserInput()

{

captureText();

}

function captureText (): void

{

txt_inp.type = TextFieldType.INPUT;

txt_inp. Background = true;

addChild (txt_inp);

txt_inp. Text = myText;

txt_inp.addEventListener (TextEvent.TEXT_INPUT, textInputCapture);

}

function textInputCapture(event:TextEvent):void

{

OK.x = 800;

OK.y = 675;

addChild (ok);

}

var str:String;

var score: Number;

ok.addEventListener (MouseEvent.CLICK, toGameOver); This is a button that I have loaded

function toGameOver (e:MouseEvent): void {}

Str = txt_inp.text

score = count;

ok.removeEventListener (MouseEvent.CLICK, toGameOver)

addScore (str, score); with this, I have the name and the score recorded in the shared object (I copy the function in any case)

gotoAndStop (6);

}

function addScore(n:String,_s:Number):void

{

sO.data.highscore.push ({user: n, score: s});

sO.flush (); Save to disk

}

Okay, so I got another frame, where you have your name, your score and the possibility to see the best scores...

After that, I have the last picture, where scores assume to be, but I only get one made during this game and no one else...

Import fl.data.DataProvider;

Import fl.controls.DataGrid;

Import fl.events.DataGridEvent;

var dg_score:DataGrid = new DataGrid();

addChild (dg_score);      my DataGrid has been added to the library before (I wonder if I can export and load it into the code)

dg_score. Columns = ["Name", "Score"];

dg_score. SetSize (140, 100);

dg_score. Move (10, 40);

addingScore();

function addingScore()

{

var scoreArray: Array = new Array();

var scoreObj:Object = new Object();

var i: int = 0;

for (i = 0; i < sO.data.highscore.length; i ++)

{

scoreObj ['name'] = String (sO.data.highscore [i] .user);

scoreObj ["Score"] is String (sO.data.highscore [i] .score);.

}

scoreArray.push (scoreObj);

scoreArray.sortOn ("Score", Array.NUMERIC | ") Array.DESCENDING);

dg_score. DataProvider = new DataProvider (scoreArray);

dg_score. RowCount = dg_score.length;

}

So... what Miss me this indicate at least scores top 5?

Thank you in advance!

First confirm that the length of the sO.data.highscore.length is enough to give you the number of items you want to the list.

I don't think you want to be assigned...

scoreObj ['name'] = String (sO.data.highscore [i] .user);

scoreObj ["Score"] is String (sO.data.highscore [i] .score);.

in the loop like you because you're basically crush every time you looped.  The only value that is added to the scoreArray is the last assigned value.

Try something more to...

function addingScore()

{

var scoreArray: Array = new Array();

var i: int = 0;

for (i = 0; i< so.data.highscore.length;="">

{

scoreArray.push ({Score: String (sO.data.highscore [i] .user), Score: String (sO.data.highscore [i] .score)});

}

scoreArray.sortOn ("Score", Array.NUMERIC | ") Array.DESCENDING);

dg_score. DataProvider = new DataProvider (scoreArray);

dg_score. RowCount = dg_score.length;

}

(I don't know if I kept track of syntax as gar as between parentheses and brackets go into what I've rewritten just above)

Tags: Adobe Animate

Similar Questions

  • import objects shared with multiple files

    Hello

    I have a shared object that I would like to import with "Import shared objects" to create a library, but it contains a function defined in another line (#nclude), so I can't use the lvlib that produces the LV.

    I can solve this problem? How do I create a shared object that include other .o?

    Thank you.

    salvo980 wrote:

    The first among other .cpp for use function .cpp file. How can I include other .o? I have to use, for example:

    g++ name.o -shared -o libname.so
    

    with the '-l' option?

    g++ name.o -shared -o libname.so -L /usr/lib/name2.so
    

    Is this good?

    Thank you.

    It really depends. If you have two 'clean' cpp files, the simplest solution is to simply link the .o files all together in the phase of final link in listing them all as input for the llink gcc command file. Otherwise if your name2.so file already exists, you shouldn't really need to do anything special other than to ensure that it exists on the target system and is communicated to the linker 'ld' through the ldshared tool execution.

    Unlike Windows where each import must be paid at the time of link, either by an implementation of actual function in a file object or by the bias and the import file object library that performs dynamic load-time linking, shared Linux elf libraries do not need that. The linker during the generation of the shared library object file requires simply that the dynamic loader "ld" will be at the time of loading the shared library object file, resolve the symbols accordingly. That the purpose of the shared library must of course be installed and recognized by the linker to DL on the target, as mentioned above, copying in a well-known directory on the target and running ldshared awareness in the cache of the ld.

  • Cannot bind to the shared object created with LabVIEW 2009

    I have problems referring to a shared library built from a LabVIEW VI under RHEL 5 with LabVIEW 2009.

    To illustrate the problem, I created a VI with a digital input and output that corresponds to a certain number. Then, I created a draft specification of build to create a shared library with a feature that makes use of this VI square. The shared object is created successfully (square.so).

    When I try to compile a test application written in C, that connects to this library, I get errors in the following link:

    cc  -I/usr/local/natinst/nidaqmxbase/include -I/usr/local/natinst/LabVIEW-2009/cintools build/square.so  test.c   -o test/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(float&)@GLIBCXX_3.4.9'/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(double&)@GLIBCXX_3.4.9'/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(double&)@GLIBCXX_3.4.9'/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream >& std::basic_ostream >::_M_insert(double)@GLIBCXX_3.4.9'/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(float&)@GLIBCXX_3.4.9'/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream >& std::basic_ostream >::_M_insert(double)@GLIBCXX_3.4.9'collect2: ld returned 1 exit statusmake: *** [test] Error 1
    

    Running ldd reveals that liblvrtdark.so.9.0 is used for the execution of labview.

    In order to investigate on what could be the cause of the problem, I have compiled the nidaqmx basic examples, and I don't have an error. Current running ldd as reveals that he uses liblvrtdark.so.8.2 for the view of laboratory, time of execution.

    My suspicion is that some components of labview are being compiled with gcc 3.4 while others are being compiled with gcc 4.1 (which is the default compiler in RHEL 5).

    Any ideas how I could fix the build errors?

    Thanks in advance for your suggestions.

    PS.

    I enclose a tar file with the source files and here are the details of the ldd:

    ldd build/square.so         linux-gate.so.1 =>  (0x008de000)        liblvrtdark.so.9.0 => /usr/local/lib/liblvrtdark.so.9.0 (0x00b9c000)        libc.so.6 => /lib/libc.so.6 (0x00110000)        libstdc++.so.6 => /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 (0x009a7000)        libm.so.6 => /lib/libm.so.6 (0x00756000)        libdl.so.2 => /lib/libdl.so.2 (0x00256000)        libpthread.so.0 => /lib/libpthread.so.0 (0x0025a000)        /lib/ld-linux.so.2 (0x00b80000)        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00272000)
    
    ldd /usr/local/natinst/nidaqmxbase/lib/libnidaqmxbase.so.3.3.0         linux-gate.so.1 =>  (0x00e50000)        libnidaqmxbaselv.so => /usr/local/lib/libnidaqmxbaselv.so (0x00248000)        libc.so.6 => /lib/libc.so.6 (0x00689000)        /lib/ld-linux.so.2 (0x00b80000)        liblvrtdark.so.8.2 => /usr/local/lib/liblvrtdark.so.8.2 (0x00e51000)        libdl.so.2 => /lib/libdl.so.2 (0x00813000)        libpthread.so.0 => /lib/libpthread.so.0 (0x001b0000)        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x009c7000)        libm.so.6 => /lib/libm.so.6 (0x00b0a000)        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0050c000)
    

    Hi mimi,

    I'm happy to report that I managed to get the code to work. I have included some of the steps I experienced the problem in case it might help improve the documentation or future generations.

    In response to your question about the "error 1" reported by do, it's just an indication that detected a compiler error (it probably resembles the return code of the compiler).

    The errors ' undefined reference... @GLIBCXX_3.4.9 "have been narrowed down. The generated labview shared library, the square.so, links to /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 which is a symlink to usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6.0.9. I decided to compare this version of libstdc ++ that included with RHEL:

    strings /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 | grep GLIBCXXGLIBCXX_3.4GLIBCXX_3.4.1GLIBCXX_3.4.2GLIBCXX_3.4.3GLIBCXX_3.4.4GLIBCXX_3.4.5GLIBCXX_3.4.6GLIBCXX_3.4.7GLIBCXX_3.4.8GLIBCXX_3.4.9GLIBCXX_FORCE_NEW
    
    strings /usr/lib/libstdc++.so.6 | grep GLIBCXXGLIBCXX_3.4GLIBCXX_3.4.1GLIBCXX_3.4.2GLIBCXX_3.4.3GLIBCXX_3.4.4GLIBCXX_3.4.5GLIBCXX_3.4.6GLIBCXX_3.4.7GLIBCXX_3.4.8GLIBCXX_FORCE_NEW
    

    So libstdc ++ RedHat does not include a string for GLIBCXX_3.4.9.

    With this in mind, I was able to get my test application to compile using the version of LabVIEW libstdc ++ using the following makefile:

    .PHONY: all cleanCPPFLAGS=-I/usr/local/natinst/nidaqmxbase/include -I/usr/local/natinst/LabVIEW-2009/cintoolsLDFLAGS=build/square.so \        /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 \        -Wl,--rpath -Wl,/usr/local/lib/LabVIEW-2009/patchlib/
    
    all: test
    
    clean:        rm -f test *.o
    

    When you try to run the application, I got the following error:

    ./test: error while loading shared libraries: /usr/local/lib/liblvrtdark.so.9.0: cannot restore segment prot after reloc: Permission denied
    

    But apparently, it's because of SELinux prohibiting the use of libraries shared with moving text.
    This can be disabled by running /usr/sbin/setenforce 0 as root.

    The test application now works!

    See you soon,.

    RW

  • Issue of calendar entries sharing with groups of BBM blackBerry Smartphones BB Curve 8520-

    Greetings!

    I am currently using a BB Curve 8520. I have a problem with the birthday entries sharing with my BBM groups.

    When I add a birthday entry to my contacts from the phonebook, the phone will ask whether or not you will share this date with the BBM groups calendar.

    If I select No., birthday entry will continue to BE SHARED to your BBM groups.

    So I have to go to the calendar of the BBM groups to delete manually created entry.

    Can you help me to solve this problem with my phone?

    Thanks in advance!

    Hi, Ahmed.

    Follow the steps; below

    1. take a full backup of your device.

    2 reset the device (Do a security wipe)

    3 register your device with Netowrk.

    4. return the maintenance book.

    5. If more than one e-mail account then delete pulled CICAL service book of reset. (but keep a default for CICAL service)

    6. now, do a restore advance except BBM GROUP and data.

    7. now, create a new entry in the calendar.

    Please read the following threads for more info:

    http://supportforums.BlackBerry.com/T5/BlackBerry-App-World-General/calendar-issues-BBM-Group/TD-p/6...

    Courtesy: Santosh-Boiro

  • Remote object shared my kicks butt

    After 4 days, I'm still stuck with what should be a simple learning exercise. I'm not a developer starting with all means, which should not be beyond me. After a few weeks of reading, I now try to do some exercises of bite size for the ramp on the Communication (using Flex as the primary server) server. I'm missing something in my understanding and could use a good quick quick kick in the pants get me.

    All I want to do is created a remote object on the side server, then when a client connects, send and add a simple string to the remote object. While the customer gets the update and display the information in a text box. Here is the code I try to use, cleaned up a bit (so their could be a typo or two). He seized the idea of what I'm trying to do.

    I'm not sure what I'm doing wrong. The idea is to send a test string to the server to connect, and only the server to add to the object shared side server. In theory, I think, it will trigger the client onsync event to send the change to the customer. Fires of onsync but I see not the information contained in the customer... just get an "undefined"... What Miss me? Save me a week of pulling on my hair, if you can, please!

    Thank you!

    ==================server asc================================
    application.onAppStart = function()
    {
    trace ("onAppStart");
    Create the shared object on the side Server
    test_so = SharedObject.get ("myTestSharedObject");
    }
    application.onConnect = function (client, someTextForDisplaying)
    {
    test_so. SetProperty (myProperty, someTextForDisplaying);
    Returns true;
    }

    ==================client ================================
    var my_so: SharedObject;
    var nc:NetConnection;

    It is triggered by a click of a button in the user interface
    function createConnection (): void
    {
    to connect to the server
    NC = new NetConnection();
    nc.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
    nc.objectEncoding = ObjectEncoding.AMF0;
    //
    NC. Connect ("rtmp: / testApplication", "test string");

    }

    connected now connect the client to the remote object on the side Server
    function netStatusHandler (event: NetStatusEvent): void
    {
    Switch (event.info.code) {}
    case "NetConnection.Connect.Success":
    The connection was successful now create components
    User simple shared object and event management
    SharedObject.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;

    my_so = SharedObject.getRemote ("myTestSharedObject", nc.uri, false);
    my_so.addEventListener (SyncEvent.SYNC, usersSyncHandler);
    my_so. Connect (nc);
    break;
    case "NetConnection.Connect.Rejected":
    Alert.Show ("connection rejected.',"something went wrong");
    break;

    }
    }

    It's the event triggered when the remote shared object changes
    function usersSyncHandler (event: SyncEvent): void
    {
    display the information returned in the user interface
    txtDisplay = event.target.data.myProperty;
    or
    txtDisplay = txtDisplay + my_so.data.myProperty;
    }

    Solved it... don't know what the problem was, but it finally works...

  • the video is the future. How do videos PLAY when sharing with others?

    How to make video content on game Keynote when shared with others.

    Hey dominiek releases,

    Thanks for this info and choosing the communities Support from Apple. I know how important, given your speech work the way you want when share you!

    If I understand correctly, you want the video to play automatically. Good news is that it looks like it is possible!

    «When the media begins to play in Keynote: check the box "start the media when the click on" to start playback when you click.» If you want the media to play automatically when the slide is displayed, uncheck the box.

    Add video and audio - speech help

    See you soon!

  • How can I remove photos in an album that has been shared with me on my iPhone and Mac without unsubscribing to the album?

    How can I delete pictures on my iPhone 6 s and Mac Pro from an album shared with me without unsubscring to the album?

    Whence the Album? This would help to diagnose. Normally, on film, you select the photos you want, remove them and the album goes.

    If the Album has been synchronized from your computer using iTunes, then make a new synchronization without the selected album.

  • HP workspace: the customer has a machine dedicated virtual (VM) or is it shared with other clients?

    Hey everybody,

    Does the client have a machine dedicated virtual (VM) or is it shared with other clients?

    Thank you

    Bill

    Customers can be assured that their data are confidential and secure. The workspace of HP customers have a dedicated VM isolate their applications and other data. For licensed users, it's like having a PC dedicated to the cloud.

  • Satellite A300-1OM - Media sharing with XBox 360

    I'll have some real problems share my media with my Xbox 360 using my home wireless network.

    I used to connect my 360 to the internet via internet sharing with my laptop connected via Ethernet. I now borrow a wireless adapter for the 360 that still lets connect me to the internet on the 360, but I can no longer access my portable music library or find a PC Windows Media Centre when searching for the network on my 360.

    My laptop is running Windows 7 64 bit. When I display 'network' appears from my own laptop, my second laptop computer connected to the network is also shown, and the 360 is also indicated in the devices section of media. Under 'Options of Streaming Media' my 360 is also listed and given full access to my portable media.

    When my laptop is connected directly to my 360 via Ethernet the music library and video library works great, like Windows Media Center.

    Anyone know of any solution to this problem? I guess it will just be a problem with some settings on my laptop as opposed to a problem with my Xbox. Any advice much appreciated!

    Hey bradleyheap,

    To be honest it is very difficult to answer your question. In my opinion, you should ask question biotechnology in Xbox forum o somewhere else. I think that it is not related to Toshiba

    Anyway, if everything works with the LAN cable, you should check the firewall options. Try turning off the Windows Firewall and update the driver WLAN from your laptop.

    Sorry, but everything that s what I can say at the moment.

  • Apple Watch heart rate monitor, the signal can be shared with other devices such as the Garmin Edge 520?

    Apple Watch heart rate monitor, the signal can be shared with other devices such as the Garmin Edge 520?

    Hello

    No, that it is not currently possible.

  • A single storage backup subscription can be shared with all family shared devices?

    A single storage backup subscription can be shared with all family shared devices?

    I have a family membership of 200 GB storage for 5 of my iPhone backups under an account id unique apple.

    I'm separating each iPhone at its own apple ID to avoid current problems. Can I share the backup of the storage with the family share?

    If I can't, I'll have to buy a subscription to backup for each device that will be more expensive.

    Unfortunately, iCloud storage cannot be shared under sharing of family.  See more details here- family shares - Apple Support

  • Rich project shared with IO Library?

    I have an application that needs to share resources/instruments with TestStand steps.  Requirements require the application to communicate with these resources/instruments with or without leaving the engine of TestStand.

    I understand that the suggested approach is to put ONLY the instrumentation code in a test sequence.  However, what is the best approach if the application conditions dictate the resource or the instrument must be shared?

    • Project packed library can be shared with the operator interface?
    • Is a distribution source, the only option?

    Hey LVB,

    Thanks for the information. Based on what I think you are trying to you should be able to do what you are looking for. The reason that the manuals say to not use instrumentation with the interface code user is to preserve the modularity, it is not recommended that you add an instrumentation specific Interfacing to the OI of LabVIEW TestStand as this will make the instrument specific OI. And as long the .exe OI runs will run your instrumentation process, and until your operator selects actually trial USE or simple Pass (or whatever TestStand entry point you choose) the TestStand API will just await you. This example, I think that shows what you need to do the https://decibel.ni.com/content/docs/DOC-21047.

    I hope this helps.

  • Run-time error '91'; Variable object or with block variable not set "

    Help, please... I had "run-time error '91'; Variable object or with block variable not set "for kawai2004 game.  Please help how to fix this error.  Thank you very much.

    Hello

    See the following article
    http://support.Microsoft.com/default.aspx/KB/822521

  • is the canon 28-135 ultrasonic objective compatible with the EOS 6 d

    is the canon 28-135 ultrasonic objective compatible with the EOS 6 d

    Yes, it's... and it's a pretty decent lens.

  • Internet connection shared with Xbox

    I need to restart my internet connection shared with my Xbox everytime I turn it on to connect to Xbox Live.  How can I keep this happen and more keep the Xbox all the time?

    Hi JohnnyBz,

    I suggest you send your query in Xbox live forum to get the best support that this is a dedicated forum for Xbox live. Link: http://forums.xbox.com/

    With regard to:

    Samhrutha G S - Microsoft technical support.

Maybe you are looking for

  • Configuration synchronization on a new computer.

    Previously, I synced my portable Firefox with my cell phone. My mobile Firefox has now all of my favorites of the laptop. My laptop crashed. I bought a new laptop. I want to transfer my favorites from my mobile to my new laptop.How? 1 - sync does not

  • Playlist with tracks near ruined my music library

    Hello I have a big problem with iTunes. For precision, the products I use are: -iTunes game -Apple music On the following devices: -iTunes for PC (Windows 10, updated yesterday) -iTunes for MacBook Pro (12.3.2.35) -Music App for iOS (iPhone 6 iOS 9.2

  • after update I can no longer delete apps from the screen or move

    My watch updated the software this morning. Since then I can't move or delete applications from the screen saver.  I have to do it from the phone.  Hold an application icon does nothing

  • Computer laptop GATEWAY with Windows 7 will not be updated, and I searched this site for instructions.

    I followed the instructions to make sure I don't understand the "update notification" on stop downs and other tips, but I have more patience at this point.  This has been going on and I can't the system up to date.  I made every effort (by previous q

  • The most recent update of vista

    I was working on my computer a few days ago, and the little thing goes out that there is an update to windows. (I have vista) This is my first and biggest problem ever. It corrupted my id user so all my itunes songs and school papers and locked and I