Problem in creating a global var 'data' to a json file - need help

I'm having a problem with a code and need help.
I use the code below to load and parse a JSON file and store the result in a var 'data '. Everything works fine on the compositionReady page. The problem is that it would save a lot of extra time analysis of loading/if I could do this 'data' available worldwide. With the current

var = eval (json) data

the 'data' are only available locally. So, how do I or can I do a global var ABOARD cela?

Here's what I have now and what I tried.

$.getJSON ("images/profiles.json", function (json)

{
SYM. Data = eval (json); it does not work
data var = eval (json);
var temp = eval (json); , and is not this pair
sym.setVariable (temporary data)
for (i = 1; i 17 <; i ++) {}
sym.getSymbol("thumb"+[i]).$("thumb1").css ("background-image", "url (".thumb + data.player [i] + ")" ");
sym.getSymbol("thumb"+[i]).$("j_num").html (data.player [i] .j_num);
sym.getSymbol("thumb"+[i]).$("p_name").html ((data.player[i].f_name) + "< br >" + (.l_name data.player [i]));
} / / 3 above lines retrieves the thumbnail image of players, Jersey number and first - last name. it's all working well
}
);
SYM.$("stage"). CSS({"margin-left":"auto","margin-right":"auto"});)

There are 17 other 'profile' of sym.elements leaves, who will appear via ' by clicking on ' an animated image of an inch. Each sheet contains approximately 20 "fields" that get their data from the JSON file. If it is better to recharge/eval the json for each sheet I can do. It's just seems a better idea to be able to access the same 'data' and only load/parse it once?
If any of you gurus of coding could help me I would appreciate it.

Thank you

Joel H

Rough workaround is to use data = eval (json). This will create a global variable. Not a good solution though. Smarter way is to use the setVariable() method: sym.getComposition () .getStage () .setVariable ('data', eval (json)). After that, you can use data var = sym.getComposition () .getStage ().getVariable('data') to access.

Tags: Edge Animate

Similar Questions

  • Load GroupDataModel data in a JSON file?

    I have a ListView in QML using a RPC GroupDataModel that is created from a .json file in the assets folder. The items in this list are removed and added to. CPP how can I get the GroupDataModel data in the JSON file?

    I know that it is this:

    JsonDataAccess jda;
    jda.save(huh?, "/app/native/assets/employees.json");
    

    How can I get data from GroupDataModel in a QVariant to put in the first parameter of this function? I can't stick my GroupDataModel m_model in there; It causes an error.

    Found the conversion. Thanks to prevent me from giving up and leading me in the right direction!

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=Cascades&message.ID=25288#M25288

  • Problem steps Recorder error - you have not permissions to system files needed to create the specified output file.

    I am trying to use the PSR as a domain user, but get the following error message when you try to save my record:

    "You don't have permissions of system files needed to create the specified output file.
    If I run the present when logged in as a domain administrator, I can record without problem.  But when logged in as a domain user, I get the error.  I tried "Run as Administrator" as well as "Run as different user", enter the domain administrator credentials, but still get the error.
    Everyone knows about this problem?

    Hello Giblits,

    Because the computer is connected to a domain, it would be better on the TechNet forum. I suggest you post your question on the following link to get the exact resolution.

    http://social.technet.Microsoft.com/forums/en-us/category/w7itpro

  • Creating Instances of symbols containing an image dynamically resolved - need help

    I'm working on a prototype site which has many images flown in the navigation. Each image is unique, but the code rollover and rollout is identical. I am trying to create a unique symbol which can be used for all the bearings, but need help to figure this out, because it will considerably speed up my work.

    I think that the pseudocode would work like this:

    1. Create a symbol that contains a default rollover image.
    2. In the symbol, add the code rollover and rollout. To set the transparency of 0 - > 100 and back.
    3. Create instances of the symbol on each element of the NAV.
    4. For each instance, set a variable containing the name of the rollover image to use.
    5. In this instance of symbol, get the value of the variable.
    6. In this instance of symbol, use the image name in the variable to replace the default image.
    Question: How do the job 4 to 6 step? I have 1-3 working smoothly. P.S. my last work of dev is waaaaay returns with the Director, PHP and ColdFusion. I still get basic principles such as the use of the functions, instances, objects, inheritance, etc., but the language has changed. And I have very very little experience with the DOM.
    Appendix: How I do it manually
    1. There is a background image of the NAV showing all unselected States
    2. Each element of the net asset value has a rollover image in a series of elements on the nav element. Each bearing has initially set to 0% opacity.
    3. Each element of a rollover image, deployment and click triggers. Triggers rollover and deployment are the same for each. There is also a little more code with deployment that provides a quick fade. It means a lot to copy same code. I hate the idea of having to change any part of this code.

    Thank you! Chassy

    A big thank you Tim (?)!  You saved me a lot of hours on this project.  I'm still learning more jQuery / javascript behind Edge.  Could you assess if my interpretation of the loop content is accurate?  This is my understanding of the code is more limited:

    • SYM. $(array_btns [i]) - access to jQuery object associated with the element of border.
    • MouseEnter (...), - the content define the code to be executed during the passage of the mouse.
    • {obj:array_btns [i]} - refers to the element in the jQuery object, represented by the symbol of edge
    • function {...} - function to run on the given event within the given object/symbol.  The role of the "e" parameter is something I'm not clear on that.  The flow of the code, it seems to represent the edge symbol that contains the element that will be affected by the code.
    • var = e.data.obj BTN - implements a variable to refer to the side of edge.  I think it is the same symbol as number 1 above.
    • sym.getSymbol (btn).$("over").fadeIn (500) - runs the jquery code for fade in at the moment the jQuery "over" event is triggered.

    Also, I'm about to start testing to see if it works in nested symbols.   I guess compositionReady Trigger for each symbol, I can create a [array_btns] and then call sym.getComposition () .setup_btns ()?

  • I have a problem with an error in windows media center: ERROR VIDEO files needed to display video are missing or corrupt.

    The error is: ERROR VIDEO files needed to display video are missing or corrupt.

    I Run Setup and restarted my computer at a later date.  I've always been unsuccessful.

    Can anyone help. Thank you

    Update your graphics card driver. Visit the manufacturer's Web site to download and install the latest graphics driver. Once proceed as follows: -.

    You must uninstall and reinstall the tv tuner card driver.

    1. start.

    2. in the start search box type:devmgmt.msc and press the Enter key.

    3. scroll sound, video and game controllers and expand it.

    4. right click on tv tuner card and uninstall it. Uninstall the device as software driver.

    5.reboot.

    6. visit the manufacturer's Web site to download and install the latest update and compatible tv tuner card tv tuner driver.

    7. now open Windows Media Center and re-run the whole upward.

  • Mapping of extraction of SAP data, where the JCO files need to be copied?

    Hi all

    I have the following environment.

    Customer OWB: Windows7
    OWB server: Linux x86_64
    SAP server: Windows Server 2003

    I need to create the OWB mapping to extract data from SAP to the target of the Oracle.

    Let me know what are the required files JCO and where should I copy?

    Do I need to copy them to the customer owb and the server or is it enough to copy them on the client computer only?

    Thank you and best regards,
    Pnreddy.

    Customer OWB only is not supported on 64-bit Windows, I wanted to just let you know since you mentioned Windows 7...

    For windows, you will need sapjco.jar, librfc32.dll and 3 files sapjcorfc.dll. You can get them from the SAP installation cd or download on http://service.sap.com/connectors for your SAP version. You will need to have a SAPnet account to do so.
    You can place the files sapjcorfc.dll and sapjco.jar in OWB_HOME\owb\lib\int and in OWB_HOME\owb\bin-librfc32.dll and also set the path to reference the directory.

    For linux, you will need librfcccm.so, libsapjcorfc.so and sapjco.jar. Also set the LD_LIBRARY_PATH to reference these file locations.

    If you extract metadata from SAP then you need only on the OWB client, but if you plan to run ABAP programs on the SAP system, you will need to set up on the side server.

  • created by the script of a radio button. Need help on the Cancel button.

    Hello

    After you run this script, when I choose German, french or button of Italy and clicked on Cancel button, then window should be closed but it shows for example to alert respective 'German clicked u. "

    Thank you

    Marie rosine

    var win = new window ('dialog');

    win.alignChildren = 'left ';

    victory. German = win.add ('radiobutton', defined, 'German');

    victory. French = win.add ('radiobutton', defined, 'French');

    victory. Italy = win.add ('radiobutton', undefined, 'Italy');

    win.cancelBtn = win.add ("button", undefined, "Cancel");

    win.quitBtn = win.add ("button", undefined, "Ok");

    win.defaultElement = win.quitBtn;

    win.cancelElement = win.cancelBtn;

    victory. German.Value = true;

    win.quitBtn.onClick = function() {}

    end = 1;

    Win.Close ();

    }

    win.cancelBtn.onClick = function() {}

    end = 1;

    Win.Close ();

    }

    Win.Show ();

    If (win. German.Value is true)

    {

    Alert ('German clicked u')

    };

    If (win. French.Value is true)

    {

    Alert ('clicked u French')

    };

    If (win. Italy.Value is true)

    {

    Alert ('clicked u Italy')

    };

    var win = new Window ("dialog");
    win.alignChildren = "left";
    win.German = win.add ("radiobutton", undefined, "German");
    win.French = win.add ("radiobutton", undefined, "French");
    win.Italy = win.add ("radiobutton", undefined, "Italy");
    win.cancelBtn = win.add("button", undefined, "Cancel");
    win.quitBtn = win.add("button", undefined, "OK");
    win.defaultElement = win.quitBtn;
    win.cancelElement = win.cancelBtn;
    if (win.show() == 1){
     if (win.German.value == true)
     {
      alert ("u clicked German")
     };
     if (win.French.value == true)
     {
      alert ("u clicked French")
     };
     if (win.Italy.value == true)
     {
      alert ("u clicked Italy")
     };
    }
    
  • Bluetooth problem on my new laptop HP Pavilion G series and really need help!

    I recently bought my new laptop and yesterday when trying to send a picture from my phone to it, files have not been sent, even though she said the phone and the laptop were connected, he mentioned something about Image push, but I am new to HP, so I'm not aware of what exactly is and desperately need help Please could someone help me with this, I would really appreciate that I could not yet send the file via bluetooth. Thanks in advance!

    D3,

    You said,

    "bluetooth device has not been successfully installed.

    You said,

    ""photo from my phone it it was settled, but it says ' unable to connect ' "." "

    I'm a little confused by what you say, but I do not understand 'unable to connect '.

    • It's time to go back to information I sent you and go through the installation program.
    • You can also use the HP connection manager to help you get the job done.

    Here is the Connection Manager software.  Download and install it.  Your computer already has the software, it's going to tell if the package will install...

    HP sp54945 V4.1.25.1 Connection Manager

    Once the software is installed...

    And you want to use the HP Connection Manager software.

    • Make sure that your wireless network is enabled,
    • Then look in your taskbar for your Connection Manager icon and
    • Double-click to start

    If you do not see the icon in the taskbar, you can do the following:

    Start > search / type "HP connect" >

    Click on 'Hp connection manager' when you see it in the start list

    This is a HP Connection Manager Help file.

    The document explains how to use the software to connect your Bluetooth devices (and wireless):

    Connecting to a network with the 4.x connection manager

    Good luck!

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

    When you appreciate the effort...

           Please click on the Star Bravo on the left to tell "thank you"! ""

        Is it solved? Make it easier for other people to find the answer:

    Please Mark my Post 'accept as Solution' to say "Yes!"

    Remember: the more information, help, best you , you can receive.

    Always include: (Notebook) product number , printer - model number ,.

    Operating system and a Description of the error

    Never give your serial number

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

    2012 the year of the Dragon!

  • the hard drive of my dell xps 420 has been removed nothing has been saved. my computer is now junk, or my data can be recovered? Need help real bad

    About two years ago, some so-called friends takes my computer to my home. He truned into a question of law. I finally got it back. However they took the hard drive. And I'm almost 100% sure that nothing has been saved. where should I go from here, the computer is any good? This P.C. I encrypted a $ 1000.00. What should I do?

    Hello

    You can get a new hard drive and reinstall Windows on it.

    Check with the manufacturer of system for options.

    If it will run Windows 7, which would be the best option.

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

    If they were under a court order to return the computer of course sounds like they should have to
    Return it with a drive hard and in good condition. Mybe not because I don't know any of the details.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • I have the most recent Acrobat and Excel on a new computer. On top of my old computer, my old Excel sheet, I used to have a tab for Acrobat, which, once clicked would give me one of the options for creating and attach to the e-mail. I need help with this

    Read above.

    You must ensure that you have version 11.0.1 or higher to make it compatible with Office 2013.

    If this is the case, then try to run a repair installation.

    This is not the latest version of Acrobat, said by the way. Acrobat CC is the latest version.

  • Problem with the application after the installation of the .bar file

    Hello

    I created an application. Everything works fine when I compile Momentics, but when I create a file via the 'Export release build'.bar and install this file on the device app does not work properly.

    The application creates a profiles and showing them in the list view, all the data in the json file. When I install the application of the .bar file create profile and change the settings for this profile and return to the main screen, profiles disappear. This problem will not occur when you compile a program on the phone directly from Momentics.

    Welcome on the support forums.

    you reproduce the workflow step by step with a debug version?
    do you have any record that can give you advice? If not, add a little.
    where is the location json file that you use to save the data? Perhaps a relative path is used.

  • Dynamic loading videos - how to integrate data from json files in video placeholder at the stage

    Hello!


    Working on a site where I want to display a variety of videos. Found a tutorial with a good script for loading dynamically the contents of a json file.

    $.getJSON ("data / press.json", function (data))

    {

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

    {

    var s = sym.createChildSymbol ("slide", "Stage");

    s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

    s.$("title").html (Data [i] .title);

    s.$("headtext").html (Data [i] .headtext);

    s.getSymbolElement () .css ({"location": "absolute",})

    "the left": "50px",

    ({'top': I * 200 + 50 + 'px'});

    }


    The json file content looks like this,


    [

    {

    'image': "images/poster_.jpg,"

    "title": "my test."

    "date': 'my date."

    "headtext": "my text",

    'video': "http://www...".

    },

    ]


    Unfortunately, there is nothing of video in the above script.

    Anyone know how I can,


    1 / choose my "video" variable data in my json file (guess the script needs a line like: s.$("video").html (data [i] .video);)     or something)

    2 / dynamically put in my video placeholder where my video script of the show is.

    -----

    YouTube var = $("< iFrame/>");

    var url = " " https://www.YouTube.com...; "


    SYM.$("video"). Append (YouTube);

    YouTube.attr ('type', ' text/html');

    YouTube.attr('width','640');

    YouTube.attr('height','360');

    YouTube.attr ('src', URL);

    -------

    Most grateful for any advice

    Best regards

    Bengt, informel.se

    Looking at the code of the success of your JSON Manager, it seems that you want to create a list of these items on stage with several video clips too. You can create the iframes required in success of the JSON Manager and set the src attribute according to the video attribute of the incoming JSON data. An approach could be as follows:

    $.getJSON ("data / press.json", function (data))

    {

    for (var i = 0; i)

    {

    var s = sym.createChildSymbol ("slide", "Stage");

    s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

    s.$("title").html (Data [i] .title);

    s.$("headtext").html (Data [i] .headtext);

    s.getSymbolElement () .css ({"location": "absolute",})

    "the left": "50px",

    ({'top': I * 200 + 50 + 'px'});

    Assuming that you have a video called placeholder in the slide of symbol

    var YouTube is $("").attr('width','640').attr('height','360');.

    YouTube.attr ('src', Data [i]. Video);

    s.$("video").html (YouTube);

    }

    }

  • Need help importing CSV file with commas in the rest of the data

    I have a linux script that gets the CSV files from a remote server and import the data into a table using SQLLoader.

    The problem I have is that the data in the CSV files sometimes contains commas in the text field that is interfering with the import and I have no control over what is in the file.

    my table:

    Create the table my_tab
    * (TIME_STAMP date, *)
    REQUEST_IP varchar2 (30),
    User_id varchar2 (30),
    FACILITY_ID VARCHAR2 (255),
    Number SUBFACILITY_ID,
    DETAIL VARCHAR2 (255)
    *);*

    example of a CSV file:

    * 27032011 story 232708,162.108.20.61,user123,cstmr_view_hlr_history,0,Viewed with 10 results per page for 1234567890 *.
    * 232737,162.108.20.61,user123,cstmr_view_customer,0,Facility 27032011 [display] selected *.
    * 232744,162.108.20.76,user123,cstmr_add_gprs,0,Facility 27032011 [Add x] selected *.
    * 232759,162.108.20.94,user456,cstmr_hlr_request,0,Facility 27032011 [x orders] selected *.
    * 27032011 added 232806,162.108.20.94,user123,cstmr_hlr_request,2,Customer note: note [x], MSISDN [1234567890] *.
    * 232806,162.108.22.96,user789,cstmr_hlr_request,0 27032011, queue update: Action [46], IMSI [1234567890] old [, MSISDN IMSI [1234567890] *.
    * 232815,162.108.20.67,user789,cstmr_view_customer,0,Facility 27032011 [display] selected *.
    * 27032011 232822,162.108.20.67,user123,cstmr_view_customer,5,Screen ' display customer details ': MSISDN [1234567890] *.
    * 27032011 232702,162.108.20.57,user456,cstmr_hlr_request,0,Queue update: Action [45], IMSI [1234567890] old [, MSISDN IMSI [12345678901], AFN [], [PDPREC] *.
    * 27032011 connection 232825,162.169.22.108,user456,adm_login,1,Successful: user [user_name] *.
    * 232829,162.169.22.108,user456,cstmr_view_customer,0,Facility 27032011 [display] selected *.

    How can I get around the commas in the text?

    Published by: cinnamon on April 4, 2011 08:07

    There is a way to do it, but it depends on a few assumptions, and (b) you have to jump through hoops to do it.

    First of all, this only works if there is no comma request_id, user_id or facility_id. (if there is, then you're stuck, because there is no way to determine which commas are part of data and those that are separators.)

    Second, he must know if there are any particular character - say | -who never appears in the detail.

    If you can do both of these assumptions, then what you have to do is:
    (1) create an array that consists of a single VARCHAR2 column large enough to hold longer line of your input data.
    (2) to import your data into this table.
    (3) replace the first five commas in each row of the table with. (or whatever your "unused" character).
    For example:

    UPDATE temp_data_table
    SET row_text = REPLACE(SUBSTR(row_text, 1, INSTR(row_text, ',', 1, 5)), ',', '|') || SUBSTR(row_text,  INSTR(row_text, ',', 1, 5) + 1);
    COMMIT;
    

    (4) write a SQL INSERT command to build your target table according to the values separated by the | characters.

    -Don

  • Loading a file into a global variable problem - really a global var text?

    Of all the documentation and the examples that I can find, it seems that it would be

    fix to create a global table [outside any function] variable to load image names

    then use these images to a slide show. I want to do the dynamic application, modify the text file as a new series of images.

    The global variable passes zero [any value] after the load event listener. Why is this?

    Is not global and world alive for the duration of the SWF?

    PARAMS. TXT:

    monthNames = January, February, March, April, may, June, July, August, September, October, November, December of & dayNames = Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

    CODE:

    var dNames:Array = new Array();
    var mNames:Array = new Array();
    var request: URLRequest = new URLRequest("images/params.txt");
    variable var: URLLoader = new URLLoader();
    variables.dataFormat = pouvez;
    variables.addEventListener (Event.COMPLETE, completeHandler);
    Try
    {
    variables. Load (request);
    }
    catch (error: error)
    {
    trace ("unable to load URL:" + error);
    }
    trace ("2 mNames 2:" + mNames [2]);
    trace ("2 dNames 3:" + dNames [3]);
    Stop();

    function completeHandler(event:Event):void
    {
    var loader: URLLoader = URLLoader (event.target);
    dNames = loader.data.dayNames.split(",");
    mNames = loader.data.monthNames.split (",");
    trace (Loader.Data.DayNames);
    trace ("1 mNames 2:" + mNames [2]);
    trace ("1 dNames 3:" + dNames [3]);
    }

    OUTPUT:

    2 mNames 2: undefined
    2 dNames 3: undefined
    Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
    1 mNames 2: March
    1 dNames 3: Wednesday

    How to access these values after the loading of the external file, after charging?

    Thanks in advance.

    The statement you quoted all Adobe documentation is correct.

    If you want to load the data into the tables before anything else happens, then have everything that happens to run via the function completeHandler... when the data is loaded and processed in the tables.

    the command: loadFile() runs before the trace ("2:" + images [4]); command.  The loadFile function is processed and loading process BEGINS... but begins loading does not delay the main treatment to continue down the line - the loading itself becomes a secondary/background task.  The order was to run the function loadFile and the processing of this function has been completed.  If you don't believe, then add a trace...

    function loadFile (): void

    {

    vars.dataFormat = pouvez;

    vars.addEventListener (Event.COMPLETE, onComplete, false, 0, true);

    Vars.Load (new URLRequest("images/fnames.txt"));

    trace ("implementation");

    }

    If you add this trace, you will see the execution of function loadFile is completed and the following line in your code is then treatment... trace (2...)

    The addEventlistener method does not stop anything.  The addEventListener method code is assigned a monitor, not a traffic controller... it's say the monitor to indicate when the loading data are complete.  It does not do anything to stop the execution of the program.

    So if you want to wait until the data is loaded before anything else... it goes...

    function onComplete(evt:Event):void

    {

    var urlVars:URLVariables = evt.target.data;

    images = vars.data.images.split(",");

    tnails = vars.data.thumbnails.split(",");

    ................ HERE.................

    }

  • When Microsoft will fix the problem they created with Skype.

    It's been more than 24 hours now that Skype has worked on my pc. When Microsoft will have their sh * t together and rectify the problem, they created with this program. Now it becomes ridiculous and smells of incompetence!

    Hello

    Be sure to contact the Skype Support like this might be a known issue and they might have the solution.
    There is also information and on the Skype Forums.

    There is an alert to update Skype system on the Skype homepage
    http://www.Skype.com/intl/en-us/home?intcmp=Alogo

    Skype - Support
    https://support.Skype.com/en-us/

    Skype - Forums
    http://Forum.Skype.com/

    It's the latest Skype Heartbeat information in date 27/05/2011:

    Skype Heartbeat - [MAJ] problems connecting to Skype and calls for a small number of users
    http://heartbeat.Skype.com/2011/05/problems_signing_into_skype_an.html

    I hope this helps.

Maybe you are looking for

  • How to prevent the FF loading all Web sites using the HTTPS protocol

    FF is trying to load initially all Web sites using the HTTPS protocol, including of mozilla.org. Then I get the error of no reliable connection of course. Mozilla .org is the "invalid security certificate" and "the issuer of the certificate is unknow

  • Need advice on the Satellite Pro M40

    I wonder if someone could advise me. We just bought 8 smart tips for our school with these I ordered 8 portable computers SatProM40. When I ordered them I checked the spec as follows Toshiba SatProM40 - Celeron M360 1.4 GHz - RAM 256 MB - HD 40 GB-CD

  • Qosmio G30 - can't read HD-DVD

    Had this laptop for a while, but decided to try and find a HD DVD for the first time. Computer does not recognize the HDDVD. Play normal DVD OK but will not play the HDDVD? Anyone out there can help. I have very limited technical knowledge simple ins

  • setting up outgoing e-mail profile

    Hello I am configuring a new outgoing e-mail profile to use for the scan on my HP 8600 using a gmail account. I keep getting "Incorrect credentials" when I test the configuration (my credentials are correct).  I tried different ports and turn on and

  • ThinkCentre M92p - Linux boot problem

    Hi all! I recently bought a new Lenovo ThinkCentre M92p. unfortunately I can't seem to run with Linux. I tried the two openSUSE 12.2 x 64 and Ubuntu LTS 12.04.1 x 64 (just to make sure that it is not only a problem of the OS or the installation media